参考别人的sample,在applicatin.rb增加rescue_action_in_public方法定义:
[code]
class ApplicationController < ActionController::Base
# Pick a unique cookie name to distinguish our session data from others'
session :session_key => '_mingle_session_id'
def rescue_action_in_public(exception)
render :file=>"#{RAILS_ROOT}/public/500.html"
end
end
[/code]
修改config=>config.action_controller.consider_all_requests_local = false
启动server,然后输入http://localhost:3000/aaa,但这个方法没有起作用,依然显示:
Routing Error
no route found to match "/aaa" with {:method=>:get}
还需要做什么设定呢?
[code]
class ApplicationController < ActionController::Base
# Pick a unique cookie name to distinguish our session data from others'
session :session_key => '_mingle_session_id'
def rescue_action_in_public(exception)
render :file=>"#{RAILS_ROOT}/public/500.html"
end
end
[/code]
修改config=>config.action_controller.consider_all_requests_local = false
启动server,然后输入http://localhost:3000/aaa,但这个方法没有起作用,依然显示:
Routing Error
no route found to match "/aaa" with {:method=>:get}
还需要做什么设定呢?