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



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

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



23
24
25
# File 'lib/zafu/controller_methods.rb', line 23

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