This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
2007-11-27 20:09:41 -05:00
|
|
|
module DiscussionsHelper
|
2007-11-28 01:17:25 -05:00
|
|
|
##
|
|
|
|
# Returns a link to a Page model or to the Page owner if applicable.
|
|
|
|
#
|
|
|
|
def page_or_parent_link(page)
|
|
|
|
if page.owner_type.to_s.empty?
|
2007-12-22 19:31:09 -05:00
|
|
|
return link_to('Show Wiki Page', page_path(page.title_for_url))
|
2007-11-28 01:17:25 -05:00
|
|
|
end
|
|
|
|
link_to("Show #{page.owner_type} Page",
|
|
|
|
send("#{page.owner_type.downcase}_path", page.title_for_url))
|
|
|
|
end
|
2007-11-27 20:09:41 -05:00
|
|
|
end
|