Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single arity template handlers and rails 6.0.0.beta2 #1007

Closed
remomueller opened this issue Mar 4, 2019 · 5 comments
Closed

Single arity template handlers and rails 6.0.0.beta2 #1007

remomueller opened this issue Mar 4, 2019 · 5 comments

Comments

@remomueller
Copy link

I'm getting a "Single arity template handlers" error when using haml with the new rails 6.0.0.beta2.

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#call(template)
To:
  >> Class#call(template, source)

It looks like this is caused by this line of code here:

def self.call(template)

The following approach to fix was used in coffee-rails by Aaron Patterson:

rails/coffee-rails@cbf6af6

I've also seen a similar issue request for the slim gem here:
slim-template/slim#827

This is also related to the following rails issue:
rails/rails#35413

Thanks! Let me know if you need additional information!

@alexvirtualbr
Copy link

alexvirtualbr commented Mar 15, 2019

Here I'm getting this error above when I run rails db:migrate

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#call(template)
To:
Class#call(template, source)
(called from

at /myApp/Rakefile:6)

I use Rails 6.0.0.beta2 and ruby 2.6

@cbothner
Copy link

Closed by #1008

@amatsuda
Copy link
Member

done via #1008

@nezirz
Copy link

nezirz commented Sep 12, 2019

Upgrading the coffee-rails fixed issue in my case on ruby 2.6.4 and rails 6.0.0

@sreenak
Copy link

sreenak commented Jun 2, 2020

I got the same error, I was using coffee-rails gem version 4.2, updating coffee-rails gem version to 5.0.0 solved my issue. it should resolve your problem. for ref: https://rubygems.org/gems/coffee-rails/versions/5.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants