From b2740ecb37992035bb2676ee02b51dd9bc465307 Mon Sep 17 00:00:00 2001 From: aerotecnia99 Date: Wed, 20 Sep 2023 14:28:21 -0300 Subject: [PATCH] feat(active-admin): add index, show and edit Review --- app/admin/reviews.rb | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 app/admin/reviews.rb diff --git a/app/admin/reviews.rb b/app/admin/reviews.rb new file mode 100644 index 0000000..12c6461 --- /dev/null +++ b/app/admin/reviews.rb @@ -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