Class: ActionController::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/masterview/extras/app/controllers/masterview_controller.rb,
lib/masterview/rails_ext/action_controller_reparse_checking.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#masterview_render_file_with_layout(template_path, layout_path, local_assigns = {}) ⇒ Object

:nodoc:



264
265
266
267
268
269
270
271
272
273
274
# File 'lib/masterview/extras/app/controllers/masterview_controller.rb', line 264

def masterview_render_file_with_layout( template_path, layout_path, local_assigns={} )
  # Implementation based on ActionController::Layout#render_with_a_layout
  use_full_path = false  #we already have full path, we don't want rails template_base prefixed
  add_variables_to_assigns
  content_for_layout = @template.render_file(template_path, use_full_path, local_assigns)
  # following was needed in ActionController::Layout because of the way it does its overrides
  #erase_render_results  #??do we need to do this??  Is there any downside to doing so??!
  #add_variables_to_assigns
  @template.instance_variable_set('@content_for_layout', content_for_layout)
  render_text(@template.render_file(layout_path, use_full_path, local_assigns))
end

#process(request, response, method = :perform_action, *arguments) ⇒ Object

:nodoc:



20
21
22
23
24
25
26
# File 'lib/masterview/rails_ext/action_controller_reparse_checking.rb', line 20

def process(request, response, method = :perform_action, *arguments) #:nodoc:
  MasterView::TemplateWatcher.check_updated(MasterView::IOMgr.template, MasterView::TemplateFilenamePattern ) do |mio|
    MasterView::Parser.parse_mio( mio, MasterView::IOMgr.erb )
  end
  MasterView::AutoCopy.copy_all_updated_files
  process_pre_mv(request, response, method, *arguments)
end

#process_pre_mvObject

Install hook to enable MasterView to detect and automatically reparse changed templates during Rails request dispatching.



19
# File 'lib/masterview/rails_ext/action_controller_reparse_checking.rb', line 19

alias :process_pre_mv :process