On Sun, Mar 13, 2011 at 4:42 AM, Erwin <yves_duf...@mac.com> wrote:

> In the controller , I am passing an Array as a collection
>  @objects = ["item1", "item2", "item3", "item4"]
>
>
> in the view I wrote
> %table#objects
>    = render :partial => 'object',  :collection => @objects
>
> and in my partial  _object.html
> = content_tag_for(:tr, @object) do
>        %td= @object
>        %td= link_to........
>
>

 you are using the partial in the wrong way.

 when you use :collection => @objects

 it will pass each element of the collection into the partial and create
'object' which is created based
on the name of the partial '_name'. the same thing happens with


:partial 'thing', :object => Thing.new

_thing.haml
 = thing # this is the :object, based on the name


also call your partial .haml if it is haml.


-- 
make haste slowly \
festina lente  \
-
mobile  +1_415_632_6001
curtis.schofi...@gmail.com <cur...@robotarmyma.de>
http://robotarmyma.de

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

Reply via email to