On 7 May 2010 16:28, Joe <j...@dev-hq.co.uk> wrote: > <%= link_to 'Next', Tutorial.next_lesson(@tutorial.id, > @tutorial.category_id) %> > > Does anyone know why this is happening?
I'm only gonna reply this time because you're being so dammed polite. But no more from me on this thread... You're putting the result of your class method into the link_to; the link_to expects a single AR object, but the method is returning an array of them. You could test all this yourself in a console. Run your method and see what happens. Then either change the :all to :first, or do something else to get a single object (urm... I dunno... like maybe use a plugin that does it all for you... I've heard acts_as_list is good ;-) > EXTRA NOTE: By the way I plan to learn more ruby as it is really easy, > and is helping my RoR lots. Good for you. It will, given what the first 'R' stands for! -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.