I want dropdown in User sign up form which will set the user role which belongs to a department. Here is are models
class Department < ActiveRecord::Base
has_many :roles
end
class Role < ActiveRecord::Base
belongs_to :department
has_many :users
end
class User < ActiveRecord::Base
belongs_to :roles
end
And in the registration form i am trying this:
=form.grouped_collection_select(:user, :role_id, @departments, :roles, :title, :id,:title)
This produces error undefined method `merge' for :title:Symbol
Department and Role both models contain "title"
I don't know where i am lacking