私が次を持っているとしましょう:
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
割り当てられた変数の名前を知らなくても、layouts / application.html.erbテンプレートでrespond_withに渡されたオブジェクトを参照するために使用できるメソッドはありますか?
ありがとう。