Use respond_to { |format| format.any } to reduce duplication

This commit is contained in:
Mindaugas Mozūras 2013-09-13 14:58:28 +03:00
parent 4ca6114b76
commit 962b4fa5c9
4 changed files with 5 additions and 17 deletions

View file

@ -48,8 +48,7 @@ class TodosController < ApplicationController
render :content_type => Mime::TEXT
end
format.xml { render :xml => @todos.to_xml( *todo_xml_params ) }
format.rss { @feed_title, @feed_description = 'Tracks Actions', "Actions for #{current_user.display_name}" }
format.atom { @feed_title, @feed_description = 'Tracks Actions', "Actions for #{current_user.display_name}" }
format.any(:rss, :atom) { @feed_title, @feed_description = 'Tracks Actions', "Actions for #{current_user.display_name}" }
format.ics
end
end