Module: Zafu::ControllerMethods

Includes:
Common
Defined in:
lib/zafu/controller_methods.rb

Defined Under Namespace

Modules: Common

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Common

#fquote, #get_template_text, #template_url_for_asset, #zafu_context

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/zafu/controller_methods.rb', line 3

def self.included(base)
  base.helper Common
  if RAILS_ENV == 'development'
    base.class_eval do
      def render_for_file_with_rebuild(template_path, status = nil, layout = nil, locals = {}) #:nodoc:
        path = template_path.respond_to?(:path_without_format_and_extension) ? template_path.path_without_format_and_extension : template_path
        logger.info("Rendering #{path}" + (status ? " (#{status})" : '')) if logger
        # if params[:rebuild] == 'true'
          t = self.view_paths.find_template(template_path, 'html')
          t.previously_last_modified = nil
        # end
        render_for_text @template.render(:file => template_path, :locals => locals, :layout => layout), status
      end
      alias_method_chain :render_for_file, :rebuild
    end
  end
end

Instance Method Details

#zafu_node(name, klass) ⇒ Object



21
22
23
# File 'lib/zafu/controller_methods.rb', line 21

def zafu_node(name, klass)
  zafu_context[:node] = Zafu::NodeContext.new(name, klass)
end