Module: Activist::ButtonHelpers

Defined in:
lib/activist/button_helpers.rb

Instance Method Summary collapse

Instance Method Details



21
22
23
# File 'lib/activist/button_helpers.rb', line 21

def add_button_link(path, text = 'Add')
  link_to((image_tag('icons/application_add.png', :class => :medium) + text).html_safe, path, :class => 'button')
end


13
14
15
# File 'lib/activist/button_helpers.rb', line 13

def button_link(path, text, icon, link_to_options = {})
  link_to((image_tag("icons/#{icon}.png") + text).html_safe, path, link_to_options.merge({:class => 'button'}))
end


17
18
19
# File 'lib/activist/button_helpers.rb', line 17

def delete_button_link(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


9
10
11
# File 'lib/activist/button_helpers.rb', line 9

def edit_button_link(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 submit_buttons(cancel_path, save_text = 'Save', cancel_text = 'Cancel')
  ('div', (: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