Merge pull request #2 from giga/base-url

Fix relative url
This commit is contained in:
Sunny Ripert
2012-07-25 07:59:01 -07:00
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -121,7 +121,7 @@ module Precious
mustache :edit
end
else
redirect "/create/#{CGI.escape(@name)}"
redirect to("/create/#{CGI.escape(@name)}")
end
end
@@ -154,7 +154,7 @@ module Precious
@page = wiki.page(@name)
wiki.delete_page(@page, { :message => "Destroyed #{@name} (#{@page.format})" })
redirect '/'
redirect to('/')
end
get '/create/*' do
@@ -165,7 +165,7 @@ module Precious
page = wiki.page(@name)
if page
redirect "/#{page.escaped_url_path}"
redirect to("/#{page.escaped_url_path}")
else
mustache :create
end
@@ -346,7 +346,7 @@ module Precious
file.raw_data
else
page_path = [path, name].compact.join('/')
redirect "/create/#{CGI.escape(page_path).gsub('%2F','/')}"
redirect to("/create/#{CGI.escape(page_path).gsub('%2F','/')}")
end
end
+1 -1
View File
@@ -60,7 +60,7 @@
<div id="footer">
<p id="last-edit">Last edited by <b>{{author}}</b>, {{date}}</p>
<p>
<a id="delete-link" href="{{escaped_url_path}}" data-confirm="Are you sure you want to delete this page?"><span>Delete this Page</span></a>
<a id="delete-link" href="{{base_url}}/{{escaped_url_path}}" data-confirm="Are you sure you want to delete this page?"><span>Delete this Page</span></a>
</p>
</div>
</div>