Skip to content

Instantly share code, notes, and snippets.

@ParthivPatel-BTC
Last active September 11, 2019 08:44
Show Gist options
  • Save ParthivPatel-BTC/b1cf2cc9c81da0638496681c4b6e9dd2 to your computer and use it in GitHub Desktop.
Save ParthivPatel-BTC/b1cf2cc9c81da0638496681c4b6e9dd2 to your computer and use it in GitHub Desktop.
Create new task form
<%= form_with(model: @task, local: true) do |form| %>
<% if task.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(task.errors.count, "error") %> prohibited this task from being saved:</h2>
<ul>
<% task.errors.full_messages.each do |message| %>
<li><%= massage %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= form.label :title %>
<%= form.text_field :title %>
</div>
<div class="field">
<%= form.label :description %>
<%= form.text_field :description %>
</div>
<div class="field">
<%= form.label :start_date %>
<%= form.datetime_select :start_date %>
</div>
<div class="field">
<%= form.label :end_date %>
<%= form.datetime_select :end_date %>
</div>
<div class="field">
<%= form.label :event %>
<%= form.text_field :event %>
</div>
<div class="field">
<%= form.label :members %>
<%= form.text_field :members %>
</div>
<div class="actions">
<%= form.submit %>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment