really bummed ryan didn't show the best way to handle events bound to new elements added to the dom. Although it seems simple to add a function the better and more generally accepted best practise would be to use the .on event Delegation. example:
javascript
$(function() {
$("body").on("click", "p", function(){
// do the stuff
});
});
This tutorial is very much geared towards a particular way of using backbone on rails. (Understandable since this is a railscast)
I would suggest learning backbone yourself as a standalone html and js served out of public and communicating with your restful resources first, that way you can learn more about things like modularizing your app vs namespacing etc.
+1
Can someone tell me how this helps? Isnt the controller being called on each request where the heavy lifting is done anyway? (DB calls etc)
really bummed ryan didn't show the best way to handle events bound to new elements added to the dom. Although it seems simple to add a function the better and more generally accepted best practise would be to use the .on event Delegation. example:
look into using wabler to bundle the rails project into a war file for java app server:
https://github.com/jruby/jruby/wiki/JRubyOnRails#wiki-War_File_Deployment
look into using wabler to bundle the rails project into a war file for java app server:
https://github.com/jruby/jruby/wiki/JRubyOnRails#wiki-War_File_Deployment
the asset pipeline makes everything so easy /s
in rails 3.2.3 you need to run your dummy server with the
rails s
command from inside the tests/dummy folder, not at the root of the engine
docs:
http://edgeguides.rubyonrails.org/engines.html
Just a suggestion to everyone here:
This tutorial is very much geared towards a particular way of using backbone on rails. (Understandable since this is a railscast)
I would suggest learning backbone yourself as a standalone html and js served out of public and communicating with your restful resources first, that way you can learn more about things like modularizing your app vs namespacing etc.
learn backbone, then backbone on rails.
I still feel like testing is such a drag, How do I believe?
This seems like it would really slow down my development speed.
Does your company require you to write tests first?