On Feb 17, 6:47 am, Chris Hanks <[email protected]>
wrote:

> That doesn't give an error, but it doesn't work either. So, I'm kind of
> at a loss about how to do this. I could do it the way the Railscast does
> it, and go into the Test controller and Show action and make:
>
> @questions = Question.all(:order => "position")
>
> And change the view accordingly, but I wouldn't be able to fix the
> answers the same way. There must be some kind of Rails Way that I'm
> missing? Or some bit of syntax?
>

well you can do question.answers.find(...) if you want, that find will
be scoped to the association. or you can add the condition to the
association itself, ie

class Question
  has_many :answers, :order => 'position'
end

Fred
> Thoughts? Thank you!
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to