U:RDoc::NormalModule[iI"Helpers:EFI"ActionController::Helpers;F0o:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"iThe Rails framework provides a large number of helpers for working with +assets+, +dates+, +forms+, ;TI"^+numbers+ and model objects, to name a few. These helpers are available to all templates ;TI"by default.;To:RDoc::Markup::BlankLine o;	;[	I"tIn addition to using the standard template helpers provided in the Rails framework, creating custom helpers to ;TI"qextract complicated logic or reusable functionality is strongly encouraged. By default, the controller will ;TI"pinclude a helper whose name matches that of the controller, e.g., <tt>MyController</tt> will automatically ;TI"include <tt>MyHelper</tt>.;T@o;	;[I"sAdditional helpers can be specified using the +helper+ class method in <tt>ActionController::Base</tt> or any ;TI"'controller which inherits from it.;T@S:RDoc::Markup::Heading:
leveli	:	textI"Examples;To;	;[I"lThe +to_s+ method from the Time class can be wrapped in a helper method to display a custom message if ;TI"the Time object is blank:;T@o:RDoc::Markup::Verbatim;[
I" module FormattedTimeHelper
;TI"C  def format_time(time, format=:long, blank_message="&nbsp;")
;TI"9    time.blank? ? blank_message : time.to_s(format)
;TI"  end
;TI"	end
;T:@format0o;	;[I"^FormattedTimeHelper can now be included in a controller, using the +helper+ class method:;T@o;;[I"5class EventsController < ActionController::Base
;TI""  helper FormattedTimeHelper
;TI"  def index
;TI"$    @events = Event.find(:all)
;TI"  end
;TI"	end
;T;0o;	;[I"kThen, in any view rendered by <tt>EventController</tt>, the <tt>format_time</tt> method can be called:;T@o;;[
I"$<% @events.each do |event| -%>
;TI"  <p>
;TI"K    <%= format_time(event.time, :short, "N/A") %> | <%= event.name %>
;TI"  </p>
;TI"<% end -%>
;T;0o;	;[I"aFinally, assuming we have two event instances, one which has a time and one which does not, ;TI"%the output might look like this:;T@o;;[I"423 Aug 11:30 | Carolina Railhawks Soccer Match
;TI".N/A | Carolina Railhaws Training Workshop;T;0:
@fileI"+lib/action_controller/metal/helpers.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[ [ [[I" AbstractController::Helpers;To;;[ ;@G;0I"+lib/action_controller/metal/helpers.rb;T[[I"
class;T[[:public[ [:protected[ [:private[ [I"instance;T[[;[ [;[ [;[ [[I"ActiveSupport::Concern;To;;[ ;@G;0@O[U:RDoc::Context::Section[i 0o;;[ ;0;0[@GI"-lib/action_controller/metal/renderers.rb;TI"ActionController;FcRDoc::NormalModule