From f461f24326c328aa4caecb64186f669a61941dc0 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Sun, 19 Oct 2014 13:25:51 +0200 Subject: [PATCH] No need for before_action --- app/controllers/api/asciicasts_controller.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/asciicasts_controller.rb b/app/controllers/api/asciicasts_controller.rb index cd5ad61..a35e741 100644 --- a/app/controllers/api/asciicasts_controller.rb +++ b/app/controllers/api/asciicasts_controller.rb @@ -1,8 +1,6 @@ module Api class AsciicastsController < BaseController - before_action :load_asciicast, only: [:show] - respond_to :html, :js, only: [:show] attr_reader :asciicast @@ -17,6 +15,8 @@ module Api end def show + @asciicast = Asciicast.find(params[:id]) + respond_with(asciicast) do |format| format.html do allow_iframe_requests @@ -29,10 +29,6 @@ module Api private - def load_asciicast - @asciicast = Asciicast.find(params[:id]) - end - def attributes AsciicastParams.build(params[:asciicast], request.user_agent) end