Moves the registrations controller to users/registrations
This is necessary because rails gets confused when it has a a “root” registration_controller and another non-root one. The non-root one uses the views from the root.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
class RegistrationsController < Devise::RegistrationsController
|
class Users::RegistrationsController < Devise::RegistrationsController
|
||||||
include RecaptchaHelper
|
include RecaptchaHelper
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@@ -11,11 +11,10 @@ class RegistrationsController < Devise::RegistrationsController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def sign_up_params
|
def sign_up_params
|
||||||
params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :use_nickname, :nickname)
|
params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :use_nickname, :nickname)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
<div class="row">
|
|
||||||
<div class="account small-12 medium-9 column small-centered">
|
|
||||||
|
|
||||||
<i class="icon-angle-left left"></i> <%= link_to t("devise_views.registrations.edit.back_link"), :back, class: "left back" %>
|
|
||||||
|
|
||||||
<h1><%= t("devise_views.registrations.edit.edit") %> <%= resource_name.to_s.humanize %></h1>
|
|
||||||
|
|
||||||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
|
||||||
<%= devise_error_messages! %>
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 column">
|
|
||||||
<%= f.label :email, t("devise_views.registrations.edit.email_label") %>
|
|
||||||
<%= f.email_field :email, autofocus: true, placeholder: t("devise_views.registrations.edit.email_label") %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="small-12 column">
|
|
||||||
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
|
||||||
<div><%= t("devise_views.registrations.edit.waiting_for") %> <%= resource.unconfirmed_email %></div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="small-12 column">
|
|
||||||
<%= f.label :password, t("devise_views.registrations.edit.password_label") %>
|
|
||||||
<span class="note"><%= t("devise_views.registrations.edit.leave_blank") %></span>
|
|
||||||
<%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.registrations.edit.password_label") %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="small-12 column">
|
|
||||||
<%= f.label :password_confirmation, t("devise_views.registrations.edit.password_confirmation_label") %>
|
|
||||||
<%= f.password_field :password_confirmation, autocomplete: "off", placeholder: t("devise_views.registrations.edit.password_confirmation_label") %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="small-12 column">
|
|
||||||
<%= f.label :current_password, t("devise_views.registrations.edit.current_password_label") %>
|
|
||||||
<span class="note"><%= t("devise_views.registrations.edit.need_current") %></span>
|
|
||||||
<%= f.password_field :current_password, autocomplete: "off", placeholder: t("devise_views.registrations.edit.current_password_label") %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="small-12 column">
|
|
||||||
<%= f.submit t("devise_views.registrations.edit.update_submit"), class: "button radius" %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
45
app/views/users/registrations/edit.html.erb
Normal file
45
app/views/users/registrations/edit.html.erb
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<div class="row">
|
||||||
|
<div class="account small-12 medium-9 column small-centered">
|
||||||
|
|
||||||
|
<i class="icon-angle-left left"></i> <%= link_to t("devise_views.users.registrations.edit.back_link"), :back, class: "left back" %>
|
||||||
|
|
||||||
|
<h1><%= t("devise_views.users.registrations.edit.edit") %> <%= resource_name.to_s.humanize %></h1>
|
||||||
|
|
||||||
|
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
||||||
|
<%= devise_error_messages! %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="small-12 column">
|
||||||
|
<%= f.label :email, t("devise_views.users.registrations.edit.email_label") %>
|
||||||
|
<%= f.email_field :email, autofocus: true, placeholder: t("devise_views.users.registrations.edit.email_label") %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="small-12 column">
|
||||||
|
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
||||||
|
<div><%= t("devise_views.users.registrations.edit.waiting_for") %> <%= resource.unconfirmed_email %></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="small-12 column">
|
||||||
|
<%= f.label :password, t("devise_views.users.registrations.edit.password_label") %>
|
||||||
|
<span class="note"><%= t("devise_views.users.registrations.edit.leave_blank") %></span>
|
||||||
|
<%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.users.registrations.edit.password_label") %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="small-12 column">
|
||||||
|
<%= f.label :password_confirmation, t("devise_views.users.registrations.edit.password_confirmation_label") %>
|
||||||
|
<%= f.password_field :password_confirmation, autocomplete: "off", placeholder: t("devise_views.users.registrations.edit.password_confirmation_label") %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="small-12 column">
|
||||||
|
<%= f.label :current_password, t("devise_views.users.registrations.edit.current_password_label") %>
|
||||||
|
<span class="note"><%= t("devise_views.users.registrations.edit.need_current") %></span>
|
||||||
|
<%= f.password_field :current_password, autocomplete: "off", placeholder: t("devise_views.users.registrations.edit.current_password_label") %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="small-12 column">
|
||||||
|
<%= f.submit t("devise_views.users.registrations.edit.update_submit"), class: "button radius" %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -2,60 +2,60 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 medium-8 large-5 column small-centered">
|
<div class="small-12 medium-8 large-5 column small-centered">
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<h1 class="text-center"><%= t("devise_views.registrations.new.title") %></h1>
|
<h1 class="text-center"><%= t("devise_views.users.registrations.new.title") %></h1>
|
||||||
|
|
||||||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
||||||
<%= devise_error_messages! %>
|
<%= devise_error_messages! %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 columns">
|
<div class="small-12 columns">
|
||||||
<%= f.label :first_name, t("devise_views.registrations.new.first_name_label") %>
|
<%= f.label :first_name, t("devise_views.users.registrations.new.first_name_label") %>
|
||||||
<%= f.text_field :first_name, autofocus: true, placeholder: t("devise_views.registrations.new.first_name_label") %>
|
<%= f.text_field :first_name, autofocus: true, placeholder: t("devise_views.users.registrations.new.first_name_label") %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 columns">
|
<div class="small-12 columns">
|
||||||
<%= f.label :last_name, t("devise_views.registrations.new.last_name_label") %>
|
<%= f.label :last_name, t("devise_views.users.registrations.new.last_name_label") %>
|
||||||
<%= f.text_field :last_name, placeholder: t("devise_views.registrations.new.last_name_label") %>
|
<%= f.text_field :last_name, placeholder: t("devise_views.users.registrations.new.last_name_label") %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 columns">
|
<div class="small-12 columns">
|
||||||
<%= f.check_box :use_nickname %>
|
<%= f.check_box :use_nickname %>
|
||||||
<%= t("devise_views.registrations.new.use_nickname_label") %>
|
<%= t("devise_views.users.registrations.new.use_nickname_label") %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 columns">
|
<div class="small-12 columns">
|
||||||
<%= f.label :nickname, t("devise_views.registrations.new.nickname_label") %>
|
<%= f.label :nickname, t("devise_views.users.registrations.new.nickname_label") %>
|
||||||
<%= f.text_field :nickname, placeholder: t("devise_views.registrations.new.nickname_label") %>
|
<%= f.text_field :nickname, placeholder: t("devise_views.users.registrations.new.nickname_label") %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 columns">
|
<div class="small-12 columns">
|
||||||
<%= f.label :email, t("devise_views.registrations.new.email_label") %>
|
<%= f.label :email, t("devise_views.users.registrations.new.email_label") %>
|
||||||
<%= f.email_field :email, placeholder: t("devise_views.registrations.new.email_label") %>
|
<%= f.email_field :email, placeholder: t("devise_views.users.registrations.new.email_label") %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 columns">
|
<div class="small-12 columns">
|
||||||
<%= f.label :password, t("devise_views.registrations.new.password_label"), class: "inline-block" %>
|
<%= f.label :password, t("devise_views.users.registrations.new.password_label"), class: "inline-block" %>
|
||||||
<% if @minimum_password_length %>
|
<% if @minimum_password_length %>
|
||||||
<span class="inline-block"><i><%= t("devise_views.registrations.new.min_length", min: @minimum_password_length) %></i></span>
|
<span class="inline-block"><i><%= t("devise_views.users.registrations.new.min_length", min: @minimum_password_length) %></i></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.registrations.new.password_label") %>
|
<%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.users.registrations.new.password_label") %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 columns">
|
<div class="small-12 columns">
|
||||||
<%= f.label :password_confirmation, t("devise_views.registrations.new.password_confirmation_label") %>
|
<%= f.label :password_confirmation, t("devise_views.users.registrations.new.password_confirmation_label") %>
|
||||||
<%= f.password_field :password_confirmation, autocomplete: "off", placeholder: t("devise_views.registrations.new.password_confirmation_label") %>
|
<%= f.password_field :password_confirmation, autocomplete: "off", placeholder: t("devise_views.users.registrations.new.password_confirmation_label") %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 columns">
|
<div class="small-12 columns">
|
||||||
<%= f.submit t("devise_views.registrations.new.submit"), class: "button radius expand" %>
|
<%= f.submit t("devise_views.users.registrations.new.submit"), class: "button radius expand" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -36,29 +36,30 @@ en:
|
|||||||
title: "Forgot your password?"
|
title: "Forgot your password?"
|
||||||
email_label: "Email"
|
email_label: "Email"
|
||||||
send_submit: "Send me reset password instructions"
|
send_submit: "Send me reset password instructions"
|
||||||
registrations:
|
users:
|
||||||
edit:
|
registrations:
|
||||||
edit: "Edit"
|
edit:
|
||||||
email_label: "Email"
|
edit: "Edit"
|
||||||
waiting_for: "Currently waiting confirmation for:"
|
email_label: "Email"
|
||||||
leave_blank: "Leave blank if you don't want to change it"
|
waiting_for: "Currently waiting confirmation for:"
|
||||||
password_label: "New password"
|
leave_blank: "Leave blank if you don't want to change it"
|
||||||
password_confirmation_label: "Confirm new password"
|
password_label: "New password"
|
||||||
current_password_label: "Current password"
|
password_confirmation_label: "Confirm new password"
|
||||||
need_current: "We need your current password to confirm your changes"
|
current_password_label: "Current password"
|
||||||
update_submit: "Update"
|
need_current: "We need your current password to confirm your changes"
|
||||||
back_link: "Back"
|
update_submit: "Update"
|
||||||
new:
|
back_link: "Back"
|
||||||
title: "Sign up"
|
new:
|
||||||
first_name_label: "First name"
|
title: "Sign up"
|
||||||
last_name_label: "Last name"
|
first_name_label: "First name"
|
||||||
nickname_label: "Nickname"
|
last_name_label: "Last name"
|
||||||
use_nickname_label: "Use nickname"
|
nickname_label: "Nickname"
|
||||||
email_label: "Email"
|
use_nickname_label: "Use nickname"
|
||||||
password_label: "Password"
|
email_label: "Email"
|
||||||
min_length: "(%{min} characters minimum)"
|
password_label: "Password"
|
||||||
password_confirmation_label: "Confirm password"
|
min_length: "(%{min} characters minimum)"
|
||||||
submit: "Sign up"
|
password_confirmation_label: "Confirm password"
|
||||||
|
submit: "Sign up"
|
||||||
sessions:
|
sessions:
|
||||||
new:
|
new:
|
||||||
title: "Log in"
|
title: "Log in"
|
||||||
|
|||||||
@@ -36,29 +36,30 @@ es:
|
|||||||
title: "¿Has olvidado tu contraseña?"
|
title: "¿Has olvidado tu contraseña?"
|
||||||
email_label: "Email"
|
email_label: "Email"
|
||||||
send_submit: "Recibir instrucciones para recuperar mi contraseña"
|
send_submit: "Recibir instrucciones para recuperar mi contraseña"
|
||||||
registrations:
|
users:
|
||||||
edit:
|
registrations:
|
||||||
edit: "Editar"
|
edit:
|
||||||
email_label: "Email"
|
edit: "Editar"
|
||||||
waiting_for: "Esperando confirmación de:"
|
email_label: "Email"
|
||||||
leave_blank: "Dejar en blanco si no deseas cambiarla"
|
waiting_for: "Esperando confirmación de:"
|
||||||
password_label: "Contraseña nueva"
|
leave_blank: "Dejar en blanco si no deseas cambiarla"
|
||||||
password_confirmation_label: "Confirmar contraseña nueva"
|
password_label: "Contraseña nueva"
|
||||||
current_password_label: "Contraseña actual"
|
password_confirmation_label: "Confirmar contraseña nueva"
|
||||||
need_current: "Necesitamos tu contraseña actual para confirmar los cambios"
|
current_password_label: "Contraseña actual"
|
||||||
update_submit: "Actualizar"
|
need_current: "Necesitamos tu contraseña actual para confirmar los cambios"
|
||||||
back_link: "Atrás"
|
update_submit: "Actualizar"
|
||||||
new:
|
back_link: "Atrás"
|
||||||
title: "Registrarse"
|
new:
|
||||||
first_name_label: "Nombre"
|
title: "Registrarse"
|
||||||
last_name_label: "Apellidos"
|
first_name_label: "Nombre"
|
||||||
nickname_label: "Pseudónimo"
|
last_name_label: "Apellidos"
|
||||||
use_nickname_label: "Usar pseudónimo"
|
nickname_label: "Pseudónimo"
|
||||||
email_label: "Email"
|
use_nickname_label: "Usar pseudónimo"
|
||||||
password_label: "Contraseña"
|
email_label: "Email"
|
||||||
min_length: "(mínimo %{min} caracteres)"
|
password_label: "Contraseña"
|
||||||
password_confirmation_label: "Confirmar contraseña"
|
min_length: "(mínimo %{min} caracteres)"
|
||||||
submit: "Registrarse"
|
password_confirmation_label: "Confirmar contraseña"
|
||||||
|
submit: "Registrarse"
|
||||||
sessions:
|
sessions:
|
||||||
new:
|
new:
|
||||||
title: "Entrar"
|
title: "Entrar"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
devise_for :users, controllers: { registrations: 'registrations' }
|
devise_for :users, controllers: { registrations: 'users/registrations' }
|
||||||
|
|
||||||
# The priority is based upon order of creation: first created -> highest priority.
|
# The priority is based upon order of creation: first created -> highest priority.
|
||||||
# See how all your routes lay out with "rake routes".
|
# See how all your routes lay out with "rake routes".
|
||||||
|
|||||||
Reference in New Issue
Block a user