Ensure views only link to those actions allowed for current user

This commit is contained in:
Sebastian Serth
2018-11-30 13:29:04 +01:00
parent d3f67ab4c7
commit 2125fb1c1d
56 changed files with 128 additions and 264 deletions

View File

@@ -1,33 +0,0 @@
= form_for(@comment) do |f|
- if @comment.errors.any?
#error_explanation
h2
= pluralize(@comment.errors.count, "error")
| prohibited this comment from being saved:
ul
- @comment.errors.full_messages.each do |message|
li= message
.field
= f.label :user_id
br/
= f.text_field :user_id
.field
= f.label :file_id
br/
= f.text_field :file_id
.field
= f.label :row
br/
= f.number_field :row
.field
= f.label :column
br/
= f.number_field :column
.field
= f.label :text
br/
= f.text_field :text
.actions
= f.submit

View File

@@ -1,7 +0,0 @@
h1 Editing comment
= render 'form'
= link_to 'Show', @comment
| |
= link_to 'Back', comments_path

View File

@@ -1,24 +0,0 @@
h1 Listing comments
table
thead
tr
th User
th File
th Row
th Column
th Text
th colspan="3"
tbody
- @comments.each do |comment|
tr
td= comment.user
td= comment.file
td= comment.row
td= comment.column
td= comment.text
td= link_to 'Show', comment
td= link_to 'Edit', edit_comment_path(comment)
td= link_to 'Destroy', comment, method: :delete, data: confirm: 'Are you sure?'
br/
= link_to 'New Comment', new_comment_path

View File

@@ -1,5 +0,0 @@
h1 New comment
= render 'form'
= link_to 'Back', comments_path

View File

@@ -1,25 +0,0 @@
p#notice= notice
p
strong User:
= @comment.user
p
strong File:
= @comment.file
p
strong Row:
= @comment.row
p
strong Column:
= @comment.column
p
strong Text:
= @comment.text
= link_to 'Edit', edit_comment_path(@comment)
| |
= link_to 'Back', comments_path