Ruby on Rails Monday, August 5, 2013

Hello Everyone,


We would like to place our pure HTML+CSS with Javascript application
into a Ruby on Rails project within eclipse using Aptana. What we are
trying to take advantage of is Ruby on Rails Asset Pipeline.

Our project uses JQuery, Backbone and Bootstrap. So starting from the
top:

1) I placed all 3rd part libraries in `vendor/assets/javascripts` (backbone-min.js, jquery-1.7.1.min.js,underscroe-min.js)
2) Placed our javascript implementation in `app/javascripts/` (application.js, main.js, utils.js)
3) Images in `app/assets/images`

Now this is where I want to make sure of a few things.

i) Where do we place the pure HTML code?
ii) As mentioned we are using backbone and not sure if:

Models:

window.Wine = Backbone.Model.extend({
urlRoot: "rs/wines",
defaults: {
"id": null,
        "name":  "",
         "grapes":  "",
 "country":  "USA",
 "region":  "California",
 "year":  "",
 "description":  "",
 "picture":  ""
     }
});


Views:

window.Wine = Backbone.Model.extend({
urlRoot: "rs/wines",
defaults: {
"id": null,
   "name":  "",
   "grapes":  "",
   "country":  "USA",
   "region":  "California",
   "year":  "",
   "description":  "",
   "picture":  ""
 }
});

window.WineCollection = Backbone.Collection.extend({
model: Wine,
url: "rs/wines"
});

Backbone Templates (HTML Fragments):

<li><a href='#wines/<%= id %>'><%= name %></a></li>


Should be placed to take full advantage of what Asset Pipeline has to offer our HTML project. Things like
minify etc...

PS We do not use any ruby or rails code in our project.

Your Help is Greatly Appreciated,

Nick

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/267c0e92-0ca7-4384-9cd7-9e7e4cf0caa2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment