まず、参照するテーブルのスキーマは次のとおりです
create_table "microposts", :force => true do |t|
t.text "content"
t.integer "user_id"
t.datetime "created_at", :null => false
t.boolean "review", :default => false
管理者がレビュー = true のすべての投稿を表示できるビューを作成し、管理者が個々の投稿を承認または削除できるようにしたいと考えています。
更新 これをユーザーコントローラーに追加しました
class UserController < ApplicationController
def review
@microposts = Micropost.where(review: true)
end
これが私がこれまでに持っているreview.html.erbです
<% provide(:title, 'Review Shares') %>
<% if signed_in? && if current_user.admin? %>
<% @microposts.each do |mpost| %>
<%= link_to "delete", "/micropost/#{mpost.id}", method: :delete,
confirm: "You sure?",
title: mpost.content %>
<% end %>
<% end %>
<% end %>
「レビュー」の値をfalseに変更するオプションを使用して、実際に投稿を表示するにはどうすればよいですか?