Class: Faat::Generators::FormsGenerator
- Defined in:
- lib/generators/faat/forms/forms_generator.rb
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#create_form ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/generators/faat/forms/forms_generator.rb', line 10 def create_form @form_attributes = [] unless attr.size.zero? attr.each do |arg| if arg.include?(':') @form_attributes << Rails::Generators::GeneratedAttribute.new(*arg.split(':')) else @form_attributes << Rails::Generators::GeneratedAttribute.new(arg) end end end template "form_template.rb", "app/forms/#{file_name}_form.rb" end |