Class: Formtastic::InputGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/formtastic/input/input_generator.rb

Overview

!!!shell $ rails generate formtastic:input FlexibleText --extend string

Examples:

Extend an existing input behavior

Instance Method Summary collapse

Instance Method Details

#createObject


27
28
29
30
31
# File 'lib/generators/formtastic/input/input_generator.rb', line 27

def create
  normalize_file_name
  define_extension_sentence
  template "input.rb", "app/inputs/#{name.underscore}_input.rb"
end