Module: Activist::ButtonHelpers
- Defined in:
- lib/activist/button_helpers.rb
Instance Method Summary collapse
- #add_button_link(path, text = 'Add') ⇒ Object
- #button_link(path, text, icon, link_to_options = {}) ⇒ Object
- #delete_button_link(path, text = 'Delete', confirmation = 'Are you sure') ⇒ Object
- #edit_button_link(path, text = 'Edit') ⇒ Object
- #submit_buttons(cancel_path, save_text = 'Save', cancel_text = 'Cancel') ⇒ Object
Instance Method Details
#add_button_link(path, text = 'Add') ⇒ Object
21 22 23 |
# File 'lib/activist/button_helpers.rb', line 21 def (path, text = 'Add') link_to((image_tag('icons/application_add.png', :class => :medium) + text).html_safe, path, :class => 'button') end |
#button_link(path, text, icon, link_to_options = {}) ⇒ Object
13 14 15 |
# File 'lib/activist/button_helpers.rb', line 13 def (path, text, icon, = {}) link_to((image_tag("icons/#{icon}.png") + text).html_safe, path, .merge({:class => 'button'})) end |
#delete_button_link(path, text = 'Delete', confirmation = 'Are you sure') ⇒ Object
17 18 19 |
# File 'lib/activist/button_helpers.rb', line 17 def (path, text = 'Delete', confirmation = 'Are you sure') link_to((image_tag('icons/application_delete.png', :class => :medium) + text).html_safe, path, :method => :delete, :class => 'button', :confirm => confirmation) end |
#edit_button_link(path, text = 'Edit') ⇒ Object
9 10 11 |
# File 'lib/activist/button_helpers.rb', line 9 def (path, text = 'Edit') link_to((image_tag('icons/application_edit.png') + text).html_safe, path, :class => 'button') end |
#submit_buttons(cancel_path, save_text = 'Save', cancel_text = 'Cancel') ⇒ Object
3 4 5 6 7 |
# File 'lib/activist/button_helpers.rb', line 3 def (cancel_path, save_text = 'Save', cancel_text = 'Cancel') content_tag('div', content_tag(:button, image_tag('icons/accept.png') + save_text, :class => :button, :type => :submit) + link_to(image_tag('icons/cancel.png') + cancel_text, cancel_path, :class => :button), :class => [:group, :navform, 'wat-cf']) end |