1

Say I have the following:

class ProjectsController < ApplicationController
  responds_to :html

  def show
    @project = Project.find(params[:id])
    respond_with(@project)
  end
end

class UsersController < ApplicationController
  responds_to :html

  def show
    @user = User.find(params[:id])
    respond_with(@user)
  end
end

Is there a method I can use to reference the object passed to respond_with in the layouts/application.html.erb template without needing to know the assigned variable's name?

Thanks.

robertwbradford
  • 6,181
  • 9
  • 36
  • 61

1 Answers1

0

No there is no method(at least I didn't hear about such method). But if you want you can look here, it is pretty nice solution: Decent exposure

I hope I helped you alittle.

bor1s
  • 4,081
  • 18
  • 25