Joosy::Rails
The bindings between Joosy framework and Rails.
If you are seeking for information about Joosy, start with official site, guides or central repository.
Capabilities
- Full assets integration
- Generators
- Built-in serving controller
- Routes helpers
- Automatic Joosy Resources generation
Installation
Add this line to your application's Gemfile:
gem 'joosy-rails'
And then execute:
$ bundle
Usage
Generators
rails g joosy:application (NAME)
Generates basic application and patches route to make it loadable straight away.
By default an application will be generated directly at app/assets/javascripts
. If you want to isolate it a bit more, pass in the NAME
argument — then it will appear at app/assets/javascripts/NAME
.
rails g joosy:layout NAME (APPLICATION)
Generates Joosy layout. NAME
can contain slashes to automatically generate corresponding path and namespace.
Note that if the application was initially generated with the usage of NAME
option, you should pass it here as the second parameter (APPLICATION).
rails g joosy:page NAME (APPLICATION)
Generates Joosy page. NAME
can contain slashes to automatically generate corresponding path and namespace.
Note that if the application was initially generated with the usage of NAME
option, you should pass it here as the second parameter (APPLICATION).
rails g joosy:widget NAME (APPLICATION)
Generates Joosy widget. NAME
can contain slashes to automatically generate corresponding path and namespace.
Note that if the application was initially generated with the usage of NAME
option, you should pass it here as the second parameter (APPLICATION).
rails g joosy:controller NAME (--copy)
Generates a controller serving Joosy application using the NAME given.
By default a controller will inherit from internal Joosy::Rails::ServeController
. If instead you want to patch it from the ground, use --copy
option that will make generator to create raw controller that inherits from ActionController::Base
.
Serving controller and helpers
This gem provides joosy
routing helper which can be used in the following way:
joosy '/', application: 'dummy'
This will map your dummy
Joosy application to the root url. The application
option is optional. It should reflect path to application from app/assets/javascript
(use the value that you passed into the NAME of rails g joosy:application
).
Maintainers
- Boris Staal, @inossidabile
License
Copyright 2013 Boris Staal
It is free software, and may be redistributed under the terms of MIT license.