cjwess
2/28/2017 - 10:23 PM

update form example

update form example

<form method="post" action="/entries/<%= @entry.id %>">
  <input type="hidden" name="_method" value="put">

  <label for="title-input" class="block mar-b-1">Title:</label>
  <input id="title-input" name="entry[title]" type="text" value="<%= @entry.try(:title) %>" tabindex="1" class="block w-100 no-outline no-border pad-1 mar-b-2">

  <label for="body-textarea" class="block mar-b-1">Body:</label>
  <textarea id="body-textarea" name="entry[body]" tabindex="2" class="block w-100 h-10 no-resize no-outline no-border no-resize pad-1 mar-b-2"><%= @entry.try(:body) %></textarea>

  <input type="submit" value="Update" tabindex="3" class="block button w-100 mar-t-4 mar-b-3 pad-2 round-1 text-c center no-border no-outline">
</form>