I have a model called configurations which holds key value pairs in my database to store options for the website. The schema looks like this:
create_table "configuration", force: :cascade do |t|
t.string "key", limit: 255
t.string "value", limit: 255
end
I would like to create a page in the website, so as an admin, I can edit the values on the configurations without the need to enter the database and change them manually.
However some of the values are strings, some are integers and some are Boolean, and I would like that to be reflected in the page, so a particular key might have a drop down of true/false for a Boolean value or a text box for a string etc.
Would this be possible, and if so, how do I write a controller/form to implement this please?