class ProductsController < ApplicationController
layout :products_layout
def show
@product = Product.find(params[:id])
end
private
def products_layout
@current_user.special? ? "special" : "products"
end
end
这里什么时候products_layout
执行方法?我看不到调用该方法的任何地方,products_layout
那么如何:products_layout
定义符号?