-
-
Save benhoskings/603833 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
# One thing to add: | |
# * action_has_layout? method (if you have one, combine them) | |
# | |
class ApplicationController < ActionController::Base | |
# ... | |
private | |
def action_has_layout? | |
!request.xhr? && super | |
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
# A long time ago, in an action far far away | |
def index | |
# ... | |
respond_to do |wants| | |
wants.inline { | |
# ideally use your own view (index.inline.erb) | |
render :text => 'success!' | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment