Rescue_from ActionController::MethodNotAllowed

Hello,

I’m having some trouble handing ActionController::MethodNotAllowed
errors. Basically, the following is defined in my controllers, but
obviously I’m missing something. Thanks in advance for any light you
can shed.


class UsersController < ApplicationController
rescue_from ActionController::MethodNotAllowed, :with
=> :not_allowed

def not_allowed
flash[:message] = “The action you requested is not supported.”
redirect_to welcome_path
end

By the way, the trouble I’m having is that the error is not being
handled by ‘not_allowed’… :slight_smile:

I have used rescue_from and this looks fine to me.

But twist in the tale I found while googling for the same.
I think you are looking for this:
http://rails.lighthouseapp.com/projects/8994/tickets/744-rescue_from-routing-errors

Though I think Pratik has solved this issue:
http://m.onkey.org/tags/actionpack

may be helpful for you

-Gourav

Thank you, Gourav… I’ll check it out.