first commit
This commit is contained in:
26
app/views/articles/_form.html.erb
Normal file
26
app/views/articles/_form.html.erb
Normal file
@@ -0,0 +1,26 @@
|
||||
<%= form_with model: article do |form| %>
|
||||
<div>
|
||||
<%= form.label :title %><br>
|
||||
<%= form.text_field :title %>
|
||||
<% article.errors.full_messages_for(:title).each do |message| %>
|
||||
<div><%= message %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :body %><br>
|
||||
<%= form.text_area :body %>
|
||||
<% article.errors.full_messages_for(:body).each do |message| %>
|
||||
<div><%= message %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :status %><br>
|
||||
<%= form.select :status, Visible::VALID_STATUSES, selected: article.status || 'public' %><br>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user