personal-journal/app/helpers/admin/journal_papers_helper.rb

10 lines
367 B
Ruby
Raw Normal View History

2014-06-04 03:55:13 +00:00
module Admin::JournalPapersHelper
def page_for_journal_paper(journal_paper_object)
2014-06-25 06:20:22 +00:00
journal_paper_page = nil
pages = Page.where(:module=>"journal_paper")
2014-06-25 06:20:22 +00:00
journal_paper_page = pages.first if journal_paper_page.nil?
request.protocol+(request.host_with_port+journal_paper_page.url+'/'+journal_paper_object.to_param).gsub('//','/') rescue "/"
2014-06-25 06:20:22 +00:00
end
2014-06-04 03:55:13 +00:00
end