Skip to content

Commit

Permalink
feat(active-admin): add index, show and edit Review
Browse files Browse the repository at this point in the history
  • Loading branch information
aerotecnia99 committed Sep 20, 2023
1 parent e821d2f commit 1aff585
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions app/admin/reviews.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
ActiveAdmin.register Review do

# See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
#
# Uncomment all parameters which should be permitted for assignment
#
# permit_params :comment, :item_id, :user_id
#
# or
#
# permit_params do
# permitted = [:comment, :item_id, :user_id]
# permitted << :other if params[:action] == 'create' && current_user.admin?
# permitted
# end
includes :item, :user

index do
selectable_column
id_column
column :item
column :user
actions
end

show do
attributes_table do
row :item
row :user
row :comment
end
end

form do |f|
f.inputs do
f.input :item_id
f.input :user_id
f.input :comment
end
f.actions
end
end

0 comments on commit 1aff585

Please sign in to comment.