lib/masterview/extras/app/controllers/masterview_controller.rb in masterview-0.2.4 vs lib/masterview/extras/app/controllers/masterview_controller.rb in masterview-0.2.5
- old
+ new
@@ -45,10 +45,11 @@
#++
#
require 'masterview/extras/sample_templates'
class MasterviewController < ApplicationController
+ include MasterView::DefaultGenerateMIOFilter
before_filter :check_authorization, :except => [ :access_not_allowed ]
ENABLE_ADMIN_LAYOUT = false #:nodoc: #UNDER CONSTRUCTION - fine idea, but doesn't work yet [DJL 03-Jun-2006]
@@ -146,11 +147,13 @@
# interact, test template src, view results
def interact
@results = []
@src = params[:src]
if @src
- sh_mio = MasterView::StringHashMIOTree.new({}, '.rhtml')
- MasterView::Parser.parse( @src, { :output_mio_tree => sh_mio, :omit_comment => true } )
+ sh_mio = MasterView::StringHashMIOTree.new({}, MasterView::LoadedConfiguration.generated_file_default_extension )
+
+ src_with_default_gen = add_default_gen_if_needed(@src) # apply a default generate
+ MasterView::Parser.parse( src_with_default_gen, { :output_mio_tree => sh_mio, :omit_comment => true, :template_pathname => 'YOUR_TEMPLATE_PATH_HERE' } )
@results = sh_mio.string_hash.sort.collect do |file,rhtml|
os = OpenStruct.new
os.file = file
os.rhtml = rhtml
os