Class: Formtastic::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



11
12
13
# File 'lib/generators/formtastic/install/install_generator.rb', line 11

def self.banner
  "rails generate formtastic:install [options]"
end

.source_rootObject



6
7
8
9
# File 'lib/generators/formtastic/install/install_generator.rb', line 6

def self.source_root
  # Set source directory for the templates to the rails2 generator template directory
  @source_root ||= File.expand_path(File.join('..', '..', '..', '..', 'generators', 'formtastic', 'templates'), File.dirname(__FILE__))
end

Instance Method Details

#copy_filesObject



15
16
17
18
19
20
21
22
# File 'lib/generators/formtastic/install/install_generator.rb', line 15

def copy_files
  empty_directory 'config/initializers'
  template        'formtastic.rb', 'config/initializers/formtastic.rb'

  empty_directory 'public/stylesheets'
  template        'formtastic.css',         'public/stylesheets/formtastic.css'
  template        'formtastic_changes.css', 'public/stylesheets/formtastic_changes.css'
end