Notes posted by MMSequeira
RSS feed
MMSequeira -
September 8, 2011 - (>= v3.0.9)
0 thanks
First example simplified
The first code example may be simplified, since the call to method to_xml is made implicitly anyway:
def index @people = Person.find :all respond_to do |format| format.html format.xml { render :xml => @people } end end
MMSequeira -
September 7, 2011 - (>= v3.0.9)
0 thanks
Passing an object as argument
It is possible to pass an instance of a record to the method. See the documentation of polymorphic_url (http://apidock.com/rails/ActionDispatch/Routing/PolymorphicRoutes).