Ruby on Rails Tuesday, August 6, 2013

On Aug 5, 2013, at 10:01 AM, Nick Khamis wrote:

> 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

Wow. This seems like an awful lot of extra work to get the benefits of the asset pipeline. Have you looked at any of the recent crop of static-site compiler desktop apps? See https://incident57.com/codekit/ for one example (these seem to be popping up like daisies lately).

Or the huge crop of command-line tools to do the same thing? See https://iwantmyname.com/blog/2011/02/list-static-website-generators.html for one list I found immediately.

If you enable GZIP compression on your server, you could get a lot of these benefits for nearly no effort. See, the thing about the asset pipeline is that it is designed to give a highly dynamic Ruby-generated site the same sort of tools that the static site crowd already enjoy. I think you may be barking up the wrong tree here.

Walter

--
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/CC46299C-068D-4FAE-9A93-20F016E98910%40wdstudio.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment