Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/domchristie/t3-rails
Easily set up the T3 JavaScript framework within your Rails 4+ application.
https://github.com/domchristie/t3-rails
Last synced: 12 days ago
JSON representation
Easily set up the T3 JavaScript framework within your Rails 4+ application.
- Host: GitHub
- URL: https://github.com/domchristie/t3-rails
- Owner: domchristie
- License: apache-2.0
- Created: 2015-06-14T17:52:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-23T15:56:13.000Z (almost 9 years ago)
- Last Synced: 2024-11-01T19:07:35.152Z (12 days ago)
- Language: Ruby
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# t3-rails
Easily set up the [T3 JavaScript framework](http://t3js.org/) within your Rails 4+ application.
This gem includes the T3 assets (including the T3 testing bundle), along with generators for setting up application structure and for creating modules, services, and behaviors.
**Note**: this gem is currently in development and as such has not been thoroughly tested in the wild. Testing and improvements (particularly regarding older versions of Ruby/Rails) are welcome!
## Getting Started
Add the gem to your application Gemfile:
```ruby
gem 't3-rails'
```Run `bundle install`, then generate the application structure:
```
rails g t3:bootstrap
```Initialize your T3 app by calling `Box.Application.init()`. As the [T3 docs](http://t3js.org/docs/getting-started/application) suggest, you may want to call `init()`:
> - Inline at the bottom of the page
> - In a window.onload event handler
> - In a DOMContentLoaded event handlerFor example to initialize on DOM ready and on page load (a Turbolinks event), you may want to include the following:
```javascript
(function() {
var init = function() { Box.Application.init(); };
$(document).ready(init).on('page:load', init);
})();
```## Generators
### `bootstrap`
```
rails g t3:bootstrap
```Sets up `modules`, `services`, and `behaviors` directories in `app/assets/javascripts`. Injects `require` statements in `application.js` for including the `t3.js` and the component directories.
### `module`
```
rails g t3:module name
```Creates a new module in the `modules` directory.
### `service`
```
rails g t3:service name
```Creates a new service in the `services` directory.
### `behavior`
```
rails g t3:behavior name
```Creates a new behavior in the `behaviors` directory.
## Copyright and Licenses
t3-rails is copyright © 2015 Dom Christie and released under the MIT license. T3 is licensed under the Apache License, Version 2.0.