I'm using ActiveAdmin gem in my Rails application. I have an Item resource in the ActiveAdmin. I have allowed all the actions except new.
actions :all, except: [:new]
But in the URL if explicitly passed /admin/items/new, it throwing an ActiveRecord::Not Found error as it taking new as an id. In the description of the error, it is showing "Couldn't find Item with 'id'=new. I want to redirect to 404 or Not found page if an invalid url is passed. Can someone help me with this? Thanks is advance!
Aucun commentaire:
Enregistrer un commentaire