Skip to content

Commit

Permalink
copy-edits 2446b13
Browse files Browse the repository at this point in the history
  • Loading branch information
fxn committed Feb 2, 2011
1 parent a0757e0 commit 33643bc
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions actionpack/lib/action_controller/metal.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -43,38 +43,37 @@ def build(action, app=nil, &block)
end end
end end


# ActionController::Metal is the simplest possible controller, providing a # <tt>ActionController::Metal</tt> is the simplest possible controller, providing a
# valid Rack interface without the additional niceties provided by # valid Rack interface without the additional niceties provided by
# ActionController::Base. # <tt>ActionController::Base</tt>.
# #
# A sample Metal controller might look like this: # A sample metal controller might look like this:
# #
# class HelloController < ActionController::Metal # class HelloController < ActionController::Metal
# def index # def index
# self.response_body = "Hello World!" # self.response_body = "Hello World!"
# end # end
# end # end
# #
# And then to route requests to your Metal controller, you would add # And then to route requests to your metal controller, you would add
# something like this to <tt>config/routes.rb</tt>: # something like this to <tt>config/routes.rb</tt>:
# #
# match '/hello', :to => HelloController.action(:index), # match 'hello', :to => HelloController.action(:index)
# :as => 'hello'
# #
# The action method returns a valid Rack application for the \Rails # The +action+ method returns a valid Rack application for the \Rails
# router to dispatch to. # router to dispatch to.
# #
# == Rendering Helpers # == Rendering Helpers
# #
# ActionController::Metal by default provides no utilities for rendering # <tt>ActionController::Metal</tt> by default provides no utilities for rendering
# views, partials, or other responses aside from explicitly calling of # views, partials, or other responses aside from explicitly calling of
# response_body=, content_type=, and status=. To # <tt>response_body=</tt>, <tt>content_type=</tt>, and <tt>status=</tt>. To
# add the render helpers you're used to having in a normal controller, you # add the render helpers you're used to having in a normal controller, you
# can do the following: # can do the following:
# #
# class HelloController < ActionController::Metal # class HelloController < ActionController::Metal
# include ActionController::Rendering # include ActionController::Rendering
# append_view_path Rails.root + "app/views" # append_view_path "#{Rails.root}/app/views"
# #
# def index # def index
# render "hello/index" # render "hello/index"
Expand All @@ -83,21 +82,21 @@ def build(action, app=nil, &block)
# #
# == Redirection Helpers # == Redirection Helpers
# #
# To add redirection helpers to your Metal controller, do the following: # To add redirection helpers to your metal controller, do the following:
# #
# class HelloController < ActionController::Metal # class HelloController < ActionController::Metal
# include ActionController::Redirecting # include ActionController::Redirecting
# #
# def index # def index
# redirect_to root_url # redirect_to "http://www.example.com"
# end # end
# end # end
# #
# == Other Helpers # == Other Helpers
# #
# You can refer to the modules defined in ActionController to see # You can refer to the modules defined in ActionController to see
# the other features in ActionController::Base that you can bring # the other features in <tt>ActionController::Base</tt> that you can bring
# into your Metal controller. # into your metal controller.
# #
class Metal < AbstractController::Base class Metal < AbstractController::Base
abstract! abstract!
Expand Down

0 comments on commit 33643bc

Please sign in to comment.