ruby script/generate controller Tools::Search - ok in views/layouts/application.rhtml: <%= render_component :controller => ''tools/search'', :action => ''searchbox'', :params => {:context => ''header-section''} %> in views/tools/search/searchbox.rhtml: any valid erb/html In the end I get back a blank page. If I deliberatly induce an error in erb in searchbox.rhtml, then that error is displayed along with whatever there is in application.rhtml. However, if the template is valid, only a blank page is displayed. What am I doing wrong? Thank you
On Thursday, June 22, 2006, at 2:48 PM, Dmitrii Dimandt wrote:>ruby script/generate controller Tools::Search - ok > >in views/layouts/application.rhtml: > > <%= render_component :controller => ''tools/search'', > :action => ''searchbox'', > :params => {:context => >''header-section''} > %> > > >in views/tools/search/searchbox.rhtml: > > any valid erb/html > > >In the end I get back a blank page. If I deliberatly induce an error >in erb in searchbox.rhtml, then that error is displayed along with >whatever there is in application.rhtml. However, if the template is >valid, only a blank page is displayed. > >What am I doing wrong? > >Thank you >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/railsAre you sure you want to be using ''render_component''? _Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
On 22 Jun 2006 11:57:53 -0000, Kevin Olbrich <devlists-rubyonrails@devlists.com> wrote:> > On Thursday, June 22, 2006, at 2:48 PM, Dmitrii Dimandt wrote: > >ruby script/generate controller Tools::Search - ok > > > >in views/layouts/application.rhtml: > > > > <%= render_component :controller => ''tools/search'', > > :action => ''searchbox'', > > :params => {:context => > >''header-section''} > > %> > > > > > >in views/tools/search/searchbox.rhtml: > > > > any valid erb/html > > > > > >In the end I get back a blank page. If I deliberatly induce an error > >in erb in searchbox.rhtml, then that error is displayed along with > >whatever there is in application.rhtml. However, if the template is > >valid, only a blank page is displayed. > > > >What am I doing wrong? > > > >Thank you > > Are you sure you want to be using ''render_component''?I''m not sure, actually :) What should I use, though, to display various elements/actions on the page?
On Thursday, June 22, 2006, at 3:07 PM, Dmitrii Dimandt wrote:>On 22 Jun 2006 11:57:53 -0000, Kevin Olbrich ><devlists-rubyonrails@devlists.com> wrote: >> >> On Thursday, June 22, 2006, at 2:48 PM, Dmitrii Dimandt wrote: >> >ruby script/generate controller Tools::Search - ok >> > >> >in views/layouts/application.rhtml: >> > >> > <%= render_component :controller => ''tools/search'', >> > :action => ''searchbox'', >> > :params => {:context => >> >''header-section''} >> > %> >> > >> > >> >in views/tools/search/searchbox.rhtml: >> > >> > any valid erb/html >> > >> > >> >In the end I get back a blank page. If I deliberatly induce an error >> >in erb in searchbox.rhtml, then that error is displayed along with >> >whatever there is in application.rhtml. However, if the template is >> >valid, only a blank page is displayed. >> > >> >What am I doing wrong? >> > >> >Thank you >> >> Are you sure you want to be using ''render_component''? > >I''m not sure, actually :) What should I use, though, to display >various elements/actions on the page? >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/railsAssuming they are just partials, you would probably just use render :partial=>''partial'' I''m also assuming you have a ''yield'' or ''content_for_layout'' in there somewhere.. _Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
> >> Are you sure you want to be using ''render_component''? > > > >I''m not sure, actually :) What should I use, though, to display > >various elements/actions on the page? > >_______________________________________________ > >Rails mailing list > >Rails@lists.rubyonrails.org > >http://lists.rubyonrails.org/mailman/listinfo/rails > > Assuming they are just partials, you would probably just use > > render :partial=>''partial'' > > I''m also assuming you have a ''yield'' or ''content_for_layout'' in there > somewhere..Well... It''s not exactly what I want. The header may and will change according to variuos parameters. Also other parts of the page will look different depending on the context. And since there is only one ''yield'' to cover it all, I decided to try ''render_component''. I have a ''yield'' in application.rhtml though I''m not rendering any actual content yet. I''m trying to get a feel of how various page parts could be rendered through Rails. And I would really hate to pollute application.rhtml with a multitude of render :partial''s in a ton of if''s and unless''s :)
> > >> Are you sure you want to be using ''render_component''? > > > > > >I''m not sure, actually :) What should I use, though, to display > > >various elements/actions on the page? > > >_______________________________________________ > > >Rails mailing list > > >Rails@lists.rubyonrails.org > > >http://lists.rubyonrails.org/mailman/listinfo/rails > > > > Assuming they are just partials, you would probably just use > > > > render :partial=>''partial'' > > > > I''m also assuming you have a ''yield'' or ''content_for_layout'' in there > > somewhere.. > > Well... It''s not exactly what I want. The header may and will change > according to variuos parameters. Also other parts of the page will > look different depending on the context. And since there is only one > ''yield'' to cover it all, I decided to try ''render_component''. I have a > ''yield'' in application.rhtml though I''m not rendering any actual > content yet. I''m trying to get a feel of how various page parts could > be rendered through Rails. > > And I would really hate to pollute application.rhtml with a multitude > of render :partial''s in a ton of if''s and unless''s :) >Switched to partials. So far so good :)