rubycas / rubycas-client-rails

Rails plugin for the RubyCAS-Client
MIT License
77 stars 70 forks source link

Missing `before` method when working with Rails 4.1.0-b1 #27

Open cassiuschen opened 10 years ago

cassiuschen commented 10 years ago

When I put before_filter RubyCAS::Filter in my controller's script, it drops that undefined methodbefore' for RubyCAS::Filter:Class`...

I don't know why but rubycas-client-rails works just fine with Rails 4.0.2 in another app. Could you please help me to figure it out?

railsfactory-anandvignesh commented 10 years ago

Absolutely,myself also suffering with the same problem..

cassiuschen commented 10 years ago

Is that about the changes in Rails 4.1.0? Considering before_filter has been officially token place by before_action, I didn't find any difference between these two method before using rubycas.....

rodkey commented 10 years ago

So to be clear: if instead of putting in before_filter RubyCAS::Filter I use before_action RubyCAS::Filter

all should be well?

jimee02 commented 10 years ago

For anyone stuck with this problem, the before method seems to be missing from the filter class.

You can use an older version of the rubycas-client or clone the master branch. gem 'rubycas-client', :git => 'git://github.com/rubycas/rubycas-client.git'

The gem has not been updated with the bug fix

utilum commented 10 years ago

I was stuck with this problem and ended up using the solution proposed by jimee02.

But it took a little while to understand the solution: Remove rubycass-client-rails from your Gemfile and use the older, rubycas-client instead, specifiying you want the master branch as in the line above. Then follow the coniguration instructions in this older gem's doc.

cassiuschen commented 10 years ago

It's not about which one is older. If your Rails version is above 4.1, it needs the before method when you call before_filter or before_action. So I added it and merged into master branch. That's why you need to select the master branch from GitHub or clone it to local.

在 2014年8月11日,下午11:19,utilum notifications@github.com 写道:

I was stuck with this problem and ended up using the solution proposed by jimee02.

But it took a little while to understand the solution: Remove rubycass-client-rails from your Gemfile and use the older, rubycas-client instead, specifiying you want the master branch as in the line above. Then follow the coniguration instructions in this older gem's doc.

— Reply to this email directly or view it on GitHub.

duhaime commented 8 years ago

Awesome, thanks!

sg552 commented 6 years ago

cool. it works for me . thanks @jimee02