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

fiat_rates.rb #22

Open geekelo opened 2 months ago

geekelo commented 2 months ago

FILE

ActiveAdmin.register FiatRate do

  config.sort_order = 'date_desc'

  menu parent: 'Currencies', label: 'EU Rates'
  # 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 :base_currency, :currency, :rate, :source, :date
  #
  # or
  #
  # permit_params do
  #   permitted = [:base_currency, :currency, :rate, :source, :date]
  #   permitted << :other if params[:action] == 'create' && current_user.admin?
  #   permitted
  # end

end
geekelo commented 2 months ago

This ActiveAdmin configuration sets up an admin interface for managing FiatRate records. Here's an overview of how it works:

1. Menu Configuration

2. Sort Order Configuration

3. Permitted Parameters

4. Commented Configuration

Summary

This configuration is designed to manage fiat currency exchange rates, particularly those related to the Euro or European currencies. It organizes the FiatRate resource under the "Currencies" menu with a focus on "EU Rates," ensures that the most recent rates are displayed first, and securely defines which parameters can be modified by administrators. The flexibility provided by the commented-out block allows for more advanced configuration if needed.