Ruby on Rails Sunday, March 31, 2013

Hey, Guys!

I have next action in controller products:

def who_bought
@product = Product.find(params[:id] )
respond_to do |format|
format.html
format.xml { render :xml => @product.to_xml( :include => :order )
}
format.json {render :json => @product.to_json(:include => :order )
}
end
end

routes.rb
.......................
resources :products do
get :who_bought member: :on
end
..........................

I want check, how work in xml format. How me call in command line my
format xml? (format.xml { render :xml => @product.to_xml( :include =>
:order ) })

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment