Displaying 1 result from an estimated 1 matches for "view_neighbour".
2006 Mar 30
2
acts_as_ordered plugin
...If you want the next and previous methods to wrap around the ends, use:
acts_as_ordered :order => ''first_name'', :wrap => true
You can use this in a application to be able to quickly browse through
people. Eg:
class PersonController < ApplicationController
def view_neighbour
# params[:direction] is passed off the page as ''next'' or ''previous''
@person = Person.find(params[:id]).send(params[:direction])
render :action => ''view''
end
end
Problems, comments, and suggestions all welcome.
Cheers...