18 lines
539 B
Plaintext
18 lines
539 B
Plaintext
<% if logged_in? %>
|
|
<%= form_with model: [ @article, @article.comments.build ] do |form| %>
|
|
<p>
|
|
<%= form.label :body %><br>
|
|
<%= form.text_area :body %><br>
|
|
</p>
|
|
<p>
|
|
<%= form.label :status %><br>
|
|
<%= form.select :status, Visible::VALID_STATUSES, selected: 'public' %><br>
|
|
</p>
|
|
<p>
|
|
<%= form.submit %><br>
|
|
</p>
|
|
<% end %>
|
|
<% else %>
|
|
<%= link_to "Sign up", signup_path %> or
|
|
<%= link_to "Log in", login_path %>
|
|
<% end %> |