LoginSignup
0
0

More than 3 years have passed since last update.

ActiveadminでCommentモデルを生成するとエラーが出る

Posted at

はじめに

バージョン
ruby 2.7.2
Rails 6.1.1

Activeadminでcommentモデルを生成するとエラーが起こる

管理者画面にCommentモデルを追加するため以下を実行する

ターミナル
$ rails g active_admin:resource Comment

ファイルの作成は生成は問題なくできるものの、管理者画面を起動するとエラーが出てしまう
どうやらCommentというネーミングが悪さをしてバグを吐いているらしい...
そのため生成したファイルに以下のような記述を行い、ネーミングを変更する

app/admin/comments.rb
ActiveAdmin.register Comment, :as => "ReviewComment" do

end

ReviewCommentとしているが各々好きな名前をつけましょう!

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0