From bbf28b82a2de0112c9dfa0f1d20202a70c78f9a1 Mon Sep 17 00:00:00 2001
From: Jeremy Ashkenas
Date: Thu, 28 Apr 2011 11:11:17 -0400
Subject: [PATCH] expanding the FAQ for MVC with a direct Rails comparison.
---
index.html | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/index.html b/index.html
index 3a540758..14dcc55a 100644
--- a/index.html
+++ b/index.html
@@ -2097,6 +2097,34 @@ Inbox.messages.fetch();
represents a logical chunk of UI, responsible for the contents of a single
DOM element.
+
+
+ Comparing the overall structure of Backbone to a server-side MVC framework
+ like Rails, the pieces line up like so:
+
+
+
+ -
+ Backbone.Model – Like a Rails model minus the class
+ methods. Wraps a row of data in business logic.
+
+ -
+ Backbone.Collection – A group of models on the client-side,
+ with sorting/filtering/aggregation logic.
+
+ -
+ Backbone.Controller – Rails routes.rb + Rails controller
+ actions. Maps URLs to functions.
+
+ -
+ Backbone.View – A logical, re-usable piece of UI. Often,
+ but not always, associated with a model.
+
+ -
+ Client-side Templates – Rails .html.erb views,
+ rendering a chunk of HTML.
+
+