module Roda::RodaPlugins::ViewSubdirs::InstanceMethods
Public Instance Methods
set_view_subdir(v)
click to toggle source
Set the view subdirectory to use. This can be set to nil to not use a view subdirectory.
# File lib/roda/plugins/view_subdirs.rb, line 38 def set_view_subdir(v) @_view_subdir = v end
Private Instance Methods
template_path(template, opts)
click to toggle source
Override the template name to use the view subdirectory if the there is a view subdirectory and the template name does not contain a slash.
Calls superclass method
# File lib/roda/plugins/view_subdirs.rb, line 47 def template_path(template, opts) t = template.to_s if (v = @_view_subdir) && t !~ /\// template = "#{v}/#{t}" end super end