1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/test
Genadi Samokovarov a58db74c4f Don't expect defined protect_against_forgery? in {token,csrf_meta}_tag
The `#csrf_meta_tags` and `#token_tag` Action View helper methods are
expecting the class in which are included to explicitly define the
method `#protect_against_forgery?` or else they will fail with
`NoMethodError`.

This is a problem if you want to use Action View outside of Rails
applications. For example, in #34788 I used the `#button_to` helper
inside of the error pages templates that have a custom
`ActionView::Base` subclass, which did not defined
`#protect_against_forgery?` and trying to call the button failed.

I had to dig inside of Action View to find-out what's was going on. I
think we should either set a default method implementation in the
helpers or check for the method definition, but don't explicitly require
the presence of `#protect_against_forgery?` in every `ActionViews::Base`
subclass as the errors are hard to figure out.
2018-12-27 11:33:54 +02:00
..
actionpack make bot happy 2018-09-24 16:01:34 -07:00
activerecord Add allocations to template renderer subscription 2018-10-10 08:07:12 -04:00
fixtures Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
lib/controller Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
template Don't expect defined protect_against_forgery? in {token,csrf_meta}_tag 2018-12-27 11:33:54 +02:00
ujs Merge pull request #34635 from WoH/data-disable-forever 2018-12-18 10:54:12 -05:00
abstract_unit.rb Fix more offences 2018-09-25 13:21:40 -04:00
active_record_unit.rb Remove deprecated catch-all route in the AV tests 2018-09-24 15:39:15 -07:00