On Aug 24, 11:17 am, "[email protected]"
<[email protected]> wrote:
> I am trying to do the following
>
> <%= effort.user_id.collect(&:full_name) %>
>
> When I run my app I get the following error: undefined method
> `collect' for 1:Fixnum
>

What is that supposed to do ? user_id is an integer so calling collect
on it doesn't make any sense.

Fred

> From my understanding I believe that this maybe an association error.
> I may be incorrect.
>
> User.rb
>
> class User < ActiveRecord::Base
>  include ActiveModel::Validations
>
>   has_many :roles_users
>   has_many :roles, :through => :roles_users
>   has_many :projects
>   has_many :password_histories
>   has_many :efforts
>
> Efforts.rb
>
> class Effort < ActiveRecord::Base
>   belongs_to :project_task
>   belongs_to :user
> end
>
> Where am i going wrong?

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to