Last active
November 20, 2015 20:01
-
-
Save bsgreenb/e86b1b69d18b83f893ce to your computer and use it in GitHub Desktop.
This file contains 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
def generic_render(path, flash_hash = {}) | |
flash_hash.each do |k, v| | |
flash.now[k] = v | |
end | |
if xhr? | |
@modal_path = path | |
render 'shared/modal_replace' | |
else | |
render path | |
end | |
end | |
def generic_redirect(path, flash_hash = {}) | |
flash_hash.each do |k, v| | |
flash[k] = v | |
end | |
if xhr? | |
@redirect_path = path | |
render 'shared/redirect' | |
else | |
redirect_to path | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment