Sha256: ef19223906a6fd6c2e5300b4d2b60efd36a55cbef2b2981677a48294bd644ac4

Contents?: true

Size: 1.95 KB

Versions: 4

Compression:

Stored size: 1.95 KB

Contents

== Responders

A set of responders modules to dry up your Rails application. This branch (v0.4) is meant
to be used with Rails 2.3 with Inherited Resources. Check the master branch for Rails 3
version.

* FlashResponder - Sets the flash based on the controller action and resource status.
  For instance, if you do: respond_with(@post) on a POST request and the resource @post
  does not contain errors, it will automatically set the flash message to
  "Post was successfully created" as long as you configure your I18n file:

    flash:
      actions:
        create:
          notice: "{{resource_name}} was successfully created."
        update:
          notice: "{{resource_name}} was successfully updated."
        destroy:
          notice: "{{resource_name}} was successfully destroyed."
          alert: "{{resource_name}} could not be destroyed."

  In case the resource contains errors, you should use the failure key on I18n. This is
  useful to dry up flash messages from your controllers. If you need a specific message
  for a controller, let's say, for PostsController, you can also do:

    flash:
      posts:
        create:
          notice: "Your post was created and will be published soon"

  This responder is activated in all non get requests. By default it will use the keys
  :notice and :alert, but they can be changed as well:

    Responders::FlashResponder.flash_keys = [ :success, :failure ]

* HttpCacheResponder - Automatically adds Last-Modified headers to API requests. This
  allows clients to easily query the server if a resource changed and if the client tries
  to retrieve a resource that has not been modified, it returns not_modified status.

== Installation

  sudo gem install responders --version=0.4.5

== Bugs and Feedback

If you discover any bugs or want to drop a line, feel free to create an issue on GitHub.

http://github.com/plataformatec/responders/issues

MIT License. Copyright 2009 Plataforma Tecnologia. http://blog.plataformatec.com.br

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
responders-0.4.8 README.rdoc
responders-0.4.7 README.rdoc
responders-0.4.6 README.rdoc
responders-0.4.5 README.rdoc