Class: RansackSimpleForm::FormBuilder
- Inherits:
-
SimpleForm::FormBuilder
- Object
- SimpleForm::FormBuilder
- RansackSimpleForm::FormBuilder
- Defined in:
- lib/ransack_simple_form.rb
Instance Attribute Summary collapse
-
#ransack_form_builder ⇒ Object
readonly
Returns the value of attribute ransack_form_builder.
Instance Method Summary collapse
-
#initialize(*args) ⇒ FormBuilder
constructor
A new instance of FormBuilder.
-
#label(method, *args, &block) ⇒ Object
delegate :label, to: :ransack_form_builder.
Constructor Details
#initialize(*args) ⇒ FormBuilder
Returns a new instance of FormBuilder.
24 25 26 27 |
# File 'lib/ransack_simple_form.rb', line 24 def initialize(*args) super @ransack_form_builder = Ransack::Helpers::FormBuilder.new(*args) end |
Instance Attribute Details
#ransack_form_builder ⇒ Object (readonly)
Returns the value of attribute ransack_form_builder.
22 23 24 |
# File 'lib/ransack_simple_form.rb', line 22 def ransack_form_builder @ransack_form_builder end |
Instance Method Details
#label(method, *args, &block) ⇒ Object
delegate :label, to: :ransack_form_builder
31 32 33 34 35 36 37 38 39 |
# File 'lib/ransack_simple_form.rb', line 31 def label(method, *args, &block) = args. i18n = [:i18n] || {} text = object.translate( method, i18n.reverse_merge(:include_associations => true) ) if object.respond_to? :translate text ||= args.first super(method, text, , &block) end |