def process_view(controller,controller_name,rendering_action,resp)
view_file_name = File.join("app","views",controller_name,rendering_action+".rhtml")
debug binding,"view_file_name"
if(File.exist?(view_file_name))
template = IO.read(view_file_name)
rhtml=ERB.new(template)
controller.content_for_layout=rhtml.result(controller.nil? ? nil : controller.get_binding)
layout_file_name = File.join("app","views","layouts",controller_name+".rhtml")
debug binding,"layout_file_name","$do_layout"
if($do_layout and File.exist?(layout_file_name))
template = IO.read(layout_file_name)
rhtml=ERB.new(template)
output=rhtml.result(controller.nil? ? nil : controller.get_binding)
resp.body=output
else
resp.body=controller.content_for_layout
end
resp['content-type']="text/html"
resp.cookies.replace($cookies)
else
resp.body=error_page("No view defined for #{rendering_action}");
end
end