Ruby on Rails Sunday, May 2, 2010

Hi,

Basically I currently have this system where there are categories, and
tutorials; obviously categories have many tutorials, and every
tutorial must belong_to a category.

The tutorials are then displayed in order of there id (auto-
incrementing) in their categories show method.
The thing is, I want to create a link that goes from one tutorial
(with an id of 10 for example) to the next tutorial in that category
(which might not have an id of 11, as I create different tutorials at
different times, therefore creating different ids for two tutorials
seemingly next to eachother in order).

Obviously I know I will need something like this:
<%= link_to 'Next lesson....', %>

but I just don't know how I can manage it..

By the way, every tutorial has a: category_id to determain which
category they are in (this is an integer).


Please Help,

Thanks In Advance,

Joe

--
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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment