Skip to content

Commit

Permalink
Merge pull request spine#7 from dnagir/docs
Browse files Browse the repository at this point in the history
update README to reflect a little better the functionality
  • Loading branch information
maccman committed Oct 22, 2011
2 parents d8fce24 + cdca3c0 commit 057fa51
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ This gem does two things:

* Adds some Spine generators, so you can easily create Spine Models, Views and Controllers.

For versions of Rails less than 3.1, it only provides the generator to install JavaScript file into public directory.

### Installation

In your Gemfile, add this line:
Expand All @@ -39,6 +37,8 @@ By default your application will be namespaced by the `app` directory. You can s

rails g spine:new --app foo_bar

**NOTE:** If you use the `--app` option here, then you will also have to specify it with other generators.

Use the top-level level `index.coffee` file to setup namespacing and initial controller instantiation.

## Generators
Expand All @@ -49,25 +49,25 @@ spine-rails provides three simple generators to help you get started:

rails g spine:model User email username full_name

This generator creates a very minimal model inside `app/assets/javascript/models`. You can optionally provide a list of attributes for the model.
This generator creates a very minimal model inside `app/assets/javascript/app/models`. You have to provide a list of attributes for the model.

### Controller

rails g spine:controller Users

This generator creates a minimal `Users` controller in `app/assets/javascripts/controllers` to get you started.
This generator creates a minimal `Users` controller in `app/assets/javascripts/app/controllers` to get you started.

### View

rails g spine:view users/index

This generates creates blank Spine views in the `app/assets/javascripts/views/users` directory.
This generator creates a blank Spine view `app/assets/javascripts/app/views/users/index.jst.ejs`.

The generator will create views in `hamljs`, `eco` or `ejs` format, depending on which gems are availale:
The generator will create views in `hamljs`, `eco` or `ejs` format, depending on the gems availale:

- [eco](https://github.com/sstephenson/eco) - will use ECO templates
- [rub-haml-js](https://github.com/dnagir/ruby-haml-js) - will use HAMLJS templates
- otherwise, EJS templates will be used
1. [eco](https://github.com/sstephenson/eco) - will use ECO templates
2. [rub-haml-js](https://github.com/dnagir/ruby-haml-js) - will use HAMLJS templates
3. otherwise, EJS templates will be used

## Example Usage

Expand Down Expand Up @@ -118,4 +118,4 @@ For more information on how to integrate Spine with Rails, please see the [Rails

## Attributions

This plugin was made by [Alex MacCaw](http://alexmaccaw.co.uk) with major contributions from [Dmytrii Nagirniak](https://github.com/dnagir). It's under the same license as [Spine](http://spinejs.com) (MIT).
This plugin was made by [Alex MacCaw](http://alexmaccaw.co.uk) with major contributions from [Dmytrii Nagirniak](https://github.com/dnagir). It's under the same license as [Spine](http://spinejs.com) (MIT).

0 comments on commit 057fa51

Please sign in to comment.