engine/app/helpers/application_helper.rb

41 lines
831 B
Ruby
Raw Normal View History

2010-03-29 22:01:47 +00:00
module ApplicationHelper
2010-04-22 23:52:11 +00:00
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
2010-04-25 00:33:38 +00:00
def growl_message
if not flash.empty?
%{
$(document).ready(function() {
$.growl("#{flash.keys.first}", "#{flash.values.first}");
});
}.to_s
end
end
2010-04-24 00:32:36 +00:00
def nocoffee_tag
link_to content_tag(:em, 'no') + 'Coffee', 'http://www.nocoffee.fr', :id => 'nocoffee'
end
2010-04-22 23:52:11 +00:00
def submit_button_tag(label)
content_tag(:button, content_tag(:span, label), :type => 'submit', :class => 'button')
end
2010-03-29 22:01:47 +00:00
end