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

