rails-api and Devise
The 'rails-api' gem is a "Rails for API only applications". It does not have all the Rails modules enabled, this way it's simpler. However, this is a issue when you try to use the Devise gem with it:
devise-2.2.3/app/controllers/devise_controller.rb:13:in `<class:DeviseController>': undefined local variable or method `mimes_for_respond_to' for DeviseController:Class
The solution for this is quite simple, add to your application controller the following module
class ApplicationController < ActionController::API
include ActionController::MimeResponds
end
Have fun
Written by Marco da Silva
Related protips
1 Response

Nice!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#