Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 71 lines (39 sloc) 2.739 kB
ec726dc @ludicast most people use 'shiv'
authored
1 # Angular-Rails - The HTML6 Shiv [![Build Status](https://secure.travis-ci.org/ludicast/angular-rails.png)](http://travis-ci.org/ludicast/angular-rails)
525b44d @ludicast changed readme format
authored
2
efbfdba @ludicast update
authored
3 This project lets you use angularjs with the yummy Rails 3.1 asset pipeline. The eventual goal is to have it integrate scaffolding with test support.
ec0dfe9 @ludicast edited readme
authored
4
9274a4e @ludicast changed readme
authored
5 ## Warning!! Code-Theft :)
525b44d @ludicast changed readme format
authored
6
3a04c64 @ludicast markdown edit
authored
7 This README (and some of the accompanying code) is being copied/pasted/ripped from the [backbone-rails](http://github.com/codebrew/backbone-rails) project to help bootstrap things. Later on I'll cut the cord.
525b44d @ludicast changed readme format
authored
8
4b8c90c @ludicast edited readme
authored
9 ## Assumptions
efbfdba @ludicast update
authored
10
11 * Rails 3.1 - For the asset pipeline
4b8c90c @ludicast edited readme
authored
12 * Coffeescript - Because less LOC means less bugs, plus it is the Rails Way, like it or not.
13 * Ruby 1.9.2 - Because I like the syntax enhancements (but if there's an outcry I can support 1.8.7)
14 * RSpec - This is a loose requirement, but all specs generated will be, well rspec. Once we have end-to-end coverage, someone can add a patch for testunit (or mini*) support.
15 * RESTful controllers - another loose requirement, but it will help things be smoother for you. The goal is as little friction as possible between the front and back ends, without resorting to Node.js :).
525b44d @ludicast changed readme format
authored
16
17 ### Installation
18
efbfdba @ludicast update
authored
19 Add to your gemfile:
525b44d @ludicast changed readme format
authored
20
942edb1 @ludicast updated readme
authored
21 gem "angular-rails"
525b44d @ludicast changed readme format
authored
22
9395caf @ludicast updated README
authored
23 And bundle away. To bootstrap things then type:
525b44d @ludicast changed readme format
authored
24
25 rails g angular:install
26
27 ### Layout and namespacing
28
29 Running `rails g angular:install` will create the following directory structure under `app/assets/javascripts/angular`:
30
31 controllers/
32 filters/
33 services/
34 widgets/
35
29c1673 @ludicast added template directory
authored
36 It will also generate a `templates/` directory under app assets, where view templates can be stored. This lets you use haml, etc. for your angular views.
37
9274a4e @ludicast changed readme
authored
38 It will also add to the application.js file the appropriate requires.
525b44d @ludicast changed readme format
authored
39
9274a4e @ludicast changed readme
authored
40 ## Generators
41
42 angular-rails provides a simple generator to help get you started using angular.js with rails 3.1. The generators will only create client side code (javascript).
525b44d @ludicast changed readme format
authored
43
9395caf @ludicast updated README
authored
44 So far we have a controller generator which generates a controller file if you rum
45
46 rails g angular:controller MODELNAME
47
48 This file is empty except for the class declaration, but I will be adding some RESTful controller functionality shortly.
49
ed27546 @ludicast moving to angle-up
authored
50 ## angle-up
76d0884 @ludicast update
authored
51
52
ed27546 @ludicast moving to angle-up
authored
53 In an attempt to DRY up angular apps I added the angle-up javascript file to the assets path. [angle-up](https://github.com/ludicast/angle-up) attempts to add some opinions to angular apps.
f2210ed @ludicast added angular autoinitialization
authored
54
525b44d @ludicast changed readme format
authored
55 ## Example Usage
56
57 Created a new rails 3.1 application called `blog`.
58
59 rails new blog
60
61 Edit your Gemfile and add
62
9274a4e @ludicast changed readme
authored
63 gem 'angular-rails'
525b44d @ludicast changed readme format
authored
64
65 Install the gem and generate scaffolding.
66
67 bundle install
68 rails g angular:install
9274a4e @ludicast changed readme
authored
69
70 You now have installed the angular-rails gem, setup a default directory structure for your frontend angular code.
Something went wrong with that request. Please try again.