Try this:
render :partial => 'post', :collection = @posts
or
@posts.each do |post|
  render :partial => 'post', :object => post
end
Which seems to be slightly faster if less elegant.

On Dec 30, 5:26 pm, LeonS <[email protected]> wrote:
> Hi,
>
> i try to understand the rendering of partials as objects.
> So, lets imagine i've got Threads with posts , and i will just render
> the posts of one thread.
> The code to render all posts will seems to be something like that:
> <%= render :partial => @posts %>
>
> But how can i just render the posts of one thread, so i will set a
> parameter with the thread_id
> or something like that. Can i do this with a ;local ? Where can i
> acces the parameter i use to render partial objects?
>
> thanks

--

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