Skip to content

Commit

Permalink
#30 permitted parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
halit committed Aug 29, 2013
1 parent d60a93f commit 4270540
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'application_responder'
class ApplicationController < ActionController::Base
before_filter :set_user_time_zone
before_filter :configure_permitted_parameters, if: :devise_controller?

def handle_unverified_request

Expand All @@ -17,6 +18,12 @@ def set_user_time_zone
Time.zone = current_user.time_zone if user_signed_in? && current_user.time_zone.present?
end

def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:username, :email) }
devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:first_name, :last_name, :email,
:password, :password_confirmation) }
end

layout :layouter

def layouter
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/registrations/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
= f.error_notification
.form-inputs
= f.input :name, :autofocus => true
= f.input :first_name, :autofocus => true
= f.input :email, :required => true
= f.input :password, :required => true
= f.input :password_confirmation, :required => true
Expand Down

0 comments on commit 4270540

Please sign in to comment.