Class: ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#configure_permitted_parametersObject



6
7
8
9
10
# File 'app/controllers/application_controller.rb', line 6

def configure_permitted_parameters
  added_attrs = %i[username email password password_confirmation remember_me]
  devise_parameter_sanitizer.permit :sign_up, keys: added_attrs
  devise_parameter_sanitizer.permit :account_update, keys: added_attrs
end

#not_foundObject



11
12
13
14
15
16
# File 'app/controllers/application_controller.rb', line 11

def not_found
  unless current_user
    return redirect_to  new_user_session_url
  end
  render :file => "#{Rails.root}/public/404.html", :status => 404, :layout => false
end