Skip to content

Instantly share code, notes, and snippets.

@caok
Last active August 29, 2015 14:08
Show Gist options
  • Save caok/c68ade35cb10b287c939 to your computer and use it in GitHub Desktop.
Save caok/c68ade35cb10b287c939 to your computer and use it in GitHub Desktop.
  • rails generate devise:install

  • rails rails generate devise MODEL

  • rake db:migrate

  • rails generate devise:views

  • rails generate devise:controllers [scope]

you need to set up the default URL options for the Devise mailer in each environment. Here is a possible configuration for config/environments/development.rb:

config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
class ApplicationController < ActionController::Base
  before_action :configure_permitted_parameters, if: :devise_controller?

  protected

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) << :username
  end
end
devise_for :users
 
authenticated :user do
  root to: "home#index", as: :authenticated_root
end 
unauthenticated do
  root to: "mine#profile", as: :unauthenticated_root
end 

https://github.com/plamena/devise_nested_form

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment