foodsoft/app/helpers/messages_helper.rb

18 lines
659 B
Ruby
Raw Normal View History

module MessagesHelper
def groups_for_select
groups = [[" -- Arbeitsgruppen -- ", ""]]
groups += Workgroup.find(:all, :order => 'name', :include => :memberships).reject{ |g| g.memberships.empty? }.collect do |g|
[g.name, g.id]
end
groups += [[" -- Bestellgruppen -- ", ""]]
groups += Ordergroup.without_deleted(:order => 'name', :include => :memberships).reject{ |g| g.memberships.empty? }.collect do |g|
[g.name, g.id]
end
groups
end
2009-01-15 20:10:50 +01:00
def format_subject(message, length)
truncate "<b>#{link_to(h(message.subject), message)}</b> <span style='color:grey'>#{h(message.body)}</span>", :length => length
end
end