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??
Add a comma or not? <%=render :partial, @styles %> 2009/9/20 Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> > 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 --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
renders nothing. On Sep 20, 12:13 am, Wang Pengcheng <wpc0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Add a comma or not? > <%=render :partial, @styles %> > > 2009/9/20 Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > > > 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
<%=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 <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> > renders nothing. > > On Sep 20, 12:13 am, Wang Pengcheng <wpc0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Add a comma or not? > > <%=render :partial, @styles %> > > > > 2009/9/20 Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > > > > > > > > > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ya that is what I have. On Sun, Sep 20, 2009 at 3:56 AM, Wang Pengcheng <wpc0000-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> >> renders nothing. >> >> On Sep 20, 12:13 am, Wang Pengcheng <wpc0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > Add a comma or not? >> > <%=render :partial, @styles %> >> > >> > 2009/9/20 Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> > >> > >> > >> > >> > >> > > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
2009/9/20 Chris Habgood <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> ya that is what I have. > > On Sun, Sep 20, 2009 at 3:56 AM, Wang Pengcheng <wpc0000-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >>> >>> 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 <wpc0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> > Add a comma or not? >>> > <%=render :partial, @styles %> >>> > >>> > 2009/9/20 Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >>> > >>> > >>> > >>> > >>> > >>> > > 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 >> >> >> >> > > > > >
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 <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > 2009/9/20 Chris Habgood <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > ya that is what I have. > > > > On Sun, Sep 20, 2009 at 3:56 AM, Wang Pengcheng <wpc0000-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > 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 <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >>> > >>> 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 <wpc0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>> > Add a comma or not? > >>> > <%=render :partial, @styles %> > >>> > > >>> > 2009/9/20 Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
2009/9/20 Chris Habgood <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> 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 <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> 2009/9/20 Chris Habgood <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> > ya that is what I have. >> > >> > On Sun, Sep 20, 2009 at 3:56 AM, Wang Pengcheng <wpc0000-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> > 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 <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> >>> >> >>> 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 <wpc0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> > Add a comma or not? >> >>> > <%=render :partial, @styles %> >> >>> > >> >>> > 2009/9/20 Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> >>> > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> > > 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 >> >> >> >> >> >> >> >> >> > >> > >> > > >> > >> >> > > > > >
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: <%= render :partial => ''style'', :collection => @styles %> Which is even more bewildering. On Sun, Sep 20, 2009 at 11:41 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > 2009/9/20 Chris Habgood <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > 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 <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > >> > >> 2009/9/20 Chris Habgood <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > >> > ya that is what I have. > >> > > >> > On Sun, Sep 20, 2009 at 3:56 AM, Wang Pengcheng <wpc0000-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> > 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 <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> >>> > >> >>> 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 <wpc0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> >>> > Add a comma or not? > >> >>> > <%=render :partial, @styles %> > >> >>> > > >> >>> > 2009/9/20 Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> >>> > > >> >>> > > >> >>> > > >> >>> > > >> >>> > > >> >>> > > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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??
2009/9/20 Eric <ericghill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > 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> > -eric > > > On Sep 19, 9:44 pm, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> 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?? > > >
Hi, what version of Rails is being defined within the environment.rb file? -Conrad On Sun, Sep 20, 2009 at 10:27 AM, Eric <ericghill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 :partial @foo" > > -eric > > > On Sep 19, 9:44 pm, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > 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?? > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
2.1.0 On Sun, Sep 20, 2009 at 4:00 PM, Conrad Taylor <conradwt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <ericghill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 :partial @foo" >> >> -eric >> >> >> On Sep 19, 9:44 pm, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > 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?? >> >> > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 requires the partial, _partial_name.html.erb. If you''re using Rails 2.2.2 or greater, then you can use the following syntax: a) render :partial => @collections Note: The above uses the partial, _collection.html.erb. b) render :partial => @object Note: The above used the partial, _object.html.erb. Good luck, -Conrad On Sun, Sep 20, 2009 at 2:07 PM, Chris Habgood <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 2.1.0 > > > On Sun, Sep 20, 2009 at 4:00 PM, Conrad Taylor <conradwt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <ericghill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 :partial @foo" >>> >>> -eric >>> >>> >>> On Sep 19, 9:44 pm, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> > 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?? >>> >>> >> >> >> > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---