Premise
- ActiveAdmin main unit has been installed (rails generate).
procedure
Create a Rails model.
rails generate model book title:string author:string
Make data.
rake db:migrate
Create resources for ActiveAdmin.
rails generate active_admin:resource book
Start the Rails server.
rails server
And when trying to register new data from a browser (http: // localhost: 3000 / admin / books / new). . .
Exception occurred!
ActiveModel :: ForbiddenAttributesError in Admin :: BooksController # create
I can not create.
Solution
After that, specify permit_params in the resource file of ActiveAdmin! only this.
ActiveAdmin.register Book do permit_params :title, :author end
Original by
About
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。