0

I'm building a ruby API using rails admin (which is working) and rails admin import which has this problem:

Can't verify CSRF token authenticity.

Tried to deactivate it with

module Api::V1
  class ApiController < ApplicationController     
     skip_before_action :verify_authenticity_token
...
class ApplicationController < ActionController::API
      skip_before_action :verify_authenticity_token

But the result was the same error. Any ideas?

Thank you

P.S: Also getting this when I put the code above(as it apears not to be implemented)

"status":500,"error":"Internal Server Error"
"exception":"# ArgumentError: Before process_action callback :verify_authenticity_token has not been defined"

1 Answers1

0

How did you setup rails_admin?

Did you try using different controllers for both API and RailsAdmin, adding the needed includes in the later? Namely including ActionController::RequestForgeryProtection as described in Using rails_admin with rails_api?

Community
  • 1
  • 1
Panda
  • 155
  • 8