class ActionView::FileSystemResolver


* :handlers - possible handlers (for example erb, haml, builder…)
* :variants - possible request variants (for example phone, tablet…)
* :formats - possible request formats (for example html, json, xml…)
* :locale - possible locale versions
* :action - name of the action
* :prefix - usually the controller path
following variables:
Pattern has to be a valid glob string, and it allows you to use the
==== Pattern format and variables
)
“:prefix{/:locale}/:action{.:formats,}{+:variants,}{.:handlers,}”
Rails.root.join(“app/views”),
ActionController::Base.view_paths = FileSystemResolver.new(
to configure ActionController::Base.view_paths in an initializer, for example:
In order to use any of the customized resolvers above in a Rails application, you just need
If you don’t specify a pattern then the default will be used.
FileSystemResolver.new(“/path/to/views”, “:prefix/{:formats/,}:action{.:locale,}{.:formats,}{+:variants,}{.:handlers,}”)
‘users/new.js` from `users/js/new.erb` or `users/new.js.erb`, etc.
eg. `users/new.html` will be loaded from `users/html/new.erb` or `users/new.html.erb`,
This one allows you to keep files with different formats in separate subdirectories,
FileSystemResolver.new(“/path/to/views”, “:prefix/:action{.:locale,}{.:formats,}{+:variants,}{.:handlers,}”)
looking for `users/new` it will produce query glob: `users/new{.{en},}{.{html,js},}{.{erb,haml},}`
Default pattern, loads views the same way as previous versions of rails, eg. when you’re
==== Examples
resolving pattern. Such pattern can be a glob string supported by some variables.
A resolver that loads files from the filesystem. It allows setting your own

def eql?(resolver)

def eql?(resolver)
  self.class.equal?(resolver.class) && to_path == resolver.to_path
end

def initialize(path, pattern=nil)

def initialize(path, pattern=nil)
  raise ArgumentError, "path already is a Resolver class" if path.is_a?(Resolver)
  super(pattern)
  @path = File.expand_path(path)
end

def to_s

def to_s
  @path.to_s
end