I''m an RJS newbie. I just did the tutorial at http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates, and then used wget to look at the output the RJS template generates. This is what I got: try { new Insertion.Bottom("list", "<li>Fox</li>"); new Effect.Highlight("list",{duration:1}); Element.update("header", "RJS Template Test Complete"); } catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert(''new Insertion.Bottom(\"list\", \"<li>Fox</li>\");\nnew Effect.Highlight(\"list\",{duration:1}) ;\nElement.update(\"header\", \"RJS Template Test Complete\");''); throw e } It looks to me like the exception handling logic sent in the response causes too much bloat. I think it''s better to send only the "meat": new Insertion.Bottom("list", "<li>Fox</li>"); new Effect.Highlight("list",{duration:1}); Element.update("header", "RJS Template Test Complete"); Thoughts? -- Posted via http://www.ruby-forum.com/.
On 3/31/06, Yariv Sadan <yariv@pando.com> wrote:> I''m an RJS newbie. I just did the tutorial at > http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates, and > then used wget to look at the output the RJS template generates. This is > what I got: > > try { > new Insertion.Bottom("list", "<li>Fox</li>"); > new Effect.Highlight("list",{duration:1}); > Element.update("header", "RJS Template Test Complete"); > } catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert(''new > Insertion.Bottom(\"list\", \"<li>Fox</li>\");\nnew > Effect.Highlight(\"list\",{duration:1}) > ;\nElement.update(\"header\", \"RJS Template Test Complete\");''); throw > e } > > > It looks to me like the exception handling logic sent in the response > causes too much bloat. I think it''s better to send only the "meat": > > new Insertion.Bottom("list", "<li>Fox</li>"); > new Effect.Highlight("list",{duration:1}); > Element.update("header", "RJS Template Test Complete"); > > Thoughts? >Hi. This behavior only exists (by default) in development. Look at your config/environments/development.rb file and you should see a setting for RJS debug. This will help you during development but it shouldn''t show up on production. -- Chad Fowler http://chadfowler.com http://pragmaticprogrammer.com/titles/fr_rr/ (Rails Recipes - In Beta!) http://pragmaticprogrammer.com/titles/mjwti/ (My Job Went to India, and All I Got Was This Lousy Book) http://rubycentral.org http://rubygarden.org http://rubygems.rubyforge.org (over one million gems served!)
> Hi. This behavior only exists (by default) in development. Look at > your config/environments/development.rb file and you should see a > setting for RJS debug. This will help you during development but it > shouldn''t show up on production.Excellent! I knew you guys have probably thought of this :) Keep up the great work! Yariv -- Posted via http://www.ruby-forum.com/.
On 3/31/06, Yariv Sadan <yariv@pando.com> wrote:> > Hi. This behavior only exists (by default) in development. Look at > > your config/environments/development.rb file and you should see a > > setting for RJS debug. This will help you during development but it > > shouldn''t show up on production. > > Excellent! I knew you guys have probably thought of this :) Keep up the > great work!Well, I can''t personally claim to have thought of anything other than asking Sam Stephenson recently about the best ways to debug RJS, which is when he told me about this feature :) -- Chad Fowler http://chadfowler.com http://pragmaticprogrammer.com/titles/fr_rr/ (Rails Recipes - In Beta!) http://pragmaticprogrammer.com/titles/mjwti/ (My Job Went to India, and All I Got Was This Lousy Book) http://rubycentral.org http://rubygarden.org http://rubygems.rubyforge.org (over one million gems served!)