Skip to content

Instantly share code, notes, and snippets.

@wycats
Created February 18, 2010 06:30
Show Gist options
  • Save wycats/307411 to your computer and use it in GitHub Desktop.
Save wycats/307411 to your computer and use it in GitHub Desktop.
class RenderDirectly < ActionController::Base
include ActionController::Rendering
include AbstractController::Layouts
append_view_path Rails.root.join("app", "views").to_s
layout "application"
def index
render *env["generic_views.render_args"]
end
end
module GenericActions
module Render
def render(*args)
app = RenderDirectly.action(:index)
lambda do |env|
env["generic_views.render_args"] = args
app.call(env)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment