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

6 lines
227 B
Ruby

module Admin::AnnouncementsHelper
def page_for_bulletin(bulletin)
request.protocol+(request.host_with_port+Page.where(:categories.in=>[bulletin.category.id.to_s]).first.url+'/'+bulletin.to_param).gsub('//','/')
end
end