I''ve seen a couple of commits lately re: RJS templates. Where can I find more info on what these are? Google came up empty :( >> Make rjs templates always implicitly skip out on layouts. Thanks! _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Fri, Nov 18, 2005 at 01:17:17PM -0500, David Teare wrote:> I''ve seen a couple of commits lately re: RJS templates. Where can I find > more info on what these are? Google came up empty :( > >> Make rjs templates always implicitly skip out on layouts.Hi David, We''re going to be pushing out a demo video soon. Sit tight. Until then, read the rdoc and source! marcel -- Marcel Molina Jr. <marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org>
On 18-nov-2005, at 19:25, Marcel Molina Jr. wrote:> On Fri, Nov 18, 2005 at 01:17:17PM -0500, David Teare wrote: >> I''ve seen a couple of commits lately re: RJS templates. Where >> can I find >> more info on what these are? Google came up empty :( >>>> Make rjs templates always implicitly skip out on layouts. > > Hi David, > > We''re going to be pushing out a demo video soon. Sit tight. Until > then, read > the rdoc and source!wow http://dev.rubyonrails.org/changeset/3078 wicked cool
> wow > http://dev.rubyonrails.org/changeset/3078 > wicked coolHere''s a live example: http://techno-weenie.net/svn/projects/rails_help/app/views/questions/create.rjs I''ll be moving the app to postgres later today so you can actually see it in action. -- rick http://techno-weenie.net
Julian ''Julik'' Tarkhanov wrote:> > On 18-nov-2005, at 19:25, Marcel Molina Jr. wrote: > >> On Fri, Nov 18, 2005 at 01:17:17PM -0500, David Teare wrote: >> >>> I''ve seen a couple of commits lately re: RJS templates. Where >>> can I find >>> more info on what these are? Google came up empty :( >>> >>>>> Make rjs templates always implicitly skip out on layouts. >> >> >> Hi David, >> >> We''re going to be pushing out a demo video soon. Sit tight. Until >> then, read >> the rdoc and source! > > > wow > http://dev.rubyonrails.org/changeset/3078 > wicked coolOoo-er. I think my knees just went a bit wobbly. -- Alex
First of all, wow! Second, I got a small demo running using Rick''s example .rjs file and the rdocs, but I have a quick question. The docs say ''When an .rjs action is called with +link_to_remote+, the generated JavaScript is automatically evaluated.'' However, I wasn''t able to get the scripts to run in the browser without adding :complete => ''eval(request.responseText)'' to my link_to_remote call, as Rick does in his view: http://techno-weenie.net/svn/projects/rails_help/app/views/questions/show.rhtml Is this the correct behaviour? Thanks, Cody On 11/18/05, Alex Young <alex-qV/boFbD8Meu8LGVeLuP/g@public.gmane.org> wrote:> Julian ''Julik'' Tarkhanov wrote: > > > > On 18-nov-2005, at 19:25, Marcel Molina Jr. wrote: > > > >> On Fri, Nov 18, 2005 at 01:17:17PM -0500, David Teare wrote: > >> > >>> I''ve seen a couple of commits lately re: RJS templates. Where > >>> can I find > >>> more info on what these are? Google came up empty :( > >>> > >>>>> Make rjs templates always implicitly skip out on layouts. > >> > >> > >> Hi David, > >> > >> We''re going to be pushing out a demo video soon. Sit tight. Until > >> then, read > >> the rdoc and source! > > > > > > wow > > http://dev.rubyonrails.org/changeset/3078 > > wicked cool > > Ooo-er. I think my knees just went a bit wobbly. > > -- > Alex > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Fri, Nov 18, 2005 at 06:22:17PM -0500, Cody Fauser wrote:> the rdocs, but I have a quick question. The docs say ''When an .rjs > action is called with +link_to_remote+, the generated JavaScript is > automatically evaluated.'' However, I wasn''t able to get the scripts > to run in the browser without adding :complete => > ''eval(request.responseText)'' to my link_to_remote call, as Rick does > in his view: > http://techno-weenie.net/svn/projects/rails_help/app/views/questions/show.rhtmlThis is true, but you need the latest version of prototype.js. If you are running on edge rails just do svn up rake update_javascripts marcel -- Marcel Molina Jr. <marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org>
What about RCSS templates? :) I have dynamic stylesheets going on at the moment, and have noticed that Basecamp even has this going on in the background. Would be cool to see, in addition to the new JS type to the template schema. Warmest regards, Nathan. -------------------------------------------------------------- Nathaniel S. H. Brown Toll Free 1.877.4.INIMIT Inimit Innovations Phone 604.724.6624 www.inimit.com Fax 604.444.9942> -----Original Message----- > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of > Marcel Molina Jr. > Sent: November 18, 2005 3:30 PM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: Re: [Rails] RJS Templates? > > On Fri, Nov 18, 2005 at 06:22:17PM -0500, Cody Fauser wrote: > > the rdocs, but I have a quick question. The docs say ''When an .rjs > > action is called with +link_to_remote+, the generated JavaScript is > > automatically evaluated.'' However, I wasn''t able to get > the scripts > > to run in the browser without adding :complete => > > ''eval(request.responseText)'' to my link_to_remote call, as > Rick does > > in his view: > > > http://techno-weenie.net/svn/projects/rails_help/app/views/questions/s > > how.rhtml > > This is true, but you need the latest version of > prototype.js. If you are running on edge rails just do > > svn up > rake update_javascripts > > marcel > -- > Marcel Molina Jr. <marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org> > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Here''s something strange. I have two machines, the first is Windows running WEBrick, and the eval(request.responseText) is needed otherwise nothing shows up. My other machine, running the same code deployed with Switchtower, and running Debian with lighttpd, doesn''t need the eval() call, and if I leave it in, my generated script runs twice. RJS is very cool. I''m just at the point in my app where I need this functionality, and I''d just started building this all by hand: var foo = $(''foo''); var bar = document.createElement(''div''); foo.innerHTML = ..... Boy, am I glad RJS came along! -----Original Message----- From: Marcel Molina Jr. [mailto:marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org] Sent: Friday, November 18, 2005 3:30 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails] RJS Templates? On Fri, Nov 18, 2005 at 06:22:17PM -0500, Cody Fauser wrote:> the rdocs, but I have a quick question. The docs say ''When an .rjs > action is called with +link_to_remote+, the generated JavaScript is > automatically evaluated.'' However, I wasn''t able to get the scripts > to run in the browser without adding :complete => > ''eval(request.responseText)'' to my link_to_remote call, as Rick does > in his view: >http://techno-weenie.net/svn/projects/rails_help/app/views/questions/sho w.rhtml This is true, but you need the latest version of prototype.js. If you are running on edge rails just do svn up rake update_javascripts marcel -- Marcel Molina Jr. <marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org> _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi, On 11/18/05, Tom Fakes <Tom-SpgrXpdGZSiNACpsiTyfug@public.gmane.org> wrote:> Here''s something strange. I have two machines, the first is Windows > running WEBrick, and the eval(request.responseText) is needed otherwise > nothing shows up. > > My other machine, running the same code deployed with Switchtower, and > running Debian with lighttpd, doesn''t need the eval() call, and if I > leave it in, my generated script runs twice.Make sure prototype.js is the latest version (rake update_javascripts) and clear your browser''s cache. Sam
On Fri, Nov 18, 2005 at 06:31:43PM -0800, Tom Fakes wrote:> Here''s something strange. I have two machines, the first is Windows > running WEBrick, and the eval(request.responseText) is needed otherwise > nothing shows up. > > My other machine, running the same code deployed with Switchtower, and > running Debian with lighttpd, doesn''t need the eval() call, and if I > leave it in, my generated script runs twice.Are you sure you are running the same version of prototype? Only prototype in trunk eval''s automatically. marcel -- Marcel Molina Jr. <marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org>
It''s the same code. I run WEBrick on my Windows machine (where it''s broken), commit the code to subversion, use switchtower to get the code on my linux machine and it works - in the same browser with a clean cache. The trunk version and mine are the same: 1.4.0_rc3. Not a big deal for me right now, but I''ll spend some time tracking down what''s causing it on Monday. -----Original Message----- From: Marcel Molina Jr. [mailto:marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org] Sent: Friday, November 18, 2005 7:15 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails] RJS Templates? On Fri, Nov 18, 2005 at 06:31:43PM -0800, Tom Fakes wrote:> Here''s something strange. I have two machines, the first is Windows > running WEBrick, and the eval(request.responseText) is neededotherwise> nothing shows up. > > My other machine, running the same code deployed with Switchtower, and > running Debian with lighttpd, doesn''t need the eval() call, and if I > leave it in, my generated script runs twice.Are you sure you are running the same version of prototype? Only prototype in trunk eval''s automatically. marcel -- Marcel Molina Jr. <marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org> _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Aha! Found it! On my Windows machine, under WEBRick, the Content-type header is ''text/javascript; charset=UTF-8''. The prototype code is looking for exactly ''text/javascript'', and fails to detect the returned javascript. I don''t know who sets the charset part, whether it''s Rails or WEBrick, -----Original Message----- From: Tom Fakes [mailto:Tom-SpgrXpdGZSiNACpsiTyfug@public.gmane.org] Sent: Friday, November 18, 2005 7:49 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails] RJS Templates? It''s the same code. I run WEBrick on my Windows machine (where it''s broken), commit the code to subversion, use switchtower to get the code on my linux machine and it works - in the same browser with a clean cache. The trunk version and mine are the same: 1.4.0_rc3. Not a big deal for me right now, but I''ll spend some time tracking down what''s causing it on Monday. -----Original Message----- From: Marcel Molina Jr. [mailto:marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org] Sent: Friday, November 18, 2005 7:15 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails] RJS Templates? On Fri, Nov 18, 2005 at 06:31:43PM -0800, Tom Fakes wrote:> Here''s something strange. I have two machines, the first is Windows > running WEBrick, and the eval(request.responseText) is neededotherwise> nothing shows up. > > My other machine, running the same code deployed with Switchtower, and > running Debian with lighttpd, doesn''t need the eval() call, and if I > leave it in, my generated script runs twice.Are you sure you are running the same version of prototype? Only prototype in trunk eval''s automatically. marcel -- Marcel Molina Jr. <marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org> _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Tom, On 11/18/05, Tom Fakes <Tom-SpgrXpdGZSiNACpsiTyfug@public.gmane.org> wrote:> Aha! Found it! On my Windows machine, under WEBRick, the Content-type > header is ''text/javascript; charset=UTF-8''. The prototype code is > looking for exactly ''text/javascript'', and fails to detect the returned > javascript. > > I don''t know who sets the charset part, whether it''s Rails or WEBrick,Good catch. I''ve pushed Prototype 1.4.0_rc4 in [3091] which should match the content-type header more liberally. Sam
That fixed it for me. -----Original Message----- From: Sam Stephenson [mailto:sstephenson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org] Sent: Friday, November 18, 2005 11:01 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails] RJS Templates? Tom, On 11/18/05, Tom Fakes <Tom-SpgrXpdGZSiNACpsiTyfug@public.gmane.org> wrote:> Aha! Found it! On my Windows machine, under WEBRick, theContent-type> header is ''text/javascript; charset=UTF-8''. The prototype code is > looking for exactly ''text/javascript'', and fails to detect thereturned> javascript. > > I don''t know who sets the charset part, whether it''s Rails or WEBrick,Good catch. I''ve pushed Prototype 1.4.0_rc4 in [3091] which should match the content-type header more liberally. Sam _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails