Module: Formulaic::Dsl
- Defined in:
- lib/formulaic/dsl.rb
Instance Method Summary collapse
- #fill_form(model_name, attributes) ⇒ Object
- #input(model_name, field, action = :create) ⇒ Object
- #submit(model_class, action = :create) ⇒ Object
Instance Method Details
#fill_form(model_name, attributes) ⇒ Object
3 4 5 |
# File 'lib/formulaic/dsl.rb', line 3 def fill_form(model_name, attributes) Form.new(model_name, attributes).fill end |
#input(model_name, field, action = :create) ⇒ Object
7 8 9 |
# File 'lib/formulaic/dsl.rb', line 7 def input(model_name, field, action = :create) Label.new(model_name, field, action).to_str end |
#submit(model_class, action = :create) ⇒ Object
11 12 13 |
# File 'lib/formulaic/dsl.rb', line 11 def submit(model_class, action = :create) I18n.t([:helpers, :submit, model_class, action].join('.')) end |