I am using Rails 7 Active admin I have Project that is Workshop Project that is related to organizing workshops, booking them etc. I am using Friendly ID Gem . The url looks like http://127.0.0.1:3000/workshops/ai-the-new-era using friendly id. Now i am using active_admin and whenever i try to use same show or edit or delete route in http://127.0.0.1:3000/admin/workshops/rails-hotwire-the-tew-era-of-rails I get this error
ActiveRecord::RecordNotFound in Admin::WorkshopsController#show Couldn't find Workshop with 'id'=rails-hotwire-the-tew-era-of-rails
statement.execute([id], connection).first ||
raise(RecordNotFound.new("Couldn't find #{name} with '#{key}'=#{id}", name, key, id))
end
My code for admin/workshop.rb
ActiveAdmin.register Workshop do
filter :registeration_fee_eq, label: 'Registration Fee'
permit_params :name, :description, :start_date, :end_date, :start_time, :end_time, :total_seats, :available_seats, :registeration_fee, :slug
form do |f|
f.inputs "Workshop Details" do
f.input :name
f.input :description
f.input :start_date
f.input :end_date
f.input :start_time
f.input :end_time
f.input :total_seats
f.input :available_seats
f.input :registeration_fee
f.input :slug
# Add the image file field
f.input :image, as: :file
end
f.actions
end
index do
column :id
column :name
column :total_seats
column :available_seats
column :registeration_fee
actions
end
show do
attributes_table do
row :id
row :name
row :description
row :registeration_fee do |workshop|
workshop.registeration_fee
end
end
end
end
I tried Many things like removing friendly id but since i need user friendly url in my user side that's why I am not doing that