-
Notifications
You must be signed in to change notification settings - Fork 44
iQvoc as a Rails Engine
To use iQvoc as a Rails Engine simply include the following into your Gemfile
gem 'iqvoc'
All models, controllers, views and routes iQvoc brings are automatically available in your app.
Probably your app comes with its own assets like CSS or JavaScript files. To properly use them in combination with iQvoc's core assets you have to structure your assets in a special manner to respect iQvoc's defaults; your asset directories have to look like this
app/assets/
|-- images
|-- javascripts
| |-- iqvoc_your_app_name
| | |-- your_app_name.js
| | |-- foo.js
| | `-- manifest.js
| `-- manifest.js
`-- stylesheets
|-- iqvoc_your_app_name
| |-- your_app_name.css
| |-- bar.css
| `-- manifest.css
`-- manifest.css
Your top-level manifest.[js|css]
files should contain some defaults in order to load iQvoc's core assets. As an example, we show the expected contents for JavaScript assets. The same pattern must be applied to your CSS asset manifest.
app/assets/javascripts/manifest.js
//= require framework
//= require iqvoc/manifest
//= require your_app_name/manifest
app/assets/javascripts/your_app_name/manifest.js
//= require your_app_name/your_app_name
//= require your_app_name/foo
//= require your_app_name/bar
By suiting to this structure we are able to provide a sane and concise integration of both iQvoc's core assets as well as your custom assets within Rails 3.1 standards.