Method: Alchemy::Forms::Builder#input
- Defined in:
- lib/alchemy/forms/builder.rb
#input(attribute_name, options = {}, &block) ⇒ Object
Renders a simple_form input, but uses input alchemy_wrapper
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/alchemy/forms/builder.rb', line 8 def input(attribute_name, = {}, &block) [:wrapper] = :alchemy if object.respond_to?(:attribute_fixed?) && object.attribute_fixed?(attribute_name) = { content: Alchemy.t(:attribute_fixed, attribute: attribute_name), class: "like-hint-tooltip", placement: "bottom-start" } template.content_tag(:div, class: "input") do label(attribute_name) + template.content_tag("sl-tooltip", ) do input_field(attribute_name, disabled: true) end end else super end end |