[Rails] Re: render :partial => @object

2009-09-20 Thread Conrad Taylor
Hi, if you're using Rails 2.1.0 or earlier, you'll need to use the following syntax: a) render :partial => partial_name, :collection => @collections Note: The above requires the partial, _partial_name.html.erb. b) render :partial => partial_name, :object => @object Note: The above

[Rails] Re: render :partial => @object

2009-09-20 Thread Chris Habgood
2.1.0 On Sun, Sep 20, 2009 at 4:00 PM, Conrad Taylor wrote: > Hi, what version of Rails is being defined within the environment.rb file? > > -Conrad > > On Sun, Sep 20, 2009 at 10:27 AM, Eric wrote: > >> >> Is there something I'm not getting here? The short form should be >> either >> >> render

[Rails] Re: render :partial => @object

2009-09-20 Thread Conrad Taylor
Hi, what version of Rails is being defined within the environment.rb file? -Conrad On Sun, Sep 20, 2009 at 10:27 AM, Eric wrote: > > Is there something I'm not getting here? The short form should be > either > > render :partial => @foo > > -or- > > render @foo > > I've never seen "render :parti

[Rails] Re: render :partial => @object

2009-09-20 Thread Colin Law
2009/9/20 Eric : > > Is there something I'm not getting here? The short form should be > either > > render :partial => @foo > > -or- > > render @foo > > I've never seen "render :partial @foo" OP you have changed it to <%=render :partial=>@styles %> as pointed out by Wang Pengcheng? Colin > > -e

[Rails] Re: render :partial => @object

2009-09-20 Thread Eric
Is there something I'm not getting here? The short form should be either render :partial => @foo -or- render @foo I've never seen "render :partial @foo" -eric On Sep 19, 9:44 pm, Me wrote: > Running rails  2.1.0 when I do this: > > <%= render :partial => 'style', :collection => @styles %>

[Rails] Re: render :partial => @object

2009-09-20 Thread Colin Law
2009/9/20 Chris Habgood : > 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?

[Rails] Re: render :partial => @object

2009-09-20 Thread Chris Habgood
Everything is in the styles views directory. rails 2.1.0. I am very confused as this sytnax is supposed to be supported by rails > 2.0. I even tried it in 2.3.2 and the same thing. I watched ryan bates railscasts about 4 times and I still do not know why it is not working. This works fine: <%

[Rails] Re: render :partial => @object

2009-09-20 Thread Colin Law
2009/9/20 Chris Habgood : > ya that is what I have. > > On Sun, Sep 20, 2009 at 3:56 AM, Wang Pengcheng 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 >>> >>> renders nothing. Y

[Rails] Re: render :partial => @object

2009-09-20 Thread Chris Habgood
Ya if I change it to the normal :collection style syntax it works fine. On Sun, Sep 20, 2009 at 11:08 AM, Colin Law wrote: > > 2009/9/20 Chris Habgood : > > ya that is what I have. > > > > On Sun, Sep 20, 2009 at 3:56 AM, Wang Pengcheng > wrote: > >> > >> <%=render :partial=>@styles %> > >> the

[Rails] Re: render :partial => @object

2009-09-20 Thread Chris Habgood
ya that is what I have. On Sun, Sep 20, 2009 at 3:56 AM, Wang Pengcheng 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 > >> >> renders nothing. >> >> On Sep 20, 12:13 am, Wang Pengcheng

[Rails] Re: render :partial => @object

2009-09-20 Thread Wang Pengcheng
<%=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 > > renders nothing. > > On Sep 20, 12:13 am, Wang Pengcheng wrote: > > Add a comma or not? > > <%=render :partial, @styles %> > > > > 2009/9/20 Me > > > > >

[Rails] Re: render :partial => @object

2009-09-19 Thread Me
renders nothing. On Sep 20, 12:13 am, Wang Pengcheng wrote: > Add a comma or not? > <%=render :partial, @styles %> > > 2009/9/20 Me > > > > > > > Running rails  2.1.0 when I do this: > > > <%= render :partial => 'style', :collection => @styles %> > > > I get the collection fine in my index file

[Rails] Re: render :partial => @object

2009-09-19 Thread Wang Pengcheng
Add a comma or not? <%=render :partial, @styles %> 2009/9/20 Me > > 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 erro