在太阳黑子中错误的参数数量(1表示0)

时间:2014-03-20 12:27:39

标签: ruby-on-rails

我的控制器:

   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 "

1 个答案:

答案 0 :(得分:0)

在索引方法中删除第3行params [:search]中的空格。