Skip to content

Instantly share code, notes, and snippets.

@maiha
Created June 25, 2009 06:48
Show Gist options
  • Save maiha/135732 to your computer and use it in GitHub Desktop.
Save maiha/135732 to your computer and use it in GitHub Desktop.
module ApplicationHelper
def partial(file, opts = {})
opts[:partial] = file
controller.__send__ :render_to_string, opts
end
end
class FooController < ApplicationController
def confirm
...
render :update do |page|
html = partial("foo")
logger.debug "created partial content: #{html}" # easy for debug!
page[:record].replace_html html
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment