Ruby on Rails Monday, September 1, 2014

On Monday, September 1, 2014, Fatima Fatima wrote:


I thought I had defined the method, but I keep getting an error.  Should
I just be able to call  user.favorite_places?  Would appreciate any
help.
...
  def index
     @places = User.favorite_places
  end

Is this where it's blowing up?  You're using it like a class method there, when most likely you've defined it as an instance method.  Glancing at the rest, I think you meant current_user.favorite_places.

-Dave the Codosaurus


--
Sent from Gmail Mobile; please excuse top posting, typos, etc. :-(

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHxKQigGHjW10dJRDOfX3sypmiVLNy13WUs6dJu7jB7nQENFLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment