Wikilinks to Published Webs

Should be to the published action. This
didn't work right for inter-web links.
(Reported by Mike Shulman)

Also, change some .length's to .size's
(for Andrew Stacey)
This commit is contained in:
Jacques Distler 2009-09-03 23:09:10 -05:00
parent 888e93a7fd
commit 342298ed0e
5 changed files with 11 additions and 8 deletions

View file

@ -44,12 +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?
UrlGenerator.new(@controller).make_link(page_name, web, text,
UrlGenerator.new(@controller).make_link(@web, 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)
UrlGenerator.new(@controller).make_link(@web, page.author.name, page.web, nil, options)
end
# Create a hyperlink to a particular revision of a Wiki page