RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: jquadrin
This is an unbelievably awesome platform, very interesting..
why does the line @haiku.add_or_update_evaluation(:votes, value, current_user) generate the error:
@haiku.add_or_update_evaluation(:votes, value, current_user)
undefined local variable or method `user'
def vote value = params[:type] == "up" ? 1 : -1 @haiku = Haiku.find(params[:id]) @haiku.add_or_update_evaluation(:votes, value, current_user) redirect_to :back, notice: "Thank you for voting" end
application controller:
def current_user @current_user ||= User.find(session[:user_id]) if session[:user_id] end helper_method :current_user
How can this be corrected?
This is an unbelievably awesome platform, very interesting..
why does the line
@haiku.add_or_update_evaluation(:votes, value, current_user)
generate the error:application controller:
How can this be corrected?