Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When I started using Backbone with Rails (almost a year ago), I also wanted a gem like this (I used backbone-rails at the time). Initially it seemed like many things were duplicated between backbone and rails, but as development progressed, I found this to be the exception rather than the rule. Especially if you're using Rails as an API, this kind of gem may only be helpful at the start of a project, and less relevant afterwards. </p> <p>I say this because most of our models no longer have a 1-1 correspondence with our Rails resources. For example, while information on people is required, this information comes from a combination of a number of resources, and excludes much of the data in the primary people records. Also, creating and modifying them isn't appropriate in our app, and creation is by invitation only, and that's exposed as a different resource entirely.</p> <p>Other resources aren't needed, and yet others have such a small subset of functionality or data, or have data from multiple resources, that having something generate them really wouldn't work.</p> <p>Since rails is the API in our case, we don't have any duplication in the view layer.</p> <p>I find that creating a custom generators that match the way you work with backbone, or having a few templates in your editor of choice to be a more flexible solution.</p> <p>In terms of organization, we've added backbone as a directory under the app/assets/javascripts directory, and created directories for models, views, routers, helpers, etc. here. This allows the use of coffeescript to write backbone without any gems needed. We use the jasmine and jasminerice gems to test our backbone code with coffeescript and haml for fixtures (these live in the spec/javascripts directory}.</p> <p>As for the templates, they are all rails view partials in our controllers that get rendered into the header. Backbone looks them up by id and uses them from there.</p> <p>Hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload