Get the basic 7 REST actionsclass UsersController < REST::RestController
end Pass in a custom sort to index def index(options = {})
super :find_options => {:order => 'date DESC'}
endOverride init with custom behaviordef show
@report ||= Report.find_by_date(params[:date])
@page_title ||= 'Sun Valley Fishing Report'
super
endPass in a custom editing template for error cases def create
super :template => 'foo_edit'
endA mix of the above # Either index only exists in the parent controller, or it merges options and then calls super
def public_index
@page_title = 'Sun Valley Fishing Report'
@body_class = 'archive'
index :template => 'public_index'
end
|