Permalink
Browse files

Merge branch 'master' of git@github.com:lifo/docrails

  • Loading branch information...
Aditya Chadha
Aditya Chadha committed Apr 28, 2009
2 parents eeb12d6 + 4df9680 commit 57f031cba2740fd8afc867960220e28a1c333dc5
@@ -94,6 +94,18 @@ module InstanceMethods
# Note that you can define your own XML parameter parser which would allow you to describe multiple entities
# in a single request (i.e., by wrapping them all in a single root node), but if you just go with the flow
# and accept Rails' defaults, life will be much easier.
+ #
+ # Further more, you may call the #any method on the block's object in order to run the same code for different responses.
+ # def index
+ #
+ # respond_to do |format|
+ # format.html { @people = People.all(:limit => 10) }
+ # format.any(:xml, :atom) { @people = People.all }
+ # end
+ # end
+ #
+ # This will limit the @people variable to 10 people records if we're requesting HTML, but will list all the
+ # people for any xml or atom request.
#
# If you need to use a MIME type which isn't supported by default, you can register your own handlers in
# environment.rb as follows.
@@ -96,8 +96,7 @@ def verifiable_request_format?
!request.content_type.nil? && request.content_type.verify_request?
end
- # Sets the token value for the current session. Pass a <tt>:secret</tt> option
- # in +protect_from_forgery+ to add a custom salt to the hash.
+ # Sets the token value for the current session.
def form_authenticity_token
session[:_csrf_token] ||= ActiveSupport::SecureRandom.base64(32)
end
Oops, something went wrong.

0 comments on commit 57f031c

Please sign in to comment.