I have the following code:
UPDATED with correct code:
<div class="field_med" id="ticket_note">
<%= f.fields_for :notes, Note.new do |u| %>
<%= u.text_area :note, :size => "46x4", :placeholder => "Leave notes here. Only Admins can see these." %>
<% end %>
</div>
This has a has_many association to my Ticket model so I can append as many notes as I want.
With the above code, when in my edit view it shows all notes in their own separate textarea that can be editing at the same time.
I'm using the below code to show my preexisting notes in a non-editable format.
<div class="field_med" id="ticket_note">
<% for note in @ticket.notes %><br />
<%= note.created_at %> <%= note.note %>
<% end %>
</div>
How can I just show the latest textarea for a new note, but not display all the preexisting notes?
<%= f.fields_for Note.new do |u| %>actually gives me what I'm looking for. But when I save it, to add the new note I getCan't mass-assign protected attributes: noteBut I know it's not because of theattr_accessiblein either Ticket or Notes model because it saves without issue the original way.