Rails - handling global site settings

I am developing a new rails application, which is supposed to be installed several times in order to implement several sites.

There are some things, such as “Site Name” or “Default Number for Each Page” that explicitly belong to the “global settings” table / configuration files.

I have compiled a list of things that I think I will need:

  • ActiveRecord model capable of:
    • Saving various types of data. I assume this will be accomplished by encoding the values ​​in the string to db, possibly with a type field.
    • Indexing Settings by Name
    • Checks based on the type attribute (i.e. do not accept invalid dates in the date settings)
    • Checks based on the allow_nil property.
  • A controller that allows me to change settings through views.

I am sure that I can realize this myself, but I do not want to reinvent the wheel. I did a few searches, but I could find rails-settings , which doesn’t really serve me: I need the right model and therefore I can use declarative authorization and does not provide any controller or view functions.

Is there a gem or plugin that implements what I want, or any library that I have to look at?

Many thanks.

+3
source share
1 answer

I will answer my question: there is not.

You will need to implement your own system.

+2

Source: https://habr.com/ru/post/1740454/


All Articles