Rails 4 - get和post的宁静索引动作

时间:2016-02-26 13:55:39

标签: ruby-on-rails-4 routing

我做了搜索'获取和发布的操作  的

resources :wba_partners do
    collection do
      match "wba_partners/search" => "wba_partner#search", via: [:get, :post]
    end
  end

对于POST方法,它应该是' / wba_partners / search'。 对于Get方法,它抛出错误:

ActiveRecord::RecordNotFound in WbaPartnersController#show
Couldn't find WbaPartner with 'id'=search

知道如何解决这个问题吗?感谢。

0 个答案:

没有答案