Is it possible to use a scope as source for association?
class User < AR
scope :active_users, where('status = 4')
...
# form
<%= f.association :active_users %>
...
Is it possible to use a scope as source for association?
class User < AR
scope :active_users, where('status = 4')
...
# form
<%= f.association :active_users %>
...
Sorry, I don't think that will work. A scope returns an ActiveRecord::Relation and simple_form is looking for a symbol that represents an existing ActiveRecord::Association (E.g. has_many, belongs_to).
https://github.com/plataformatec/simple_form#associations
You can use collection for source
in controller
@active_users = User.active_users
in view
<%= f.association :active_user, collection: @active_users %>