Commit 9d57f745d5cc81ff30b18a2aa29e382f3eec6d0c

Catch RoutingError's gracefully

Commit diff

app/controllers/application.rb

 
77 include ExceptionNotifiable
88
99 rescue_from ActiveRecord::RecordNotFound, :with => :render_not_found
10 rescue_from ActionController::RoutingError, :with => :render_not_found
10 rescue_from ActionController::UnknownController, :with => :render_not_found
11 rescue_from ActionController::UnknownAction, :with => :render_not_found
12
13 def rescue_action(exception)
14 return super if RAILS_ENV != "production"
15
16 case exception
17 # Can't catch RoutingError with rescue_from it seems,
18 # so do it the old-fashioned way
19 when ActionController::RoutingError
20 render_not_found
21 else
22 super
23 end
24 end
1125
1226 protected
1327 def require_user_has_ssh_keys
toggle raw diff

config/routes.rb

 
3737 :confirm_delete => :get
3838 }, :as => "repos") do |repo|
3939 repo.resources :committers, :name_prefix => nil, :collection => {:auto_complete_for_user_login => :post}
40 repo.resources :comments
40 repo.resources :comments, :member => { :commmit => :get }
4141 repo.resources :merge_requests, :member => { :resolve => :put }
4242 repo.commit_comment "comments/commit/:sha", :controller => "comments",
4343 :action => "commit", :conditions => { :method => :get }
toggle raw diff