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

Instance Method Details



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


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_messagesObject



3
4
5
6
7
8
9
10
11
12
# File 'app/helpers/application_helper.rb', line 3

def flash_messages
  messages = ''
  %w{ notice success warning error }.each do |type|
    messages += (:div,
      (:div, flash[type.to_sym] || flash.now[type.to_sym]),
      :class => type + ' message'
      ) if flash[type.to_sym] || flash.now[type.to_sym]
  end
  messages.blank? ? '' : (:div, messages, :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