I'm not sure if this is the best practice or not, but I usually like to leave routes open for response_to (i.e. by adding .:format to the end), but use it only in controllers when necessary.
Example:
routes.rb
map.connect :controller/:action/:id.:format
model_controller.rb
This way you are not cluttering up your action_with_one_response method action_with_one_response unnecessary block, but you are also very well proven if you want to ever return your object to xml, json, etc.
jerhinesmith
source share