From 1413c9b1d51414b72c4efb8583a3acae04a481dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 19 Mar 2011 16:06:50 -0700 Subject: Improved resolver docs a bit --- actionpack/lib/action_view/template/resolver.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_view/template') diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index f9c52e3228..6c1063592f 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -198,6 +198,14 @@ module ActionView # # If you don't specify pattern then the default will be used. # + # In order to use any of the customized resolvers above in a Rails application, you just need + # to configure ActionController::Base.view_paths in an initializer, for example: + # + # ActionController::Base.view_paths = FileSystemResolver.new( + # Rails.root.join("app/views"), + # ":prefix{/:locale}/:action{.:formats,}{.:handlers,}" + # ) + # # ==== Pattern format and variables # # Pattern have to be a valid glob string, and it allows you to use the @@ -206,8 +214,8 @@ module ActionView # * :prefix - usualy the controller path # * :action - name of the action # * :locale - possible locale versions - # * :formats - possible file formats - # * :handlers - possible handlers + # * :formats - possible request formats (for example html, json, xml...) + # * :handlers - possible handlers (for example erb, haml, builder...) # class FileSystemResolver < PathResolver def initialize(path, pattern=nil) -- cgit v1.2.3