RBOnRails-learning/app/views/comments/_form.html.erb

18 lines
539 B
Plaintext
Raw Normal View History

2024-08-08 09:19:44 +00:00
<% 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 %>
2024-08-07 14:43:33 +00:00
<% end %>