Notes posted by MMSequeira
RSS feed
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

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).