Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to fetch data from db and store into a variable of another controller in ruby

I want to use the fetched data by inserting into an array, so that i can use it for the rest of the program.

I have a settings module (with all Model View and Controller), from the view I am able to send results to the database with the help of controller and model. Now that it's in the DB, I need the values in another controller.

I tried this

setting = Settings.all (Settings is a model). but i have no luck. Is there a way to use the values from DB based on a field

Comments