J
J
john_bob2021-04-28 23:30:06
Ruby on Rails
john_bob, 2021-04-28 23:30:06

Where is the best place to store select values?

6089c456eb246790141306.png
You need to fasten select with a search to select top level domains.
I tried to store options in a js file on the client side, but it weighs 40kb (about 1500 thousand elements in the collection), and it takes a long time to load.
Where is the best place to store the options list?
Perhaps in PostgreSQL or as a collection in the model and then load the AJAX request?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2021-04-29
@john_bob

Perhaps in PostgreSQL or as a collection in the model and then load the AJAX request?
Instead of "or" should be "and". Store the data in the DBMS and load it in parts upon an AJAX request.
You can do this either on your own or using ready-made components such as Select2. To get a part of the list, the pagination components are used.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question