BananaCrystal / email-templates

This repository contains in-house email templates that serve as structure for our emails. Each template can be updated and modified to fit requirements.
MIT License
0 stars 0 forks source link

fees.rb #21

Open geekelo opened 2 months ago

geekelo commented 2 months ago

FILE

ActiveAdmin.register Fee do
  permit_params :name, :slug, :amount, :units, :currency, :status

  config.sort_order = 'name_asc'

  menu parent: 'Configuration', label: 'Fees'

  # 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 :name, :slug, :amount, :units, :currency, :status
  #
  # or
  #
  # permit_params do
  #   permitted = [:name, :slug, :amount, :units, :currency, :status]
  #   permitted << :other if params[:action] == 'create' && current_user.admin?
  #   permitted
  # end
end
geekelo commented 2 months ago

This code sets up an admin interface for managing Fee records using ActiveAdmin. Here's an explanation of the key components:

1. Menu Configuration

2. Permitted Parameters

3. Sort Order Configuration

4. Commented Configuration

Summary

This configuration is focused on managing fee-related settings in your system through ActiveAdmin. It organizes the Fee resource under the "Configuration" menu, sets a default sort order, and securely defines which parameters can be modified by administrators. The commented-out sections provide examples of how to extend or customize this setup further if needed.