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
好吧,對不起,沒有正確讀取 –