Moses Gathuku

Joined

1,670 Experience
9 Lessons Completed
1 Question Solved

Activity

Posted in Custom Image Analyzer

Hello,
The problem could be autoloading because config files loads before the actual code
You could use something like this in application.rb

    config.after_initialize do
      config.active_storage.analyzers.prepend ExifAnalyzer
    end

Posted in How to Add Pagination with Pagy Discussion

Pagy is awesome, do we have a tailwindcss plugin for stylling @chris

Posted in Devise on Heroku

Hello, I have been implementing device JWT with rails 6.0 API . I have used this callback to protect from fogery requests, On the applicationController

protect_from_forgery unless: -> { request.format.json? }

Its works well locally but when i diploy on heroku i get undefined method protect_from_fogery
and the app status changes from starting to crashed. When i remove it works fine but am not able to make JSON requests which it.
Error

/app/app/controllers/application_controller.rb:3:in `<class:ApplicationController>': undefined method `protect_from_fogery' for ApplicationController:Class (NoMethodError)

Devise -4.7.1
Rails API - 6.0

Posted in JSON Web Tokens with Devise & Warden Discussion

Hey Chris am having issues with verify_authenticity_token When i deploy on heroku. But the same works locally.