Method: ToolButtonsHelper#add_button

Defined in:
app/helpers/tool_buttons_helper.rb

#add_button(url, options = {}) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/helpers/tool_buttons_helper.rb', line 24

def add_button( url, options = {} )

  # label for the button = icon + "add"
  label = tool_icon( "plus black" ) + " " + t( :add )

  # default options
  options = { 
    :class => 'add_button tool show_only_in_edit_mode btn btn-default',
    :remote => true
  }.merge( options )
  
  # create the link_to tag
  link_to( label, url.to_s, options )

end