Hello, I have a <div> tag that is in my layout (layouts/application.rhtml). It cant be pulled out into the view the way the site is designed. What i want to do is later when i render the view and get some data, is to then populate one of the <divs> that is in the application.rhtml file. is it possible to render a partial and place it inside a <div> target ? thanks adam
On 9/27/05, Adam Denenberg <adam-fpx97dFL/ODYtjvyW6yDsg@public.gmane.org> wrote:> I have a <div> tag that is in my layout (layouts/application.rhtml). > It cant be pulled out into the view the way the site is designed. What > i want to do is later when i render the view and get some data, is to > then populate one of the <divs> that is in the application.rhtml file. > is it possible to render a partial and place it inside a <div> target ?I think you might want to look at ''content_for''. See the API docs at http://api.rubyonrails.com/classes/ActionView/Helpers/CaptureHelper.html for information. That way you could have, something like, @content_for_div in your application.rhtml. Not sure, not used it so far myself, but it might help you out. Matt
On 27-sep-2005, at 15:45, Adam Denenberg wrote:> Hello, > > I have a <div> tag that is in my layout (layouts/ > application.rhtml). It cant be pulled out into the view the way the > site is designed. What i want to do is later when i render the > view and get some data, is to then populate one of the <divs> that > is in the application.rhtml file. is it possible to render a > partial and place it inside a <div> target ?try the following <% content_for ''something'' %> <% render_partial ''bla'' %> <% end %> You can also try it inline, as in class MyController < ApplicationController def render_into(area) render :inline=><<the code above quoted>> end end and then in layout @content_for_something in your div -- Julian "Julik" Tarkhanov
I have few lengthly processes in my application, and I''m getting fastcgi timeout after 30 seconds. From apache log: FastCGI: comm with (dynamic) server "D:/projects/MojAlbum/public/dispatch.fcgi" aborted: (first read) idle timeout (30 sec), referer: http://mojalbum.4dva.hr/albumi/moji I tried to set timeout in apache conf by: <IfModule> FastCgiConfig -killInterval 900 -idle-timeout 900 AddHandler fastcgi-script .fcgi </IfModule> but nothing changes. What I,m missing? Where could I set fastcgi timeout to be a little longer? Thanks, Igor
Hi Julian,> try the following > > <% content_for ''something'' %> > <% render_partial ''bla'' %> > <% end %>Wouldn''t that render call need to be: <%= render :partial => ''bla'' %> Clarification not for the upgraded render method but for the = to actually output the result...?
I''m doing something similar [I think] in my app also ... In my case, the action populates a @breadcrumbs var which is rendered by a partial in the application.rhtml. So maybe I missed the point, but have you tried simply the following in your application.rhtml <div> <%= render :partial => ''mypartial'' %> </div>>From a rails point of processing order, I think the action is processedfirst, so all the state is available to the template, partials, and view. Neville -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Adam Denenberg Sent: Tuesday, 27 September 2005 11:46 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails] render partial to a <div> Hello, I have a <div> tag that is in my layout (layouts/application.rhtml). It cant be pulled out into the view the way the site is designed. What i want to do is later when i render the view and get some data, is to then populate one of the <divs> that is in the application.rhtml file. is it possible to render a partial and place it inside a <div> target ? thanks adam _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 27-sep-2005, at 20:06, Seth Rasmussen wrote:> Hi Julian, > > >> try the following >> >> <% content_for ''something'' %> >> <% render_partial ''bla'' %> >> <% end %> >> > > Wouldn''t that render call need to be: > > <%= render :partial => ''bla'' %> > > Clarification not for the upgraded render method but for the = to > actually output the result...?Not sure (I found IRB to be a little tricky) but can likely be so (that you need to echo, not return) -- Julian "Julik" Tarkhanov