Skip to content

Commit e78a1eb

Browse files
committed
Move report render condition into partial.
1 parent 7897f3c commit e78a1eb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
.text-end
2-
= button_to t('.report'), report_request_for_comment_path(request_for_comment),
3-
data: {confirm: t('.confirm')},
4-
class: 'btn btn-light btn-sm'
1+
- if policy(@request_for_comment).report?
2+
.text-end
3+
= button_to t('.report'), report_request_for_comment_path(request_for_comment),
4+
data: {confirm: t('.confirm')},
5+
class: 'btn btn-light btn-sm'

app/views/request_for_comments/show.html.slim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
.text
2929
- question = @request_for_comment.question
3030
= question.presence || t('request_for_comments.no_question')
31-
- if policy(@request_for_comment).report?
32-
= render('report', request_for_comment: @request_for_comment)
31+
= render('report', request_for_comment: @request_for_comment)
3332

3433
- if policy(@request_for_comment).mark_as_solved? && !@request_for_comment.solved?
3534
= render('mark_as_solved')

0 commit comments

Comments
 (0)