Rails code: render a view from a model
require 'controllers/application'
viewer = Class.new(ApplicationController)
path = ActionController::Base.view_paths rescue ActionController::Base.view_root
template = 'full/path/to/your/view.html.erb'
html_string=ActionView::Base.new(path, assigns, viewer).render(template)