public
Description: response for lets you decorate your actions respond_to blocks
Homepage: http://blog.ardes.com/response_for
Clone URL: git://github.com/ianwhite/response_for.git
Click here to lend your support to: response_for and make a donation at www.pledgie.com !
response_for / README.rdoc
f0b98bf1 » ian 2007-10-18 Initial import of response_for 1 = response_for
2
570f798d » ian 2007-10-23 response_for: initial release 3 response_for (see Ardes::ResponseFor::ClassMethods) allows you to decorate the respond_to block of actions on sublcassed controllers. This works nicely with http://plugins.ardes.com/doc/resources_controller
4
9dc94651 » ianwhite 2008-09-13 Final notes and docfixes fo... 5 == Current Version 0.2-stable
9eb9e429 » ianwhite 2008-04-30 Added note about 2.0-stable... 6
9dc94651 » ianwhite 2008-09-13 Final notes and docfixes fo... 7 Version 0.2-stable of response_for has BC-breaking API changes, has vastly simplified internals, and is supported only for Rails >= 2.1.x.
9eb9e429 » ianwhite 2008-04-30 Added note about 2.0-stable... 8
9dc94651 » ianwhite 2008-09-13 Final notes and docfixes fo... 9 Version 0.2.0 was released on Sept 14th 2008.
10
11 As of version 0.2.0, response_for's functionality can be summed up in one sentence:
12
13 "response_for allows you to specify default responses for any action (or before filter) that doesn't render or redirect"
37e2d2ed » ianwhite 2008-09-13 Added notes about 0.1 vs 0.... 14
15 == Version 0.1
16
17 Versions prior to 0.2 are tagged with 0.1.
18
19 There is a branch for rails 2.0 users on this release. If you are using rails 2.0, then you want the 0.1-stable-rails2.0 branch. If you are
20 using rails >= 2.1 then use the 0.1-stable branch
9eb9e429 » ianwhite 2008-04-30 Added note about 2.0-stable... 21
570f798d » ian 2007-10-23 response_for: initial release 22 === Example
23
24 class FooController < ApplicationController
25 def index
26 @foos = Foo.find(:all)
27 end
28
29 def show
30 @foo = Foo.find(params[:id])
31 end
32 end
33
34 # this controller needs to respond_to fbml on index, and
35 # js, html and xml (templates) on index and show
36 class SpecialFooController < FooController
37 response_for :index do |format|
38 format.fbml { render :inline => turn_into_facebook(@foos) }
39 end
40
41 response_for :index, :show, :types => [:html, :xml, :js]
42 end
41b2cc18 » ianwhite 2008-04-30 Updated README, and various... 43
f0b98bf1 » ian 2007-10-18 Initial import of response_for 44 === Specs and Coverage
45
41b2cc18 » ianwhite 2008-04-30 Updated README, and various... 46 * The SPECDOC lists the specifications
0aeceda2 » ianwhite 2008-06-05 Fixed typo in README 47 * Coverage is 100% (C0), and the spec suite is quite comprehensive
41b2cc18 » ianwhite 2008-04-30 Updated README, and various... 48
f0b98bf1 » ian 2007-10-18 Initial import of response_for 49 RSpec is used for testing, so the tests are in <tt>spec/</tt> rather than
50 <tt>test/</tt> Do rake --tasks for more details.
51
41b2cc18 » ianwhite 2008-04-30 Updated README, and various... 52 === Continuous Integration
53
54 garlic (at http://github.com/ianwhite/garlic) is used for CI. To run the CI suite have a look at
55 garlic_example.rb