public
Description: A collection of useful Rails generator scripts.
Clone URL: git://github.com/ryanb/nifty-generators.git
ryanb (author)
Fri May 09 11:16:31 -0700 2008
commit  909c7eb1f7b95757dd3d2added8f13fb1a37ba64
tree    8232248c130cc52db3995ee6cb62141a0af10000
parent  982c19ce693cc3eee68115d9fff5f75cd026024e
nifty-generators / README
100644 71 lines (37 sloc) 1.801 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
= Nifty Generators
 
A collection of useful Rails generator scripts by Ryan Bates.
 
 
== Install
 
  gem install ryanb-nifty-generators --source=http://gems.github.com
 
  
== Usage
 
Once you install the gem, the generators will be available to all Rails
applications on your system. If you run script/generate without any
additional arguments you should see the available generators listed.
 
To run the generator, go to your rails project directory and call it
using the script/generate or script/destroy command.
 
  script/generate nifty_scaffold Recipe name:string index new
 
  
== Included Generators
 
* nifty_layout: generates generic layout, stylesheet, and helper files.
* nifty_scaffold: generates a controller and optional model/migration.
 
Run the command with the --help option to learn more.
 
  script/generate nifty_layout --help
 
 
== Troubleshooting
 
*I get "undefined method 'title'" error for nifty_scaffold.*
 
Try running nifty_layout too, that will generate this helper method. Or
you can just change the templates to whatever approach you prefer for
setting the title.
 
 
*Forms don't work for nifty_scaffold.*
 
Try restarting your development server. Sometimes it doesn't detect the
change in the routing.
 
 
*The tests/specs don't work for nifty_scaffold.*
 
Make sure you have mocha installed and require it in your spec/test helper.
 
  gem install mocha
  
  # in spec_helper.rb
  config.mock_with :mocha
  
  # in test_helper.rb
  require 'mocha'
 
Also, make sure you're using edge rails (or 2.1 when released) as some methods require that.
 
 
== Development
 
This project can be found on github at the following URL.
 
http://github.com/ryanb/nifty-generators/
 
If you wish the generators behaved differently, please consider
forking the project and modifying to your heart's content.