1
我想有些东西像下面Ruby Rails:是否有可能在ActionController中重载索引方法?
class CompanyController < ApplicationController
def index
#return all of companies
end
def index
#return companies based filter on company :name, :location, :type (any combination of these)
end
end
我已经按照你的方式实现了这一点。你还可以告诉我或参考链接如何重载基于输入参数的索引方法是否:id或:公司 –
你不能,只需使用if语句 – errorhandler
好吧,对不起,没有正确读取 –