2009/9/20 Chris Habgood <[email protected]>:
> Ya if I change it to the normal :collection style syntax it works fine.


Ah, I see, I had misunderstood the problem.  Is @styles an array of
Style objects, and are you rendering from the style controller?  Where
is _style.html.erb?

What version of Rails are you using?  I don't know what version that
syntax appeared.  Anyone?

Colin

>
> On Sun, Sep 20, 2009 at 11:08 AM, Colin Law <[email protected]> wrote:
>>
>> 2009/9/20 Chris Habgood <[email protected]>:
>> > ya that is what I have.
>> >
>> > On Sun, Sep 20, 2009 at 3:56 AM, Wang Pengcheng <[email protected]>
>> > wrote:
>> >>
>> >> <%=render :partial=>@styles %>
>> >> the partial html is :
>> >> _style.html.erb
>> >> and the object can be used in the partial erb is style
>> >>
>> >> 2009/9/20 Me <[email protected]>
>> >>>
>> >>> renders nothing.
>>
>> You could use ruby-debug to break into the partial to check it is
>> getting there.  Another thing to do is to check the html produced
>> (view source in browser) to check that it is in fact generating
>> nothing, rather than just nothing that displays.
>>
>> Presumably you have checked that @styles is not empty?
>>
>> Colin
>>
>> >>>
>> >>> On Sep 20, 12:13 am, Wang Pengcheng <[email protected]> wrote:
>> >>> > Add a comma or not?
>> >>> > <%=render :partial, @styles %>
>> >>> >
>> >>> > 2009/9/20 Me <[email protected]>
>> >>> >
>> >>> >
>> >>> >
>> >>> >
>> >>> >
>> >>> > > Running rails  2.1.0 when I do this:
>> >>> >
>> >>> > > <%= render :partial => 'style', :collection => @styles %>
>> >>> >
>> >>> > > I get the collection fine in my index file.  When I try the
>> >>> > > shortcut:
>> >>> >
>> >>> > > <%= render :partial �...@styles %>
>> >>> >
>> >>> > > I get this error:
>> >>> >
>> >>> > > Couldn't find template file for active_record/named_scope/scopes/
>> >>> > > _scope
>> >>> >
>> >>> > > Any ideas??
>> >>> >
>> >>> > --
>> >>> > Code our future
>> >>> > Name   : Wang Pengcheng
>> >>> > Nick     : QJGui
>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> Code our future
>> >> Name   : Wang Pengcheng
>> >> Nick     : QJGui
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>> > >
>> >
>>
>>
>
>
> >
>

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