All Projects → jimmycuadra → jquery-tmpl-rails

jimmycuadra / jquery-tmpl-rails

Licence: MIT license
jQuery Templates for the Rails asset pipeline.

Programming Languages

ruby
36898 projects - #4 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jquery-tmpl-rails

angular-progress-button
[Unmaintained] Buttons with built-in progress bars for AngularJS
Stars: ✭ 27 (-41.3%)
Mutual labels:  unmaintained
wp-sw-manager
INACTIVE - http://mzl.la/ghe-archive - Service Worker infrastructure for WordPress plugins.
Stars: ✭ 44 (-4.35%)
Mutual labels:  unmaintained
murmur
DEPRECATED - A webapp for collecting speech samples for voice recognition testing and training
Stars: ✭ 20 (-56.52%)
Mutual labels:  unmaintained
browsercompat
API for browser compatibility data on developer.mozilla.org
Stars: ✭ 21 (-54.35%)
Mutual labels:  unmaintained
discord
GitHub webhook that analyzes pull requests and adds comments about incompatible CSS
Stars: ✭ 29 (-36.96%)
Mutual labels:  unmaintained
happyforms
INACTIVE - http://mzl.la/ghe-archive - Extension to Django Forms that strips spaces
Stars: ✭ 14 (-69.57%)
Mutual labels:  unmaintained
homeassistant-coronavirus-hessen
[Unmaintained] Home Assistant component to scrape the current SARS-CoV-2 data for the German state of Hessen from the website of the Hessisches Ministerium für Soziales und Integration.
Stars: ✭ 15 (-67.39%)
Mutual labels:  unmaintained
f1
INACTIVE - http://mzl.la/ghe-archive - F1 is a browser extension that allows you to share links in a fast and fun way. Share links from within the browser, from any webpage, using the same services you already know and love. F1 is made by Mozilla.
Stars: ✭ 51 (+10.87%)
Mutual labels:  unmaintained
npm-mirror
DEPRECATED - A utility for mirroring a subset of npm packages from another npm registry
Stars: ✭ 38 (-17.39%)
Mutual labels:  unmaintained
fxtest-jenkins-pipeline
DEPRECATED
Stars: ✭ 39 (-15.22%)
Mutual labels:  unmaintained
white-cursor
Provides a white I-bar cursor in the Atom editor for use with dark backgrounds
Stars: ✭ 13 (-71.74%)
Mutual labels:  unmaintained
nl.fokkezb.form
[UNMAINTAINED] Alloy TableView Form Widget
Stars: ✭ 43 (-6.52%)
Mutual labels:  unmaintained
firefoxos-loop-client
DEPRECATED - Firefox OS client for the Loop service
Stars: ✭ 27 (-41.3%)
Mutual labels:  unmaintained
firefox-for-android-addons
INACTIVE - http://mzl.la/ghe-archive - [deprecated] A collection of JS modules, sample code, and boilerplate add-ons to help you build add-ons for Firefox for Android.
Stars: ✭ 46 (+0%)
Mutual labels:  unmaintained
mips
Exercism exercises in MIPS Assembly.
Stars: ✭ 19 (-58.7%)
Mutual labels:  unmaintained
wsoh
INACTIVE - http://mzl.la/ghe-archive - World Series of Hack
Stars: ✭ 44 (-4.35%)
Mutual labels:  unmaintained
PackageEvaluator.jl
A tool to evaluate the quality of Julia packages.
Stars: ✭ 35 (-23.91%)
Mutual labels:  unmaintained
django-solr
Solr Search Engine ORM for Django
Stars: ✭ 24 (-47.83%)
Mutual labels:  unmaintained
receiptverifier
INACTIVE - http://mzl.la/ghe-archive - A helper Javascript library for doing useful things with Open Web Apps.
Stars: ✭ 13 (-71.74%)
Mutual labels:  unmaintained
addon-sdk
DEPRECATED - The Add-on SDK repository.
Stars: ✭ 643 (+1297.83%)
Mutual labels:  unmaintained

Code Climate endorse

jquery-tmpl-rails

This gem adds the jQuery Templates plugin and a corresponding Sprockets engine to the asset pipeline in Rails >= 3.1 applications.

Installation

Add it to your Gemfile and run bundle.

Usage

jQuery templates will be recognized by Sprockets with the .tmpl extension. Place them anywhere in the Sprockets load path.

<!-- app/assets/javascripts/templates/author.tmpl -->
<div class="author">${name}</div>

In your application's JavaScript manifest file, require the jQuery Templates plugin followed by your templates. The templates are compiled and named with their Sprockets logical path:

//= require jquery-tmpl
//= require_tree ./templates

$.tmpl("templates/author", { name: "Jimmy" }).appendTo("#author");

Configuration

If the path to all of your templates have a common prefix that you prefer is not included in the template's name, you can set this option in config/application.rb:

config.jquery_templates.prefix = "templates"

That would change the previous example to this:

$.tmpl("author", { name: "Jimmy" }).appendTo("#author");

The prefix can also be a regular expression. For example, to use only the name of the file for the template name, regardless of directory structure:

config.jquery_templates.prefix = %r{([^/]*/)*}

Happy templating!

Acknowledgements

The Sprockets engine was originally derived from the sprockets-jquery-tmpl gem. If you want a similar mechanism for use outside of Rails, take a look at this project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].