GithubHelp home page GithubHelp logo

blakewilliams / backbone_handlebars Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 0.0 172 KB

Backbone + Handlebars for Rails with template precompilation

License: MIT License

CoffeeScript 2.46% Ruby 97.54%

backbone_handlebars's Introduction

BackboneHandlebars

A gem that vendors the latest Backbone, Underscore, and Handlebars libraries and compiles/precompiles Handlebars templates.

Installation

Add this line to your application's Gemfile:

gem 'backbone_handlebars'

Usage

rails generate backbone_handlebars:install

This will generate the applications structure in the app/assets/javascripts directory and add the precompile option to your production environment.

Your templates will be stored in Handlebars.templates and can be accessed by their path + name. eg: You have a template called post.handlebars in app/assets/javascripts/templates/posts/post.handlebars. You would access this template with the following:

Handlebars.templates['posts/post']

Options

config.handlebars.precompile

Enables precompilation and will serve only the Handlebars runtime instead of the full library.

config.handlebars.path

Changes the path of the Handlebars library that precompiles your templates

If you want to use your own Handlebars or Handlebars runtime place them in vendor/assets/handlebars/development and vendor/assets/handlebars/production respectively.

backbone_handlebars's People

Contributors

blakewilliams avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

backbone_handlebars's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.