Skip to content

Instantly share code, notes, and snippets.

@fellix
Created April 25, 2012 12:28
Show Gist options
  • Save fellix/2489399 to your computer and use it in GitHub Desktop.
Save fellix/2489399 to your computer and use it in GitHub Desktop.
class SomethingController < ApplicationController
respond_to :html, :json
def show
@something = Something.find(params[:id])
respond_with(@something) do |format|
format.html { render :layout => 'report' }
end
end
end
class SomethingController < ApplicationController
respond_to :html, :json
layout 'report'
def show
@something = Something.find(params[:id])
respond_with(@something)
end
end
@sobrinho
Copy link

A segunda opção vai forçar o layout report em todas as actions, quero só no show :P

@fellix
Copy link
Author

fellix commented Apr 25, 2012

vc não tinha dito isso antes :P

@sobrinho
Copy link

hahahaha!

por isso que estava dentro do def show :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment