Hi, i have stuck how to make this more dynamic that is why i use ".first" to get the 1st user. cuz i can print the picture with the first user in the record... but i cannot display some other user(user2, user3 ... ) @user=picture.all( :joins => :culture, :conditions => (Album.joins(:description))).first i want to make @user.image ( display image with all users)'' Can you give me some advice.. thank you so much -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
rails version? convert your query to scope or named_scope in your model, then you can chain conditions etc t On Jun 12, 2011, at 16:46 , joanne wrote:> Hi, i have stuck how to make this more dynamic that is why i use > ".first" to get the 1st user. > > cuz i can print the picture with the first user in the record... > but i cannot display some other user(user2, user3 ... ) > > @user=picture.all( > :joins => :culture, > :conditions => (Album.joins(:description))).first > > i want to make @user.image ( display image with all users)'' > > > Can you give me some advice.. > > > thank you so much > > -- > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- ==============================================================================Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz ============================================================================== -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sun, Jun 12, 2011 at 10:46 PM, joanne <joanne0558-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, i have stuck how to make this more dynamic that is why i use > ".first" to get the 1st user. > > cuz i can print the picture with the first user in the record... > but i cannot display some other user(user2, user3 ... ) > > @user=picture.all( > :joins => :culture, > :conditions => (Album.joins(:description))).first > >i think you posted a different post before this one but you''re referring to the same problem. you should have just bumped your previous post. Anyway, I suggest you work with the simplest scenario first. Remove all the joins and conditions you have in your query. Try posting the images for all pictures first. @pictures = Picture.all in your view <% @pictures.each do |picture| %> <%= image_tag picture.method_that_will_return_the_url_of_the_image %> <% end %> Do this first and work on how to filter them next.> i want to make @user.image ( display image with all users)'' > > > Can you give me some advice.. > > > thank you so much > > -- > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.