Created
October 8, 2016 23:01
-
-
Save fz-chen/f40f20ae0dde11c987b6c9d2d31315dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/plataformatec/devise | |
gem 'devise' | |
rails generate devise:install | |
#possible configuration for config/environments/development.rb | |
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } | |
rails generate devise MODEL ( or User or what ever) | |
rake db:migrate | |
rails generate devise:views ( coppying gem files into the view forlder to be altered ) | |
then go to config/initializers/devise.rb | |
and then comment/add config.scoped_views = true | |
then alter the form in views | |
###inside controller/application.rb ##### | |
class ApplicationController < ActionController::Base | |
before_action :configure_permitted_parameters, if: :devise_controller? | |
protected | |
def configure_permitted_parameters | |
devise_parameter_sanitizer.permit(:sign_up, keys: [:username]) | |
end | |
end | |
#################### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment