class PostsController < ApplicationController
...
def show
respond_to do |format|
# If v2=enabled is in the URL (https://www.example.com/posts/1?v2=enabled) render the new layout.
if params[:v2] == "enabled"
format.html { render template: 'posts/show_v2' }
# Otherwise load the existing layout.
else
format.html { render template: 'posts/show' }
end
end
end
end
Last active
June 2, 2021 20:04
-
-
Save stevepolitodesign/ff7d4a6c77b46f56a3f8cd1ba1274628 to your computer and use it in GitHub Desktop.
Preview a new layout with params
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment