Module: PreparationTypesHelper
- Defined in:
- app/helpers/preparation_types_helper.rb
Instance Method Summary collapse
- #preparation_type_link(preparation_type) ⇒ Object
- #preparation_type_tag(preparation_type) ⇒ Object
- #preparation_types_search_form ⇒ Object
- #preparation_types_select(selected: nil, preparation_types: PreparationType.all.to_a) ⇒ Object
Instance Method Details
#preparation_type_link(preparation_type) ⇒ Object
8 9 10 11 |
# File 'app/helpers/preparation_types_helper.rb', line 8 def preparation_type_link(preparation_type) return nil if preparation_type.nil? link_to(preparation_type_tag(preparation_type).html_safe, preparation_type) end |
#preparation_type_tag(preparation_type) ⇒ Object
3 4 5 6 |
# File 'app/helpers/preparation_types_helper.rb', line 3 def preparation_type_tag(preparation_type) return nil if preparation_type.nil? preparation_type.name end |
#preparation_types_search_form ⇒ Object
13 14 15 |
# File 'app/helpers/preparation_types_helper.rb', line 13 def preparation_types_search_form render('/preparation_types/quick_search_form') end |
#preparation_types_select(selected: nil, preparation_types: PreparationType.all.to_a) ⇒ Object
17 18 19 |
# File 'app/helpers/preparation_types_helper.rb', line 17 def preparation_types_select(selected: nil, preparation_types: PreparationType.all.to_a) select_tag('preparation_type[id]' , (preparation_types, :id, :name, selected.try(:id)), include_blank: true) end |