diff --git a/app/helpers/admin/announcements_helper.rb b/app/helpers/admin/announcements_helper.rb index a1dc7ce..1c6171e 100644 --- a/app/helpers/admin/announcements_helper.rb +++ b/app/helpers/admin/announcements_helper.rb @@ -1,5 +1,7 @@ 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('//','/') + 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 "/" end end