RailsCasts Pro episodes are now free!

Learn more or hide this

Brian Mann's Profile

GitHub User: brian-mann

Site: www.backbonerails.com

Comments by Brian Mann


I recently just finished a series that walks through building a scalable Backbone application layer by layer. It introduces a lot of patterns and concepts for building large Backbone applications alongside the Marionette framework. Marionette removes a ton of Backbone boilerplate and gives you application components you can leverage.

Whenever I watch or read other tutorials there is always a ton of misinformation, zombies being created, or ridiculous amounts of boilerplate code. So I've been working to show other Rails developers how to avoid these pitfalls and solve common problems.

Marionette is worth looking into regardless if you're developing with Backbone. It's site is here: MarionetteJS and you can find the series I've put together here: BackboneRails.com


I've been using Marionette for 6+ months in a production app of around 700+ JS files. It goes together with Backbone like peanut butter jelly :-)

Marionette reduces a ton of the Backbone boilerplate stuff you see in virtually every tutorial / screencast. Marionette's docs are great but there's been a lack of real world use cases / screencasts about it - until recently. Check out MarionetteJS for several good links or BackboneRails.com since you're probably looking to see a scalable app built alongside Rails.

Hope this helps!


Rails is a great anchor for working with any kind of JS MVC Framework. Through the use of the Asset Pipeline, JSON Generation gems like Rabl covered in this Railscasts and even gems like Gon also covered here along with the myriad of gems for use with JS templating (like ECO) you get the benefit of turning Rails into an amazingly streamlined API, built to support rich client side applications.

There isn't really an answer to the "correct" nor the "best" JS MVC Framework to use. I've personally built a large scale application (700+ JS files) using Backbone alongside Marionette. It's been awesome. There is a critical lack of sites dedicated to showing real world applications built leveraging these frameworks with Rails. Anyway I know this is an Angular episode, but I figured I'd point out BackboneRails.com because it can give you insight into the Backbone world of building apps with Rails, and can maybe help you make the decision that's best for your app. :-)


What if you wanted to put a validation on Question to ensure that it's not blank... or maybe validate its uniqueness against all of the other Questions to ensure none of the names are the same?

The validations are easy, but the hard part is correlating those Rails errors to which Question input actually failed in the case of multiple children errors. If you had several questions that each were non-unique or perhaps blank, Rails will simply merge all of those errors into one key, and you have no way of associating those out independently from one another.

Does anyone know a workaround on this problem?