geekelo / dsa_practice

This repo is maintained just for the purpose of daily data structures and algorithm practice and proficiency
1 stars 0 forks source link

admin_roles.rb #60

Open geekelo opened 1 month ago

geekelo commented 1 month ago

FILE

ActiveAdmin.register AdminRole do
  permit_params :name

  menu parent: 'Configuration', label: 'Admin Roles'

  # 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
  #
  #
  # or
  #
  # permit_params do
  #   permitted = [:name]
  #   permitted << :other if params[:action] == 'create' && current_user.admin?
  #   permitted
  # end
end
geekelo commented 1 month ago

This code is a configuration file for the ActiveAdmin framework in a Ruby on Rails application. ActiveAdmin is a popular tool for creating elegant and highly customizable admin interfaces in Rails applications. Let's break down what's happening in this specific file:

File: admin_role.rb

1. ActiveAdmin.register AdminRole do

2. permit_params :name

3. menu parent: 'Configuration', label: 'Admin Roles'

4. Commented Code

Summary:

This is a basic setup, and more customization can be added as needed by uncommenting and expanding the code.