announcement-test/app/helpers/admin/announcements_helper.rb

8 lines
320 B
Ruby
Raw Normal View History

2014-04-03 03:18:02 +00:00
module Admin::AnnouncementsHelper
2014-05-02 10:21:51 +00:00
def page_for_bulletin(bulletin)
2014-05-02 10:54:08 +00:00
page = Page.where(:categories.in=>[bulletin.category.id.to_s]).first
page = Page.where(:module=>'announcement').first if page.nil?
request.protocol+(request.host_with_port+page.url+'/'+bulletin.to_param).gsub('//','/') rescue "/"
2014-05-02 10:21:51 +00:00
end
2014-04-03 03:18:02 +00:00
end