in controller, change the ‘list’ action to be ‘index’. List is not
used by the REST defaults
def index @courses.find(:all, :order => params[:sort])
end
in your routes make sure you have
map.resources :courses
Don’t forget your checking when bringing in the params[:sort]
parameter
If you need custom routes for your REST app do this, but think about
the requirement first (it’s not a bad thing to do when you need it,
but often you don’t need it):
etc. Collection takes the pluralised controller name plus the method
you define, e.g. courses_search_path = ‘/courses/search’
member takes the controller, plus a record selected by id, e.g.
course_enable_path(@course) = /courses/1/enable
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.