vendredi 17 juillet 2015

How to rescue_from ActionDispatch::Cookie::CookieOverflow?

First at all, I have read:

Cookie overflow in rails application?

And this is not the problem that I'm facing.

I'm working with:

gem "rails", "~> 3.2.11"

and

ruby 1.9.3-p125

I'm trying to process a search, and when the search is tooooooo big I get this error:

ActionDispatch::Cookies::CookieOverflow

I would like to rescue_form this error in the ApplicationController but it seems that is not working for me:

rescue_from ActionDispatch::Cookies::CookieOverflow :with => :render_404

where:

def render_404
    respond_to do |r|
        r.html { render :template => "something/404", :status => 404}
        r.all  { render :nothing => true, :status => 404 }
    end
    true
end

any help is going to be well received.

Aucun commentaire:

Enregistrer un commentaire