Fix backend index page

This commit is contained in:
manson 2014-05-02 18:54:08 +08:00
parent 4ae1040fc8
commit 658ffe34a1
1 changed files with 3 additions and 1 deletions

View File

@ -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