Module: Spark::TagHelper
- Defined in:
- app/helpers/spark/tag_helper.rb
Instance Method Summary collapse
-
#add_class(options, classnames) ⇒ Object
Takes an options hash, appends classnames (array or string).
- #search_input_tag(name, value = nil, options = {}, &block) ⇒ Object
- #select_input_tag(name, option_tags = nil, options = {}, &block) ⇒ Object
Instance Method Details
#add_class(options, classnames) ⇒ Object
Takes an options hash, appends classnames (array or string)
5 6 7 8 9 |
# File 'app/helpers/spark/tag_helper.rb', line 5 def add_class( , classnames ) = .stringify_keys ['class'] = ([['class']].flatten | [classnames].flatten).compact end |
#search_input_tag(name, value = nil, options = {}, &block) ⇒ Object
22 23 24 |
# File 'app/helpers/spark/tag_helper.rb', line 22 def search_input_tag( name, value = nil, = {}, &block ) input_tag( :search, name, value, , &block ) end |
#select_input_tag(name, option_tags = nil, options = {}, &block) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'app/helpers/spark/tag_helper.rb', line 11 def select_input_tag( name, =nil, ={}, &block ) if .is_a? Hash = = nil end ||= capture( &block ).html_safe if block_given? input_tag( :select, name, , ) end |