Created
August 29, 2010 18:53
-
-
Save twmills/556562 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
puts "setting up Gemfile for Devise..." | |
append_file 'Gemfile', "\n# Bundle gem needed for Devise\n" | |
gem 'devise', '1.1.1' | |
puts "installing Devise gem (takes a few minutes!)..." | |
run 'bundle install' | |
run "rails g devise:install" | |
puts "modifying environment configuration files for Devise..." | |
gsub_file 'config/environments/development.rb', /# Don't care if the mailer can't send/, '### ActionMailer Config' | |
gsub_file 'config/environments/development.rb', /config.action_mailer.raise_delivery_errors = false/ do | |
<<-RUBY | |
config.action_mailer.default_url_options = { :host => 'localhost:3000' } | |
# A dummy setup for development - no deliveries, but logged | |
config.action_mailer.delivery_method = :smtp | |
config.action_mailer.perform_deliveries = false | |
config.action_mailer.raise_delivery_errors = true | |
config.action_mailer.default :charset => "utf-8" | |
RUBY | |
end | |
gsub_file 'config/environments/production.rb', /config.i18n.fallbacks = true/ do | |
<<-RUBY | |
config.i18n.fallbacks = true | |
config.action_mailer.default_url_options = { :host => 'yourhost.com' } | |
### ActionMailer Config | |
# Setup for production - deliveries, no errors raised | |
config.action_mailer.delivery_method = :smtp | |
config.action_mailer.perform_deliveries = true | |
config.action_mailer.raise_delivery_errors = false | |
config.action_mailer.default :charset => "utf-8" | |
RUBY | |
end | |
generate :devise, "Person" | |
generate :controller, "people index new create edit update destroy" | |
route "devise_for :people" | |
route "resources :people" | |
generate devise:views | |
route "root :to => 'people#index'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment