Class: BrainDamage::View::Input::AutocompletableSimpleSelection
- Inherits:
-
Autocompletable
- Object
- Templateable::Base
- Templateable::FieldTemplateable
- Base
- Autocompletable
- BrainDamage::View::Input::AutocompletableSimpleSelection
- Defined in:
- lib/generators/brain_damage/lib/views/inputs/autocompletable_simple_selection.rb
Instance Attribute Summary
Attributes inherited from Templateable::FieldTemplateable
Attributes inherited from Templateable::Base
#inner_html, #options, #template_file
Instance Method Summary collapse
Methods inherited from Autocompletable
#display_method, #target, #url, #value_method
Methods inherited from Base
Methods inherited from Templateable::FieldTemplateable
#empty_haml_path, #initialize, #label_guard?, #method_missing, #render, #show?, #show_label?
Methods inherited from Templateable::Base
#indent, #initialize, #method_missing, #render, #render_erb_file, #render_erb_string, #render_template_file
Constructor Details
This class inherits a constructor from BrainDamage::Templateable::FieldTemplateable
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BrainDamage::Templateable::FieldTemplateable
Instance Method Details
#input_name ⇒ Object
15 16 17 |
# File 'lib/generators/brain_damage/lib/views/inputs/autocompletable_simple_selection.rb', line 15 def input_name @options[:input_name] || render_erb_string("<%= singular_table_name %>[<%= name %>_id]") end |
#partial_to_show ⇒ Object
11 12 13 |
# File 'lib/generators/brain_damage/lib/views/inputs/autocompletable_simple_selection.rb', line 11 def partial_to_show @options[:partial_to_show] || "#{target}/autocompletable/simple_selection" end |
#value ⇒ Object
7 8 9 |
# File 'lib/generators/brain_damage/lib/views/inputs/autocompletable_simple_selection.rb', line 7 def value "{ display: '\#{#{singular_table_name}.#{name}.try(:#{display_method})}', value: '\#{#{singular_table_name}.#{name}.try(:#{value_method})}'}" end |