lib/ramaze/template/remarkably.rb in ramaze-0.1.1 vs lib/ramaze/template/remarkably.rb in ramaze-0.1.2

- old
+ new

@@ -4,23 +4,29 @@ require 'remarkably/engines/html' module Ramaze module Template class Remarkably < Template - Controller.register_engine self, %w[ rem ] + ENGINES[self] = %w[ rem ] class << self + + # Entry point for Action#render + def transform action result, file = result_and_file(action) - result = transform_file(file, action) if file + result = transform_string(file, action) if file result.to_s end - def transform_file(file, action) - action.controller.instance_eval do + # Takes a string and action, sets args to action.args and then proceeds + # to instance_eval the string inside the action.instance + + def transform_string(string, action) + action.instance.instance_eval do args = action.params - instance_eval(file) + instance_eval(string) end end end end end