From cab3debd4aa466d01b92054c5efd9a1cad06bf13 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Thu, 27 Mar 2014 18:25:15 +0400 Subject: [PATCH] Fixed: sign_up --- app/controllers/users/registrations_controller.rb | 11 +++++++++++ config/routes.rb | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index ab4d6bd3b..9baf44b7c 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -1,4 +1,6 @@ class Users::RegistrationsController < Devise::RegistrationsController + before_filter :update_sanitized_params, if: :devise_controller? + # POST /resource def create # Try stop bots @@ -8,4 +10,13 @@ class Users::RegistrationsController < Devise::RegistrationsController end super end + + protected + + def update_sanitized_params + devise_parameter_sanitizer.for(:sign_up) do |u| + u.permit(:uname, :name, :email, :password, :password_confirmation) + end + end + end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index cc601ad0e..bc6ffc4cb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,7 +4,7 @@ Rosa::Application.routes.draw do get :sended end - devise_scope :users do + devise_scope :user do get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru' get 'users/sign_up' => 'users/registrations#new', as: :new_user_registration post 'users' => 'users/registrations#create', as: :user_registration