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

Already on GitHub? Sign in to your account

missing helper_method #6

Closed
bopbi opened this Issue Apr 22, 2012 · 4 comments

Comments

Projects
None yet
2 participants

bopbi commented Apr 22, 2012

when i try to integrate rails-api with devise, it show an error like this

/Users/bobbyadiprabowo/.rvm/gems/ruby-1.9.2-p180@kulinr-rails-api/gems/devise-2.0.4/lib/devise/controllers/helpers.rb:8:in block in <module:Helpers>': undefined methodhelper_method' for ActionController::API:Class (NoMethodError)

maybe helper_method is not included in ActionController::API:Class

@tigaenamb you're right, helper_method is not included in API, and it's because we don't need it as we're not using helpers and rendering templates. I think this should be handled by devise, to not call helper_method if it does not respond to it. Another solution would be to have a stub implementation of helper_method just to ignore such errors.

Thanks for reporting.

@tigaenamb I've just merged an addition to the Compatibility module that adds a stub helper_method, should work fine for now. Could you give it a try bundling from master? Thanks.

bopbi commented Apr 24, 2012

ok, i try it later, sorry i am a little busy right now

No problem, thanks.

j-wilkins pushed a commit to j-wilkins/rails-api that referenced this issue Oct 23, 2014

Merge pull request #10 from educobuci/helper_method_compatibility
Added compatibility to 'helper_method'. Closes #6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment