I have two tables Project and Users, which have many-to-many
relationship.
I am displaying list of projects with option to edit members of
projects.
Currently I am able to support only adding existing users to project.
But I want to add support for 'adding new users' as a link when
displaying each project.
config.action_links.add 'create', :label => 'Create A New
User',:parameters =>{:controller=>'user'},:page=>true
But upon clicking this link, project_id for which link was clicked is
passed as constraint. Since user does not have any project_id column,
I get following error
Malformed constraint `Userr#project_id'. If it's a legitimate column,
and you are using a nested scaffold, please specify or double-check
the reverse association name.
Here is my Model
class User < ActiveRecord::Base
has_many :join_user_project,
:foreign_key => 'user_id'
has_many :projects,
:through => :join_user_project
end
class Page < ActiveRecord::Base
has_many :join_user_project,
:foreign_key => 'project_id'
has_many :users,
:through => :join_user_project
end
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.