I am currently creating an association as follows:
show do h3 project.title panel "Utilisateurs" do table_for project.roles do column "Prenom" do |role| role.user.firstname end column "Nom" do |role| role.user.lastname end column "email" do |role| role.user.email end column "Role" do |role| role.role_name.name end end end end
I have the following associations:
Project
has_many :roles, :dependent => :destroy has_many :users, :through => :role
User
has_many :roles, :dependent => :destroy has_many :projects, :through => :role
Role
belongs_to :user belongs_to :project belongs_to :role_name
Rolename
has_many :roles
When I try to destroy user associations through my form, nothing happens, any idea to solve this? Or add a delete link to my show block?
Awea
source share