class Surfer::Controller
Public Class Methods
new(args)
click to toggle source
# File lib/surfer/controller.rb, line 3 def initialize(args) @env = args[:env] @controller = args[:controller] @action = args[:action] @resource = args[:resource].downcase end
Public Instance Methods
env()
click to toggle source
# File lib/surfer/controller.rb, line 10 def env @env end
render()
click to toggle source
# File lib/surfer/controller.rb, line 14 def render pth=ROOT_PATH+"/app/views/#{@resource}/#{@action}.html.erb" puts pth content = File.read(pth) eruby = Erubis::Eruby.new(content) eruby.result(binding()) end