Module: Golden::Theme::Bootstrap::LinkHelper
- Defined in:
- lib/golden/theme/bootstrap/link_helper.rb
Instance Method Summary collapse
- #bootstrap_iconed_link_to(text, url, options = {}) ⇒ Object
- #bootstrap_link_to_destroy(url, options = {}) ⇒ Object
- #bootstrap_link_to_edit(url, options = {}) ⇒ Object
- #bootstrap_link_to_new(url, options = {}) ⇒ Object
- #bootstrap_link_to_show(url, options = {}) ⇒ Object
Instance Method Details
#bootstrap_iconed_link_to(text, url, options = {}) ⇒ Object
3 4 5 6 7 |
# File 'lib/golden/theme/bootstrap/link_helper.rb', line 3 def bootstrap_iconed_link_to text, url, = {} icon_class = .delete :icon_class text = content_tag(:i, nil, class: icon_class) << ' ' << text link_to text, url, end |
#bootstrap_link_to_destroy(url, options = {}) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/golden/theme/bootstrap/link_helper.rb', line 43 def bootstrap_link_to_destroy url, = {} icon_class = .delete(:icon_class) || 'glyphicon glyphicon-trash' = { method: :delete, data: { confirm: t('helpers.are_you_sure') }, role: 'button', class: 'btn btn-default', icon_class: icon_class, title: t('helpers.destroy') }.deep_merge bootstrap_iconed_link_to nil, url, end |
#bootstrap_link_to_edit(url, options = {}) ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/golden/theme/bootstrap/link_helper.rb', line 32 def bootstrap_link_to_edit url, = {} icon_class = .delete(:icon_class) || 'glyphicon glyphicon-edit' = { role: 'button', class: 'btn btn-default', icon_class: icon_class, title: t('helpers.edit') }.deep_merge bootstrap_iconed_link_to nil, url, end |
#bootstrap_link_to_new(url, options = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/golden/theme/bootstrap/link_helper.rb', line 21 def bootstrap_link_to_new url, = {} icon_class = .delete(:icon_class) || 'glyphicon glyphicon-plus' = { role: 'button', class: 'btn btn-default', icon_class: icon_class, title: t('helpers.new') }.deep_merge bootstrap_iconed_link_to nil, url, end |
#bootstrap_link_to_show(url, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/golden/theme/bootstrap/link_helper.rb', line 9 def bootstrap_link_to_show url, = {} icon_class = .delete(:icon_class) || 'glyphicon glyphicon-eye-open' = { role: 'button', class: 'btn btn-default', icon_class: icon_class, title: t('helpers.show') }.deep_merge = { } bootstrap_iconed_link_to nil, url, end |