Answer the question
In order to leave comments, you need to log in
Field from another table?
All good!
How to display in the post _form.html.erb view a
Text field from another table?
For example from options.
For example, sorting like this
<%= f.collection_select :category_id, Category.order(:name), :id, :name %>
In this case, it takes from the categories table and lists it.
How to do something similar but just for a text field? So that it can be edited and saved to the database but already in the options table, for example.
Answer the question
In order to leave comments, you need to log in
Issue resolved.
Thanks to the user Toaster
Dmitry Sharikov Dmitry Sharikov
Who quickly told everything ... Many thanks to him.
The train of thought for solving the problem could be as follows:
By what means is the data entered into the database tables using the RoR framework?
Through model instances and create/update_attributes/destroy/delete methods.
Which controller method will be responsible for updating?
Method according to REST and CRUD concepts.
How is the data coming into the controller method?
All data is received via HTTP GET/POST/PUT/PATCH/DELETE requests through parameters that are available in params
.
How can I pass data through parameters?
Can be sent to:
form
modelA
paramK
paramL
paramM
modelB
paramX
paramY
paramZ
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question