Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/timakin/sprint-rails

Module to integrate Sprint.js to Ruby on Rails Asset Pipeline.
https://github.com/timakin/sprint-rails

Last synced: about 1 month ago
JSON representation

Module to integrate Sprint.js to Ruby on Rails Asset Pipeline.

Awesome Lists containing this project

README

        

Sprint-rails
===============

Integrate [Sprint.js](https://github.com/bendc/sprint), a high-performance, minimal, and simple substitute of jQuery to Asset pipeline of your Rails App.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'sprint-rails'
```

And then execute:

```
$ bundle install
```

After that, you need to make sprint.js available on your pages. To do that, you can add it to your application.js file, like this:

```
//= require sprint
```

## Usage

Just as same as jQuery, you can use like following. If you'd check in detail, visit [the original github repo of Sprint.js](https://github.com/bendc/sprint)

*In original case, Sprint's syntax is like this:

```
$("div").addClass("new").append("

Hi Sprint

");
```

But if you try to integrate it with Rails or existing jQuery apps, you have to use "Sprint" instead of "$" like this:

```
Sprint("div").addClass("new").append("

Hi Sprint

");
```

## Contributing

1. Fork it ( https://github.com/[my-github-username]/sprint-rails/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request