Sha256: be2b97110b9137ecd6982be674d4168a574c6e43c3a07f9284c26d9fac9f48ea
Contents?: true
Size: 1009 Bytes
Versions: 7
Compression:
Stored size: 1009 Bytes
Contents
require File.join(File.dirname(__FILE__), 'file_base') module Mack module Rendering # :nodoc: module Type # :nodoc: # Pretty much the same thing as Mack::Rendering::Type::Action, except the template is relative to the app/views directory, # and not the app/views/#{controller name} directory like action. class Template < Mack::Rendering::Type::FileBase # See Mack::Rendering::Type::FileBase render_file for more information. # # The path to the file is built like such: # app/views/#{template (show, index, etc...)}.#{format (html, xml, js, etc...)}.#{extension defined in the engine} # Example: # <%= render(:template, "users/show") %> # => app/views/users/show.html.erb def render t_file = File.join(Mack.root, "app", "views", "#{self.render_value}.#{self.options[:format]}") render_file(t_file, :template) end end # Template end # Type end # Rendering end # Mack
Version data entries
7 entries across 7 versions & 1 rubygems