Class: Refinery::FormGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
ExtensionGeneration
Defined in:
lib/generators/refinery/form/form_generator.rb

Instance Method Summary collapse

Methods included from ExtensionGeneration

#attributes_for_translation_table, #extension_class_name, #extension_name, #extension_plural_class_name, #extension_plural_name, #image_attributes, included, #localized?, #localized_attributes, #names_for_attr_accessible, #namespacing, #resource_attributes, #string_attributes

Instance Method Details

#descriptionObject



10
11
12
# File 'lib/generators/refinery/form/form_generator.rb', line 10

def description
  "Generates an extension which is set up for frontend form submissions like a contact page."
end

#generateObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/generators/refinery/form/form_generator.rb', line 14

def generate
  sanity_check!

  evaluate_templates!

  unless options[:pretend]
    merge_locales!

    copy_or_merge_seeds!

    append_extension_to_gemfile!
  end

  finalize_extension!
end