lib/ramaze/template/erubis.rb in ramaze-0.1.0 vs lib/ramaze/template/erubis.rb in ramaze-0.1.1
- old
+ new
@@ -16,20 +16,15 @@
# Takes a controller and the options :action, :parameter, :file and :binding
#
# Builds a template out of the method on the controller and the
# template-file.
- def transform controller, options = {}
- action, parameter, file, bound = *super
+ def transform action
+ template = reaction_or_file(action)
- reaction = controller.send(action, *parameter)
- template = reaction_or_file(reaction, file)
-
- return '' unless template
-
eruby = ::Erubis::Eruby.new(template)
- eruby.init_evaluator(:filename => file) if file
- eruby.result(bound)
+ eruby.init_evaluator(:filename => (action.template || __FILE__))
+ eruby.result(action.binding)
end
end
end
end