Class: RailsHmvc::Generators::FormGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- RailsHmvc::Generators::FormGenerator
- Includes:
- GeneratorHelpers
- Defined in:
- lib/generators/hmvc/form/form_generator.rb
Instance Method Summary collapse
- #create_forms ⇒ Object
-
#initialize(*args) ⇒ FormGenerator
constructor
A new instance of FormGenerator.
Methods included from GeneratorHelpers
#load_config, #load_config_for_type, #namespace_name, #namespace_path, #singular_human_name
Constructor Details
#initialize(*args) ⇒ FormGenerator
Returns a new instance of FormGenerator.
19 20 21 22 23 24 25 |
# File 'lib/generators/hmvc/form/form_generator.rb', line 19 def initialize(*args) super @config = load_config_for_type([:type]) @forms_config = @config["forms"] @form_attributes = parse_attributes([:attributes]) set_defaults_from_config end |
Instance Method Details
#create_forms ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/generators/hmvc/form/form_generator.rb', line 27 def create_forms return create_single_form if actions.empty? actions.each do |action| create_form_for(action) end end |