From 986ffb24343877a76b505363aa2dc836e16465f5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 7 Jul 2012 17:45:12 +0000 Subject: Use named routes. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9940 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/account_controller.rb | 10 +++++----- app/views/account/login.html.erb | 4 ++-- app/views/account/lost_password.html.erb | 16 ++++++++-------- app/views/account/register.html.erb | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'app') diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 5c4ecaf40..ea3dcb1ae 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -70,7 +70,7 @@ class AccountController < ApplicationController if token.save Mailer.lost_password(token).deliver flash[:notice] = l(:notice_account_lost_email_sent) - redirect_to :action => 'login' + redirect_to signin_path return end end @@ -129,7 +129,7 @@ class AccountController < ApplicationController token.destroy flash[:notice] = l(:notice_account_activated) end - redirect_to :action => 'login' + redirect_to signin_path end private @@ -224,7 +224,7 @@ class AccountController < ApplicationController def onthefly_creation_failed(user, auth_source_options = { }) @user = user session[:auth_source_registration] = auth_source_options unless auth_source_options.empty? - render :action => 'register' + render register_path end def invalid_credentials @@ -240,7 +240,7 @@ class AccountController < ApplicationController if user.save and token.save Mailer.register(token).deliver flash[:notice] = l(:notice_account_register_done) - redirect_to :action => 'login' + redirect_to signin_path else yield if block_given? end @@ -277,6 +277,6 @@ class AccountController < ApplicationController def account_pending flash[:notice] = l(:notice_account_pending) - redirect_to :action => 'login' + redirect_to signin_path end end diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb index 99eda9242..f2f7f74ed 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -1,6 +1,6 @@ <%= call_hook :view_account_login_top %>
-<%= form_tag({:action=> "login"}) do %> +<%= form_tag(signin_path) do %> <%= back_url_hidden_field_tag %> @@ -28,7 +28,7 @@
<% if Setting.lost_password? %> - <%= link_to l(:label_password_lost), :controller => 'account', :action => 'lost_password' %> + <%= link_to l(:label_password_lost), lost_password_path %> <% end %> diff --git a/app/views/account/lost_password.html.erb b/app/views/account/lost_password.html.erb index 44f851475..19df8d9a9 100644 --- a/app/views/account/lost_password.html.erb +++ b/app/views/account/lost_password.html.erb @@ -1,11 +1,11 @@

<%=l(:label_password_lost)%>

-
-<%= form_tag({:action=> "lost_password"}, :class => "tabular") do %> - -

-<%= text_field_tag 'mail', nil, :size => 40 %> -<%= submit_tag l(:button_submit) %>

- +<%= form_tag(lost_password_path) do %> +
+

+ + <%= text_field_tag 'mail', nil, :size => 40 %> + <%= submit_tag l(:button_submit) %> +

+
<% end %> -
diff --git a/app/views/account/register.html.erb b/app/views/account/register.html.erb index 7e44e123b..e8e8098fe 100644 --- a/app/views/account/register.html.erb +++ b/app/views/account/register.html.erb @@ -1,6 +1,6 @@

<%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %>

-<%= labelled_form_for @user, :url => {:action => 'register'} do |f| %> +<%= labelled_form_for @user, :url => register_path do |f| %> <%= error_messages_for 'user' %>
-- cgit v1.2.3