43. #
content_controller.rb
class
ContentController
<
ActionController::Base
respond_to
:html
def
show
redirect_to
:post_path
#
@content
=
Content.find_by_id(params[:id])
#
respond_with(@content)
end
end
@djchrisle 43
44. Defaults as 302 response
#
content_controller.rb
class
ContentController
<
ActionController::Base
respond_to
:html
def
show
redirect_to
:post_path
#
@content
=
Content.find_by_id(params[:id])
#
respond_with(@content)
end
end
@djchrisle 44
45. 301 vs 302 redirect
• RFC 2616, Section 10.3.3
– 302 Found: The requested resource resides
temporarily under a different URI
• RFC 2616, Section 10.3.2
–301 Moved Permanently: The requested resource has
been assigned a new permanent URI and any future
references to this resource SHOULD use one of the
returned URIs
@djchrisle 45