Module: Alchemy::Admin::FormHelper
- Defined in:
- app/helpers/alchemy/admin/form_helper.rb
Instance Method Summary collapse
-
#alchemy_form_for(object, *args, &block) ⇒ Object
Use this form helper to render any form in Alchemy admin interface.
Instance Method Details
#alchemy_form_for(object, *args, &block) ⇒ Object
Use this form helper to render any form in Alchemy admin interface.
This is simply a wrapper for ‘simple_form_for`
Defaults
-
It uses Alchemy::Forms::Builder as builder
-
It makes a remote request, if the request was XHR request.
-
It adds the alchemy class to form
16 17 18 19 20 21 22 23 24 25 |
# File 'app/helpers/alchemy/admin/form_helper.rb', line 16 def alchemy_form_for(object, *args, &block) = args. [:builder] = Alchemy::Forms::Builder [:remote] = request.xhr? [:html] = { id: .delete(:id), class: ["alchemy", .delete(:class)].compact.join(" ") } simple_form_for(object, *(args << ), &block) end |