Hi, I''m definitely a newbie on rails here. My very first attempt has gone well up until this point, but for some reason, when I try to do a render partial, I''m getting a full screen refresh. I did a render partial just fine from an rhtml file. This problem is specifically when calling render :partial => "my_partial" from the controller''s .rb code. It''s just really one line that is not doing what it''s supposed to... render :partial => "my_partial_file" It is indeed finding the file (_my_partial_file.rhtml) and rendering it, but it is not doing it as a partial. It is refreshing the screen and rendering this partial file without any of the original page goodies. thanks, jp P.S. A friend of mine is trying to get me to use the scriptaculous visual_effect stuff to do this, and I probably will, but first I would like to understand what''s going on with a simple render :partial. -- Posted via http://www.ruby-forum.com/.
Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060717/acf5dce5/PGP.bin
Alan Francis
2006-Jul-17 09:34 UTC
[Rails] Re: trouble with render :partial from controller
Jeff Pritchard wrote:> Hi, > I''m definitely a newbie on rails here. My very first attempt has gone > well up until this point, but for some reason, when I try to do a render > partial, I''m getting a full screen refresh. > > I did a render partial just fine from an rhtml file. This problem is > specifically when calling render :partial => "my_partial" from the > controller''s .rb code. It''s just really one line that is not doing what > it''s supposed to... > > render :partial => "my_partial_file"If you render a partial directly from an action, and that action has *not* been called via Ajax, the partial is all you''ll get. If you''re trying to update just a portion of the screen, that action would need to be called via ajax, and told which div to replace/update etc. Are you invoking the action via Ajax (link_to_remote, etc) Alan -- Posted via http://www.ruby-forum.com/.
Jeff Pritchard
2006-Jul-17 15:04 UTC
[Rails] Re: trouble with render :partial from controller
Alan Francis wrote:> If you render a partial directly from an action, and that action has > *not* been called via Ajax, the partial is all you''ll get. > > If you''re trying to update just a portion of the screen, that action > would need to be called via ajax, and told which div to replace/update > etc. > > Are you invoking the action via Ajax (link_to_remote, etc) > > AlanAlan, thanks, that did the trick! jp -- Posted via http://www.ruby-forum.com/.