lib/air_blade/air_budd/form_helper.rb
def link_to_form(purpose, options = {}, html_options = nil)
        icon = case purpose
               when :new    then 'add'
               when :edit   then 'pencil'
               when :delete then 'cross'  # TODO: delete should be a button, not a link
               when :cancel then 'arrow_undo'
               end
        if options.kind_of? String
          url = options
        else
          url = options.delete :url
          label = options.delete :label
        end
        label ||= purpose.to_s.capitalize
        legend = ( icon.nil? ?
                   '' :
                   "<img src='/images/icons/#{icon}.png' alt=''></img> " ) + label
        
        '<div class="buttons">' +
        link_to(legend, (url || options), html_options) +
        '</div>'
      end
# Displays a link visually consistent with AirBudd form links.
# TODO: complete this.  See README.
# TODO: DRY with FormBuilder#button implementation.
Displays a link visually consistent with AirBudd form links.
TODO: complete this.  See README.
TODO: DRY with FormBuilder#button implementation.
Displays a link visually consistent with AirBudd form links . TODO : complete this . See README . TODO : DRY with FormBuilder#button implementation .
def link_to_form(purpose, options = {}, html_options = nil)
        icon = case purpose
               when :new    then 'add'
               when :edit   then 'pencil'
               when :delete then 'cross'  
               when :cancel then 'arrow_undo'
               end
        if options.kind_of? String
          url = options
        else
          url = options.delete :url
          label = options.delete :label
        end
        label ||= purpose.to_s.capitalize
        legend = ( icon.nil? ?
                   '' :
                   "<img src='/images/icons/#{icon}.png' alt=''></img> " ) + label
        '<div class="buttons">' +
        link_to(legend, (url || options), html_options) +
        '</div>'
      end
def link_to_form ( purpose , options = { } , html_options = nil ) icon = case purpose when :new then 'add' when :edit then 'pencil' when :delete then 'cross' when :cancel then 'arrow_undo' end if options . kind_of? String url = options else url = options . delete :url label = options . delete :label end label ||= purpose . to_s . capitalize legend = ( icon . nil? ? '' : "<img src='/images/icons/#{icon}.png' alt=''></img> " ) + label '<div class="buttons">' + link_to ( legend , ( url || options ) , html_options ) + '</div>' end
Displays a link visually consistent with AirBudd form links.
Displays a link visually consistent with AirBudd form links .
# TODO: delete should be a button, not a link
purpose
options
html_options