README.textile in grimen-dry_scaffold-0.3.1 vs README.textile in grimen-dry_scaffold-0.3.2
- old
+ new
@@ -35,10 +35,11 @@
* "*object_daddy*":http://github.com/flogic/object_daddy - Fixture-replacement
h4. Testing
* "*shoulda*":http://github.com/thoughtbot/shoulda - Testing framework
+* "*rspec*":http://wiki.github.com/dchelimsky/rspec - Testing framework
h2. Features
h3. Overview
@@ -155,15 +156,11 @@
def collection
paginate_options ||= {}
paginate_options[:page] ||= (params[:page] || 1)
paginate_options[:per_page] ||= (params[:per_page] || 20)
- @collection = @resources ||= end_of_association_chain.paginate(paginate_options)
- end
-
- def resource
- @resource = @resource ||= end_of_association_chain.find(params[:id])
+ @resources ||= end_of_association_chain.paginate(paginate_options)
end</pre>
h3. View Partials
A very common pattern is to break up views in partials, which is also what DryScaffold does:
@@ -224,19 +221,28 @@
<pre>config.gem 'haml'
config.gem 'will_paginate'
config.gem 'justinfrench-formtastic', :lib => 'formtastic', :source => 'http://gems.github.com'
config.gem 'josevalim-inherited_resources', :lib => 'inherited_resources', :source => 'http://gems.github.com'</pre>
+Also configure @config/environments/test.rb@ with the Rspec library if you want to
+
+<pre>config.gem 'rspec'
+config.gem 'rspec-rails'</pre>
+
+And don't forget to initialize it as well:
+
+<pre>./script/generate rspec</pre>
+
h2. Usage
-<pre>./script/generate dry_scaffold ModelName [attribute:type attribute:type] [_actions:new,create,...] [_formats:html,json,...] [_indexes:attribute,...] [--skip-pagination] [--skip-resourceful] [--skip-formtastic] [--skip-views] [--skip-helpers] [--skip-migration] [--skip-timestamps] [--skip-tests] [--layout] [--tunit] [--shoulda] [--fixtures] [--fgirl] [--machinist] [--odaddy]</pre>
+<pre>./script/generate dry_scaffold ModelName [attribute:type attribute:type] [_actions:new,create,...] [_formats:html,json,...] [_indexes:attribute,...] [--skip-pagination] [--skip-resourceful] [--skip-formtastic] [--skip-views] [--skip-helpers] [--skip-migration] [--skip-timestamps] [--skip-tests] [--layout] [--tunit] [--shoulda] [--rspec] [--fixtures] [--fgirl] [--machinist] [--odaddy]</pre>
...or use the alias @dscaffold@ instead of @dry_scaffold@.
For generating just a *model*, then use:
-<pre>./script/generate dry_model ModelName [attribute:type attribute:type] [_indexes:attribute,...] [--skip-migration] [--skip-timestamps] [--skip-tests] [--tunit] [--shoulda] [--fixtures] [--fgirl] [--machinist] [--odaddy]</pre>
+<pre>./script/generate dry_model ModelName [attribute:type attribute:type] [_indexes:attribute,...] [--skip-migration] [--skip-timestamps] [--skip-tests] [--tunit] [--shoulda] [--rspec] [--fixtures] [--fgirl] [--machinist] [--odaddy]</pre>
...or use the alias @dmodel@ instead of @dry_model@.
h3. Model Name
@@ -397,9 +403,10 @@
h4. All
* @--skip-tests@ - Don't generate tests (functional/unit/...).
* @--tunit@ - Generate/Use test_unit tests. Note: Rails default.
* @--shoulda@ - Generate/Use *shoulda* tests.
+* @--rspec@ - Generate/Use *rspec* tests.
* @--fixtures@ - Generate/Use fixtures. Note: Rails default.
* @--fgirl@ - Generate/Use *factory_girl* factories.
* @--machinist@ - Generate/Use *machinist* blueprints (factories).
* @--odaddy@ - Generate/Use *object_daddy* generator/factory methods.
\ No newline at end of file