In Rails4 you can do
protect_from_forgery with: :exception
This is also the default value if you generate a brand new rails application.
protect_from_forgery with: :exception
This is also the default value if you generate a brand new rails application.
Unfortunately, the Rails team have stated that it was introduced as an option, rather than default behavior for backwards compatibility reasons. It leaves me to wonder how many applications would actually have an issue if the default behavior was to generate an exception.