Every repository with this icon (
Every repository with this icon (
tree c0ffd3fb3ac96617cde4eb5f2b81d966aea105f6
parent 37e2d2edda0f2d1bad8571ea21573895c2ad1dd6
response_for
response_for (see Ardes::ResponseFor::ClassMethods) allows you to decorate the respond_to block of actions on sublcassed controllers. This works nicely with plugins.ardes.com/doc/resources_controller
Current Version 0.2-stable
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.
Version 0.2.0 was released on Sept 14th 2008.
As of version 0.2.0, response_for’s functionality can be summed up in one sentence:
"response_for allows you to specify default responses for any action (or before filter) that doesn’t render or redirect"
Version 0.1
Versions prior to 0.2 are tagged with 0.1.
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 using rails >= 2.1 then use the 0.1-stable branch
Example
class FooController < ApplicationController
def index
@foos = Foo.find(:all)
end
def show
@foo = Foo.find(params[:id])
end
end
# this controller needs to respond_to fbml on index, and
# js, html and xml (templates) on index and show
class SpecialFooController < FooController
response_for :index do |format|
format.fbml { render :inline => turn_into_facebook(@foos) }
end
response_for :index, :show, :types => [:html, :xml, :js]
end
Specs and Coverage
- The SPECDOC lists the specifications
- Coverage is 100% (C0), and the spec suite is quite comprehensive
RSpec is used for testing, so the tests are in spec/ rather than test/ Do rake —tasks for more details.
Continuous Integration
garlic (at github.com/ianwhite/garlic) is used for CI. To run the CI suite have a look at garlic_example.rb








