Module: Formulaic::Dsl

Defined in:
lib/formulaic/dsl.rb

Instance Method Summary collapse

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