Rails: [actionview] Add name of template for "Single arity template handlers are deprecated." warning

Created on 26 Feb 2019  路  1Comment  路  Source: rails/rails

Steps to reproduce

  • Have a slim template
  • Run rails server
  • See warning:
DEPRECATION WARNING: Single arity template handlers are deprecated.  Template handlers must
now accept two parameters, the view object and the source for the view object.
Change:
  >> #<Class:0x00007fe2d32ac160>#call(template)
To:
  >> #<Class:0x00007fe2d32ac160>#call(template, source)

Expected behavior

  • Warning indicates the cause without having to edit the rails's source code

Actual behavior

  • Warning doesn't indicate what's causing the warning

System configuration

Rails version: latest from Github (rails6.beta2)

Ruby version: 2.5.0

(I've reported the warning to slim: https://github.com/slim-template/slim/issues/827)

Most helpful comment

This is actually an issue on slim. It doesn't define a name for its template class so we can't show in the message.

Can you please open an issue on slim repository about that? Here is where they create anonymous class.

https://github.com/judofyr/temple/blob/master/lib/temple/mixins/template.rb#L19

>All comments

This is actually an issue on slim. It doesn't define a name for its template class so we can't show in the message.

Can you please open an issue on slim repository about that? Here is where they create anonymous class.

https://github.com/judofyr/temple/blob/master/lib/temple/mixins/template.rb#L19

Was this page helpful?
0 / 5 - 0 ratings