[BREAK BUILD] Upgrade URL rewriting to Routes (there is one test case in routes_test.rb that fails, and it depends on some refactoring that I agreed upon with Ulysses)
This commit is contained in:
parent
9c04ed3461
commit
5e25a94e51
10 changed files with 93 additions and 234 deletions
|
@ -33,7 +33,7 @@ class AdminController < ApplicationController
|
|||
@wiki.create_web(@params['name'], @params['address'])
|
||||
redirect_show('HomePage', @params['address'])
|
||||
else
|
||||
redirect_to :action => 'index'
|
||||
redirect_to :controller => 'wiki', :action => 'index'
|
||||
end
|
||||
else
|
||||
# no form submitted -> render template
|
||||
|
@ -80,7 +80,7 @@ class AdminController < ApplicationController
|
|||
if wiki.authenticate(@params['system_password_orphaned'])
|
||||
wiki.remove_orphaned_pages(@web_name)
|
||||
flash[:info] = 'Orphaned pages removed'
|
||||
redirect_to :action => 'list'
|
||||
redirect_to :controller => 'wiki', :web => @web_name, :action => 'list'
|
||||
else
|
||||
flash[:error] = password_error(@params['system_password'])
|
||||
return_to_last_remembered
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
require 'url_rewriting_hack'
|
||||
|
||||
# The filters added to this controller will be run for all controllers in the application.
|
||||
# Likewise will all the methods added be available for all controllers.
|
||||
class ApplicationController < ActionController::Base
|
||||
|
||||
# implements Instiki's legacy URLs
|
||||
require 'url_rewriting_hack'
|
||||
|
||||
before_filter :set_utf8_http_header, :connect_to_model
|
||||
after_filter :remember_location
|
||||
|
||||
|
@ -88,7 +83,7 @@ class ApplicationController < ActionController::Base
|
|||
def remember_location
|
||||
if @response.headers['Status'] == '200 OK'
|
||||
unless @@REMEMBER_NOT.include? action_name or @request.method != :get
|
||||
@session[:return_to] = url_for
|
||||
@session[:return_to] = @request.request_uri
|
||||
logger.debug("Session ##{session.object_id}: remembered URL '#{@session[:return_to]}'")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue