Module: Formular::Helper
- Included in:
- RailsHelper
- Defined in:
- lib/formular/helper.rb
Overview
TODO: indirectly tested in erb_test and slim_test. Should probably test directly
Constant Summary collapse
- BUILDERS =
{ basic: 'Formular::Builders::Basic', bootstrap3: 'Formular::Builders::Bootstrap3', bootstrap4: 'Formular::Builders::Bootstrap4', bootstrap3_inline: 'Formular::Builders::Bootstrap3Inline', bootstrap4_inline: 'Formular::Builders::Bootstrap4Inline', bootstrap3_horizontal: 'Formular::Builders::Bootstrap3Horizontal', bootstrap4_horizontal: 'Formular::Builders::Bootstrap4Horizontal', foundation6: 'Formular::Builders::Foundation6' }.freeze
Class Attribute Summary collapse
Instance Method Summary collapse
Class Attribute Details
Instance Method Details
#form(model, url, **options, &block) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/formular/helper.rb', line 4 def form(model, url, **, &block) = = .select { |k, v| .delete(k) || true if [:builder, :model, :path_prefix, :errors, :elements].include?(k) } [:action] ||= url builder(model, ).form(, &block) end |