mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-22 02:00:12 +01:00
Use respond_to { |format| format.any } to reduce duplication
This commit is contained in:
parent
4ca6114b76
commit
962b4fa5c9
4 changed files with 5 additions and 17 deletions
|
|
@ -18,11 +18,7 @@ class ContextsController < ApplicationController
|
||||||
format.html &render_contexts_html
|
format.html &render_contexts_html
|
||||||
format.m &render_contexts_mobile
|
format.m &render_contexts_mobile
|
||||||
format.xml { render :xml => @all_contexts.to_xml( :except => :user_id ) }
|
format.xml { render :xml => @all_contexts.to_xml( :except => :user_id ) }
|
||||||
format.rss do
|
format.any(:rss, :atom) do
|
||||||
@feed_title = 'Tracks Contexts'
|
|
||||||
@feed_description = "Lists all the contexts for #{current_user.display_name}"
|
|
||||||
end
|
|
||||||
format.atom do
|
|
||||||
@feed_title = 'Tracks Contexts'
|
@feed_title = 'Tracks Contexts'
|
||||||
@feed_description = "Lists all the contexts for #{current_user.display_name}"
|
@feed_description = "Lists all the contexts for #{current_user.display_name}"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,7 @@ class ProjectsController < ApplicationController
|
||||||
cookies[:mobile_url]= {:value => request.fullpath, :secure => SITE_CONFIG['secure_cookies']}
|
cookies[:mobile_url]= {:value => request.fullpath, :secure => SITE_CONFIG['secure_cookies']}
|
||||||
end
|
end
|
||||||
format.xml { render :xml => @projects.to_xml( :except => :user_id ) }
|
format.xml { render :xml => @projects.to_xml( :except => :user_id ) }
|
||||||
format.rss do
|
format.any(:rss, :atom) do
|
||||||
@feed_title = I18n.t('models.project.feed_title')
|
|
||||||
@feed_description = I18n.t('models.project.feed_description', :username => current_user.display_name)
|
|
||||||
end
|
|
||||||
format.atom do
|
|
||||||
@feed_title = I18n.t('models.project.feed_title')
|
@feed_title = I18n.t('models.project.feed_title')
|
||||||
@feed_description = I18n.t('models.project.feed_description', :username => current_user.display_name)
|
@feed_description = I18n.t('models.project.feed_description', :username => current_user.display_name)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,7 @@ class TodosController < ApplicationController
|
||||||
render :content_type => Mime::TEXT
|
render :content_type => Mime::TEXT
|
||||||
end
|
end
|
||||||
format.xml { render :xml => @todos.to_xml( *todo_xml_params ) }
|
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.any(:rss, :atom) { @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.ics
|
format.ics
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -160,10 +160,7 @@ module LoginSystem
|
||||||
format.html { redirect_to login_path }
|
format.html { redirect_to login_path }
|
||||||
format.m { redirect_to login_path(:format => 'm') }
|
format.m { redirect_to login_path(:format => 'm') }
|
||||||
format.js { render :partial => 'login/redirect_to_login' }
|
format.js { render :partial => 'login/redirect_to_login' }
|
||||||
format.xml { basic_auth_denied }
|
format.any(:xml, :rss, :atom, :text) { basic_auth_denied }
|
||||||
format.rss { basic_auth_denied }
|
|
||||||
format.atom { basic_auth_denied }
|
|
||||||
format.text { basic_auth_denied }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue