change this
render :partial =>'sth',:object => @sth

to this , and call the array in the controller like this @sths
then create a partial with the singular , _sth.html.erb

 render :partial =>@sths


i always do it that way and works perfectly


On Mon, Sep 13, 2010 at 10:23 AM, Zhuhao Wang <[email protected]> wrote:

> radhames brito wrote:
> > What was the problem? how did you solve it?
>
> render :partial =>'sth',:object => @sth
>
> is not working in rails 3,it pass the first element of the array
> @sth(I'm not sure what would happen if @sth is not an array),thus you
> can't call each in the template.You have to use :locals =>{:sth
> =>@sth}.Seems a little complicated,is it a bug or some change not
> mentioned in the changelog?
>
> Before I realize this I changed the view a little,added <%= Tutor.each
> .....%>,and got that text.
> --
> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[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