user_instance = User.find(1)
@pic = Picture.where(:album_id => :album, :culture_id =>
user_instance.culture_id).
first


ya, it work but it return nil.. and i cannot take value from Picture model
it causes me undefined method image when i call @pic.image




On Tue, Jun 14, 2011 at 11:19 AM, Tim Shaffer <[email protected]> wrote:

> The problem is that you're using "User.culture_id"
>
> The class User doesn't have a method called "culture_id"
>
> You probably want to use a user instance instead of the class:
>
> user_instance = User.find(1)
> Picture.where(:album_id => :album, :culture_id =>
> user_instance.culture_id).first
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-talk/-/OR8oidO5TWwJ.
>
> 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.
>

-- 
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