Answer the question
In order to leave comments, you need to log in
How to find out the contents of a field (like f.name) from a form in Rails?
Here, when editing, the value is not explicitly set in the form through value='<%= ... %>', but is somehow generated.
How can I find out what value a certain field has. So <%= f.name %> doesn't work.
Answer the question
In order to leave comments, you need to log in
Look for a method form_for
, take its first argument, and outputаргумент.name
If the form looks like form_for @object (and so on), then you need to substitute @object.attribute in the value, in your case @object.name.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question