diff --git a/app/controllers/asciicasts_controller.rb b/app/controllers/asciicasts_controller.rb index 4c4cecb..38c5b95 100644 --- a/app/controllers/asciicasts_controller.rb +++ b/app/controllers/asciicasts_controller.rb @@ -1,6 +1,6 @@ class AsciicastsController < ApplicationController - before_filter :load_resource, :only => [:show, :raw, :example, :edit, :update, :destroy] + before_filter :load_resource, :only => [:show, :bare, :example, :edit, :update, :destroy] before_filter :ensure_authenticated!, :only => [:edit, :update, :destroy] before_filter :ensure_owner!, :only => [:edit, :update, :destroy] @@ -34,10 +34,10 @@ class AsciicastsController < ApplicationController end end - def raw + def bare response.headers.delete('X-Frame-Options') render locals: { page: BareAsciicastPresenter.build(asciicast, params) }, - layout: 'raw' + layout: 'bare' end def example diff --git a/app/views/asciicasts/raw.html.slim b/app/views/asciicasts/bare.html.slim similarity index 100% rename from app/views/asciicasts/raw.html.slim rename to app/views/asciicasts/bare.html.slim diff --git a/app/views/asciicasts/show.js.erb b/app/views/asciicasts/show.js.erb index 74381f0..527ab17 100644 --- a/app/views/asciicasts/show.js.erb +++ b/app/views/asciicasts/show.js.erb @@ -46,7 +46,7 @@ insertAfter(script, container); iframe = document.createElement('iframe'); - iframe.src = "<%= request.protocol %><%= request.host_with_port %>/a/<%= @asciicast.id %>/raw" + params(container, script); + iframe.src = "<%= request.protocol %><%= request.host_with_port %>/a/<%= @asciicast.id %>/bare" + params(container, script); iframe.id = "asciicast-iframe-<%= @asciicast.id %>"; iframe.name = "asciicast-iframe-<%= @asciicast.id %>"; iframe.scrolling = "no"; diff --git a/app/views/layouts/raw.html.slim b/app/views/layouts/bare.html.slim similarity index 100% rename from app/views/layouts/raw.html.slim rename to app/views/layouts/bare.html.slim diff --git a/config/routes.rb b/config/routes.rb index 035976c..f33b9ca 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,7 +5,8 @@ Asciinema::Application.routes.draw do resources :asciicasts, :path => 'a' do member do - get :raw + get :bare + get :raw, action: :bare get :example end end