Ankur wrote:
> Hi !
> 
> According to your relationships:  resource :has_many => roles
> but you are using pro.roles. It means project should has many
> roles.Its totally wrong accordingly.
> 
> 
> First fetch all project_resources for a particular project. Eg.
> 
> pr_resources = Project.find(1).project_resources
> 
> pr_resources will be a array of pr_resources
> 
> Now you can fetch any employee(resource) and its role associated with
> project id 1.
> 
> for eg. for any project_resource:
> 
>    resource = pr_resource.resource
>    role = pr_resource.role
> 
> 
> Thanks,
> 
> 
> --
> ~ Ankur Gupta
>   Company: www.innozon.com, Hyderabad

I made already an update of the project.rb, because I found out that the 
rule was missing. That's why it worked for ressources but not for 
projects.
Thx a lot for your explanation, I'm still in the learning process of RoR 
:-) This is now all clear to me.
-- 
Posted via http://www.ruby-forum.com/.
-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to