ianwhite / response_for

response for lets you decorate your actions respond_to blocks

This URL has Read+Write access

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
9eb9e429 » ianwhite 2008-04-30 Added note about 2.0-stable... 5 == Important for rails 2.0.x users
6
7 If you are on 2.0.2 or 2.0-stable, you must checkout the 2.0-stable branch of response_for.
8
9 Edge users should use the master branch.
10
570f798d » ian 2007-10-23 response_for: initial release 11 === Example
12
13 class FooController < ApplicationController
14 def index
15 @foos = Foo.find(:all)
16 end
17
18 def show
19 @foo = Foo.find(params[:id])
20 end
21 end
22
23 # this controller needs to respond_to fbml on index, and
24 # js, html and xml (templates) on index and show
25 class SpecialFooController < FooController
26 response_for :index do |format|
27 format.fbml { render :inline => turn_into_facebook(@foos) }
28 end
29
30 response_for :index, :show, :types => [:html, :xml, :js]
31 end
32
41b2cc18 » ianwhite 2008-04-30 Updated README, and various... 33 === works with rails 2.0-stable and edge
34
35 response_for works with rails 2 and edge.
36
f0b98bf1 » ian 2007-10-18 Initial import of response_for 37 === Specs and Coverage
38
41b2cc18 » ianwhite 2008-04-30 Updated README, and various... 39 * The SPECDOC lists the specifications
40 * Coverage is 100% (C2), and the spec suite is quite comprehensive
41
f0b98bf1 » ian 2007-10-18 Initial import of response_for 42 RSpec is used for testing, so the tests are in <tt>spec/</tt> rather than
43 <tt>test/</tt> Do rake --tasks for more details.
44
41b2cc18 » ianwhite 2008-04-30 Updated README, and various... 45 === Continuous Integration
46
47 garlic (at http://github.com/ianwhite/garlic) is used for CI. To run the CI suite have a look at
48 garlic_example.rb