26 lines
700 B
Plaintext
26 lines
700 B
Plaintext
<%= render partial: 'shared/form_model_errors', locals: { obj: comment } %>
|
|
|
|
<% if comment.id.nil? %>
|
|
|
|
<%= form_for comment, url: admin_create_comment_path(test_hash: test_hash), method: :post do |form| %>
|
|
<div class="form-group">
|
|
<%= form.label :message, "New Comment" %>
|
|
<%= form.text_area :message %>
|
|
</div>
|
|
|
|
<%= submit_tag "Save Comment" %>
|
|
<% end %>
|
|
|
|
<% else %>
|
|
|
|
<%= form_for comment, url: admin_update_comment_path(test_hash: test_hash, id: comment.id), method: :post do |form| %>
|
|
<div class="form-group">
|
|
<%= form.label :message, "Update Comment" %>
|
|
<%= form.text_area :message %>
|
|
</div>
|
|
|
|
<%= submit_tag "Update" %>
|
|
<% end %>
|
|
|
|
<% end %>
|