我在控制器中有这样的动作:
class ArtLookupsController < ApplicationController
def search
****
@pre_articles_result = ArtLookup.search(s_query)
@articles_result = Kaminari.paginate_array(@pre_articles_result).page(params[:page]).per(70)
***
end
end
和路线:
match '/search' => 'art_lookups#search', :as => :search_art_lookup
部分观点:
= paginate @articles_result
当我插入一些文本进行搜索时,我得到结果,一切正常,受限于 70 个条目(链接是:* *:3000/搜索)....但是当我点击其他页面时,例如 3-rd 链接是比如::3000/art_lookups/search?authenticity_token=ve%2FrRQoXIHPQ9BAN07RLCMF59bB0HVlEcNn%2Flxd4f64%3D&page=3&search=1234&utf8=✓</p>
我得到错误:Unknown action The action 'show' could not be found for ArtLookupsController
但是为什么?我该如何解决这个问题?所以如果我点击页码,我会得到其他结果......?我也试过match '/search(/:page)' => 'art_lookups#search', :as => :search_art_lookup