Created
July 16, 2015 11:03
-
-
Save clowder/2202afd9efdf37aa6923 to your computer and use it in GitHub Desktop.
Admin preview user content
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 Admin::SpacesController < AdminController | |
def preview | |
space = Space.find(params[:id]) | |
prepend_view_path 'app/views/spaces' # Ensures our `:template` is found. | |
lookup_context.prefixes = ['spaces', 'application'] # Ensures that our templates partials are pulled from the right places. | |
render template: 'show', layout: 'application', locals: { space: space } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment