HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/gems/ruby-2.7.4/doc/actionpack-6.1.4.1/ri/ActionController/Metal/cdesc-Metal.ri
U:RDoc::NormalClass[iI"
Metal:ETI"ActionController::Metal;TI"AbstractController::Base;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"W<tt>ActionController::Metal</tt> is the simplest possible controller, providing a ;TI"Fvalid Rack interface without the additional niceties provided by ;TI"%<tt>ActionController::Base</tt>.;To:RDoc::Markup::BlankLineo;	;[I"4A sample metal controller might look like this:;T@o:RDoc::Markup::Verbatim;[
I"5class HelloController < ActionController::Metal
;TI"  def index
;TI"-    self.response_body = "Hello World!"
;TI"  end
;TI"	end
;T:@format0o;	;[I"HAnd then to route requests to your metal controller, you would add ;TI"6something like this to <tt>config/routes.rb</tt>:;T@o;;[I"5get 'hello', to: HelloController.action(:index)
;T;0o;	;[I"IThe +action+ method returns a valid Rack application for the \Rails ;TI"router to dispatch to.;T@S:RDoc::Markup::Heading:
leveli:	textI"Rendering Helpers;T@o;	;[
I"U<tt>ActionController::Metal</tt> by default provides no utilities for rendering ;TI"Jviews, partials, or other responses aside from explicitly calling of ;TI"O<tt>response_body=</tt>, <tt>content_type=</tt>, and <tt>status=</tt>. To ;TI"Nadd the render helpers you're used to having in a normal controller, you ;TI"can do the following:;T@o;;[I"5class HelloController < ActionController::Metal
;TI"-  include AbstractController::Rendering
;TI"#  include ActionView::Layouts
;TI"2  append_view_path "#{Rails.root}/app/views"
;TI"
;TI"  def index
;TI"    render "hello/index"
;TI"  end
;TI"	end
;T;0S;
;i;I"Redirection Helpers;T@o;	;[I"KTo add redirection helpers to your metal controller, do the following:;T@o;;[
I"5class HelloController < ActionController::Metal
;TI"-  include ActionController::Redirecting
;TI"4  include Rails.application.routes.url_helpers
;TI"
;TI"  def index
;TI"    redirect_to root_url
;TI"  end
;TI"	end
;T;0S;
;i;I"Other Helpers;T@o;	;[I"UYou can refer to the modules included in <tt>ActionController::Base</tt> to see ;TI"=other features you can bring into your metal controller.;T:
@fileI"#lib/action_controller/metal.rb;T:0@omit_headings_from_table_of_contents_below0o;;[;I"'lib/action_controller/test_case.rb;T;0;0;0[[[[I"Testing::Functional;To;;[;@U;0I"'lib/action_controller/test_case.rb;T[[I"
class;T[[:public[[I"action;TI"#lib/action_controller/metal.rb;T[I"controller_name;T@f[I"
dispatch;T@f[I"make_response!;T@f[I"middleware;T@f[I"new;T@f[I"use;T@f[:protected[[:private[[I"
instance;T[[;[[I"controller_name;T@f[I"params;T@f[I"params=;T@f[I"performed?;T@f[I"reset_session;T@f[I"response_body=;T@f[I"url_for;T@f[;[[;[[[U:RDoc::Context::Section[i0o;;[;0;0[@R@UI"ActionController;TcRDoc::NormalModule