Skip to content

Instantly share code, notes, and snippets.

@samleb
Created February 6, 2011 03:30
Show Gist options
  • Select an option

  • Save samleb/813088 to your computer and use it in GitHub Desktop.

Select an option

Save samleb/813088 to your computer and use it in GitHub Desktop.
Use ActionView 3 outside of request/response cycle
class View < ActionView::Base
include Your::Application.routes.url_helpers
include ApplicationController._helpers
delegate :config, :to => ActionController::Base
end
# For some reason `render :partial => 'foo/bar'` doesn't work...
View.new.render :file => 'app/views/foo/_bar.html.haml'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment