Created
June 25, 2009 06:48
-
-
Save maiha/135732 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ApplicationHelper | |
| def partial(file, opts = {}) | |
| opts[:partial] = file | |
| controller.__send__ :render_to_string, opts | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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