class SocialFramework::Generators::InstallGenerator
Generator to add the principal files and configurations
Public Instance Methods
add_devise_routes()
click to toggle source
Add devise routes to app maped to framework controllers
# File lib/generators/social_framework/install_generator.rb, line 26 def add_devise_routes devise_route = "devise_for :users, class_name: 'SocialFramework::User',\n" << "\t\tcontrollers: {sessions: 'users/sessions',\n"<< "\t\t\t\t\t\t\t\t\tregistrations: 'users/registrations',\n"<< "\t\t\t\t\t\t\t\t\tpasswords: 'users/passwords'}" route devise_route end
add_views()
click to toggle source
Add the principal devise views (registrations and sessions), whith this it's possible register, update and authenticate users
# File lib/generators/social_framework/install_generator.rb, line 37 def add_views directory "views/registrations", "app/views/devise/registrations" directory "views/sessions", "app/views/devise/sessions" directory "views/shared", "app/views/devise/shared" end
copy_devise_setup()
click to toggle source
Copy devise.rb file to app, this file is used to define devise configurations
# File lib/generators/social_framework/install_generator.rb, line 16 def copy_devise_setup copy_file "initializers/devise.rb", "config/initializers/devise.rb" end
copy_translate_file()
click to toggle source
Copy translate file to app, this file is used to define devise configurations
# File lib/generators/social_framework/install_generator.rb, line 21 def copy_translate_file copy_file "../../../config/locales/devise.en.yml", "config/locales/devise.en.yml" end