I would like to rewrite a form which is used to update a record on a database. I want to update the form so that the form input does not show the record, as the record is outputted by the line
<%= q.object.content %>.
I want the form input not to display the record, and I want that the record is updated when the input field is edited, and is not edited when it is left blank.
I am new at working with forms and don't know the best way to achieve this.
Can anyone provide any help on achieving this ? Below is the current form. Any help would be appreciated.
<%= semantic_form_for @bunchOfThings do |f| %>
<%= f.inputs do %>
<%= f.semantic_fields_for :aThing, @aThing do |q| %>
<%= q.object.content %>
<%= q.input :content, label: "A Thing: #{q.object.content}" %>
<% end %>
<% end %>
<%= f.action :submit , label: t('Some Text'), button_html: { class: 'btn btn-primary' } %>
<% end %>
form_tags? this will not be bounded to any object, so it won't show it. then, you can then manually bind the params to the object in your update method of the controller.