Class: TokenAction::Generators::TokenActionGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/token_action_generator.rb

Overview

Run this generator once before using TokenAction in your application.

Examples:

rails generate token_action

See Also:

  • Devise::Generators::InstallGenerator
  • Devise::Generators::DeviseGenerator

Instance Method Summary collapse

Instance Method Details

#add_routesObject



26
27
28
# File 'lib/generators/token_action_generator.rb', line 26

def add_routes
  route "mount TokenAction::Engine => '/token_action'"
end

#copy_initializer_fileObject



18
19
20
# File 'lib/generators/token_action_generator.rb', line 18

def copy_initializer_file
  template 'token_action.rb', 'config/initializers/token_action.rb'
end

#copy_locale_fileObject



22
23
24
# File 'lib/generators/token_action_generator.rb', line 22

def copy_locale_file
  copy_file '../../../config/locales/en.yml', 'config/locales/token_action.en.yml'
end

#show_readmeObject



30
31
32
# File 'lib/generators/token_action_generator.rb', line 30

def show_readme
  readme 'README' if behavior == :invoke
end