Module: ApplicationHelper
- Defined in:
- app/helpers/application_helper.rb
Overview
Methods added to this helper will be available to all templates in the application.
Instance Method Summary collapse
- #delete_link(update, url) ⇒ Object
- #edit_link(update, url) ⇒ Object
- #flash_messages ⇒ Object
- #sort_field(field_name, pos) ⇒ Object
Instance Method Details
#delete_link(update, url) ⇒ Object
19 20 21 22 |
# File 'app/helpers/application_helper.rb', line 19 def delete_link(update, url) return unless current_user link_to_remote(image_tag('icons/delete.png', :class => 'delete_button'), :update => update, :url => url, :method => :delete, :confirm => t('form_global.delete_warning')) end |
#edit_link(update, url) ⇒ Object
14 15 16 17 |
# File 'app/helpers/application_helper.rb', line 14 def edit_link(update, url) return unless current_user link_to_remote(image_tag('icons/edit.png', :class => 'edit_button'), :update => update, :url => url, :method => :get) end |
#flash_messages ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'app/helpers/application_helper.rb', line 3 def = '' %w{ notice success warning error }.each do |type| += content_tag(:div, content_tag(:div, flash[type.to_sym] || flash.now[type.to_sym]), :class => type + ' message' ) if flash[type.to_sym] || flash.now[type.to_sym] end .blank? ? '' : content_tag(:div, , :class => 'flash-messages', :id => 'flash_messages') end |
#sort_field(field_name, pos) ⇒ Object
24 25 26 27 |
# File 'app/helpers/application_helper.rb', line 24 def sort_field(field_name, pos) return unless current_user text_field_tag field_name, pos, :class => 'position_text_box' end |