我的控制器:
def index
@search = Onj.search do
fulltext params [:search]
end
@onjs = @search.results
logger.debug params
end
index.html.erb:
<%= form_tag onj_index_path, :method => :get do %>
<p>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "Search", :name => nil %>
</p>
<% end %>
错误是:
ArgumentError in OnjController#index
wrong number of arguments (1 for 0)
" def index
@search = Onj.search do
fulltext params [:search]
end
@onjs = @search.results "
答案 0 :(得分:0)
在索引方法中删除第3行params [:search]
中的空格。