Continue extracting URL generation logic from model classes
This commit is contained in:
parent
7e500dfe57
commit
70fa15e3f3
12 changed files with 191 additions and 127 deletions
|
@ -44,7 +44,12 @@ module ApplicationHelper
|
|||
# Creates a hyperlink to a Wiki page, or to a "new page" form if the page doesn't exist yet
|
||||
def link_to_page(page_name, web = @web, text = nil, options = {})
|
||||
raise 'Web not defined' if web.nil?
|
||||
web.make_link(page_name, text, options.merge(:base_url => "#{base_url}/#{web.address}"))
|
||||
UrlGenerator.new(@controller).make_link(page_name, web, text,
|
||||
options.merge(:base_url => "#{base_url}/#{web.address}"))
|
||||
end
|
||||
|
||||
def author_link(page, options = {})
|
||||
UrlGenerator.new(@controller).make_link(page.author.name, page.web, nil, options)
|
||||
end
|
||||
|
||||
def base_url
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue