Module: Binco::ButtonHelper
- Defined in:
- app/helpers/binco/button_helper.rb
Instance Method Summary collapse
- #button(title, options = {}) ⇒ Object
- #button_danger(title, options = {}) ⇒ Object
- #button_default(title, options = {}) ⇒ Object
- #button_info(title, options = {}) ⇒ Object
- #button_primary(title, options = {}) ⇒ Object
- #button_success(title, options = {}) ⇒ Object
- #button_warning(title, options = {}) ⇒ Object
Instance Method Details
#button(title, options = {}) ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/helpers/binco/button_helper.rb', line 3 def (title, = {}) [:type] ||= :default [:class] ||= '' [:class] << ' ' if [:class].length > 1 [:class] << "btn btn-#{[:type]}" content_tag :button, title, .except(:type) end |
#button_danger(title, options = {}) ⇒ Object
36 37 38 39 |
# File 'app/helpers/binco/button_helper.rb', line 36 def (title, = {}) [:type] = :warning (title, ) end |
#button_default(title, options = {}) ⇒ Object
16 17 18 19 |
# File 'app/helpers/binco/button_helper.rb', line 16 def (title, = {}) [:type] = :default (title, ) end |
#button_info(title, options = {}) ⇒ Object
26 27 28 29 |
# File 'app/helpers/binco/button_helper.rb', line 26 def (title, = {}) [:type] = :info (title, ) end |
#button_primary(title, options = {}) ⇒ Object
11 12 13 14 |
# File 'app/helpers/binco/button_helper.rb', line 11 def (title, = {}) [:type] = :primary (title, ) end |
#button_success(title, options = {}) ⇒ Object
21 22 23 24 |
# File 'app/helpers/binco/button_helper.rb', line 21 def (title, = {}) [:type] = :default (title, ) end |
#button_warning(title, options = {}) ⇒ Object
31 32 33 34 |
# File 'app/helpers/binco/button_helper.rb', line 31 def (title, = {}) [:type] = :warning (title, ) end |