Class: LokaliseRails::Generators::InstallGenerator

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

Overview

Generator that sets up the LokaliseRails configuration in a Rails application. It copies a predefined configuration template into the appropriate directory within the Rails application, making it easier for users to configure and use LokaliseRails.

Instance Method Summary collapse

Instance Method Details

#copy_configObject

The primary method of this generator, responsible for copying the LokaliseRails configuration template from the gem to the Rails application’s config directory. This is where users can customize their Lokalise settings.



20
21
22
23
# File 'lib/generators/lokalise_rails/install_generator.rb', line 20

def copy_config
  # Copies the configuration template to the Rails application's config directory.
  template 'lokalise_rails_config.rb', "#{Rails.root}/config/lokalise_rails.rb"
end