Let's update draft:resource to use the new style for querying that we've been using in class: first put the Whatever::ActiveRecord_Relation in a variable called matching_whatevers, then proceed to do an .at(0) or .order to produce the instance variable.
def index
matching_whatevers = Whatever.all
@list_of_whatevers = matching_whatevers.order({ :created_at => :desc })
render({ :template => "whatever_templates/index.html.erb" })
end
Let's update
draft:resource
to use the new style for querying that we've been using in class: first put theWhatever::ActiveRecord_Relation
in a variable calledmatching_whatevers
, then proceed to do an.at(0)
or.order
to produce the instance variable.