Neetesh
Neetesh

Reputation: 71

Rails_admin with has_one issue in rails 5

In rails 5, attr_accessible is removed. So how to use has_one association. Like I have:

class Setter
  include Mongoid::Document

  include Mongoid::Timestamps::Created::Short

  has_one :user
end

and

class user
  include Mongoid::Document

  include Mongoid::Timestamps::Created::Short

  belongs_to :setter
end

Right now I am getting no dropdown box for user field in new setter in rails_admin form. enter image description here

Upvotes: 1

Views: 357

Answers (1)

Rooby Doo
Rooby Doo

Reputation: 176

No need to set attr_accessible in the model anymore.

Rather use strong params.

Upvotes: 0

Related Questions