Skip to content

Commit

Permalink
Fix: quotes are not displayed when not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
lef237 committed Mar 6, 2024
1 parent cce2566 commit e3bb2b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/quotes/coquote_users.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"
div.text-center.py-6
= link_to '戻る', :back, class: "bg-gray-600 text-white font-semibold px-4 py-2 rounded hover:bg-gray-700 mr-4"
= link_to "編集する", edit_quote_path(@quote), class: "bg-gray-600 text-white font-semibold px-4 py-2 rounded hover:bg-gray-700" if current_user && @quote.user_id == current_user.id || current_user.admin?
= link_to "編集する", edit_quote_path(@quote), class: "bg-gray-600 text-white font-semibold px-4 py-2 rounded hover:bg-gray-700" if current_user && (@quote.user_id == current_user.id || current_user.admin?)
h2.text-2xl.font-semibold.text-center.py-6
| 引用したユーザーの一覧
div.flex.justify-center
Expand Down
2 changes: 1 addition & 1 deletion app/views/quotes/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ h1.text-3xl.font-bold.text-gray-700.mb-8.text-center 引用ページ

br/

- if @quote.user == current_user || current_user.admin?
- if current_user && (@quote.user == current_user || current_user.admin?)
div.flex.items-center.justify-center.space-x-4
= link_to "編集する", edit_quote_path(@quote), class: "bg-gray-600 text-white font-semibold text-sm px-3 py-1 rounded hover:bg-gray-700"
= button_to "削除する", @quote, method: :delete, form: { data: { turbo: true, turbo_confirm: "削除してよろしいですか?" }, class: "bg-gray-600 text-white font-semibold text-sm px-3 py-1 rounded hover:bg-gray-700" }
Expand Down

0 comments on commit e3bb2b3

Please sign in to comment.