engine/app/helpers/application_helper.rb

31 lines
630 B
Ruby

module ApplicationHelper
def title(title = nil)
if title.nil?
@content_for_title
else
@content_for_title = title
''
end
end
def flash_message
if not flash.empty?
content_tag :div, flash.values.first,
:id => "flash-#{flash.keys.first}",
:class => 'application-message'
else
''
end
end
def nocoffee_tag
link_to content_tag(:em, 'no') + 'Coffee', 'http://www.nocoffee.fr', :id => 'nocoffee'
end
def submit_button_tag(label)
content_tag(:button, content_tag(:span, label), :type => 'submit', :class => 'button')
end
end