padrino / padrino-recipes

A collection of padrino templates and plugins
http://www.padrinorb.com
292 stars 50 forks source link

Avoid using the protection to a route of better_errors, fixes #62. #63

Closed namusyaka closed 10 years ago

namusyaka commented 10 years ago

This recipe will inject set :protect_from_csrf into app/app.rb after Padrino::Application. So, app/app.rb will be something like this.

module Foobar
  class App < Padrino::Application
    set :protect_from_csrf, except: %r{/__better_errors/\d+/\w+\z}
    register Padrino::Rendering
    register Padrino::Mailer
    ...
  end
end