before I started building my latest rails app, I made the decision to make good use of ajax. My reasonsing was that users would benefit from the quicker page updates - the application provides various different types of insurance quotes, and has several multi-page forms and reports that can be drilled down 5 or 6 levels deep in some cases - so it seemed like a good candidate for ajax Now that I''ve started writing the thing, I''m wondering if I''ve made a mistake. I find ajax to be difficult to test and debug, and my views consist pretty much entirely of partials - it''s getting hard to keep track of them all. I''m just wondering how other developers decide if it''s worth going down the ajax route.
Hi Alan, sure, I''m having problem too with my first applications using AJAX but I think it''s a matter of time and experience. In the meanwhile, have a look at the snippet of code Richard White (of AJAX scaffold generator fame) suggests for debugging: http://www.height1percent.com/articles/2006/04/21/improving-debugging-for-ajax-and-rjs Cheers, Marco On 25/04/06, Alan Bullock <liststuff@gmail.com> wrote:> before I started building my latest rails app, I made the decision to make > good use of ajax. My reasonsing was that users would benefit from the > quicker page updates - the application provides various different types of > insurance quotes, and has several multi-page forms and reports that can be > drilled down 5 or 6 levels deep in some cases - so it seemed like a good > candidate for ajax > > Now that I''ve started writing the thing, I''m wondering if I''ve made a > mistake. I find ajax to be difficult to test and debug, and my views consist > pretty much entirely of partials - it''s getting hard to keep track of them > all. > > I''m just wondering how other developers decide if it''s worth going down the > ajax route. > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 25 Apr 2006, at 16:22, Alan Bullock wrote:> before I started building my latest rails app, I made the decision > to make > good use of ajax. My reasonsing was that users would benefit from the > quicker page updates - the application provides various different > types of > insurance quotes, and has several multi-page forms and reports that > can be > drilled down 5 or 6 levels deep in some cases - so it seemed like a > good > candidate for ajax > > Now that I''ve started writing the thing, I''m wondering if I''ve made a > mistake. I find ajax to be difficult to test and debug, and my > views consist > pretty much entirely of partials - it''s getting hard to keep track > of them > all. > > I''m just wondering how other developers decide if it''s worth going > down the > ajax route.There are two things to help you: there''s a function somewhere to turn AJAX debugging on and you should use firefox with the Firebug extension, it will allow you to debug javascript. Best regards Peter De Berdt
Some paper to sketch my form and naming of DIV''s helps. But with RJS its pretty simple. Love it. And now in the controllers. That saves a lot of rjs templates -- Posted via http://www.ruby-forum.com/.
Peter De Berdt wrote:> On 25 Apr 2006, at 16:22, Alan Bullock wrote: > >> >> Now that I''ve started writing the thing, I''m wondering if I''ve made a >> mistake. I find ajax to be difficult to test and debug, and my >> views consist >> pretty much entirely of partials - it''s getting hard to keep track >> of them >> all. >> >> I''m just wondering how other developers decide if it''s worth going >> down the >> ajax route. > > There are two things to help you: there''s a function somewhere to > turn AJAX debugging on and you should use firefox with the Firebug > extension, it will allow you to debug javascript. > > Best regards > > Peter De BerdtDefinately Firebug. It absolutely rocks. You can see every ajax request, and its response, as well as inspect the DOM and has great javascript error ctaching and debugging. Also set this in your config/environments/development.rb # RJS Error reporting config.action_view.debug_rjs = true And any ajax request that generates an error will do an "alert(...info about error...);" so you get immedaite feedback about what went wrong. And check out the presenatation slides here: http://mir.aculo.us/articles/2006/04/15/slides-from-my-rails-ajax-presentation-at-canada-on-rails They taught me everything I just told you. -- Posted via http://www.ruby-forum.com/.
On 25 Apr 2006, at 18:30, Alex Wayne wrote:> Peter De Berdt wrote: >> On 25 Apr 2006, at 16:22, Alan Bullock wrote: >> >>> >>> Now that I''ve started writing the thing, I''m wondering if I''ve >>> made a >>> mistake. I find ajax to be difficult to test and debug, and my >>> views consist >>> pretty much entirely of partials - it''s getting hard to keep track >>> of them >>> all. >>> >>> I''m just wondering how other developers decide if it''s worth going >>> down the >>> ajax route. >> >> There are two things to help you: there''s a function somewhere to >> turn AJAX debugging on and you should use firefox with the Firebug >> extension, it will allow you to debug javascript. >> >> Best regards >> >> Peter De Berdt > > Definately Firebug. It absolutely rocks. You can see every ajax > request, and its response, as well as inspect the DOM and has great > javascript error ctaching and debugging. > > Also set this in your config/environments/development.rb > > # RJS Error reporting > config.action_view.debug_rjs = true > > And any ajax request that generates an error will do an "alert(...info > about error...);" so you get immedaite feedback about what went wrong. > > And check out the presenatation slides here: > http://mir.aculo.us/articles/2006/04/15/slides-from-my-rails-ajax- > presentation-at-canada-on-rails > They taught me everything I just told you.That''s what I was trying to say, but being to lazy to type and look it up, thanks for filling that in ;-) Best regards Peter De Berdt