Ruby on rails 3 将分页在视图中显示不需要的信息

Ruby on rails 3 将分页在视图中显示不需要的信息,ruby-on-rails-3,haml,will-paginate,Ruby On Rails 3,Haml,Will Paginate,我不知道这是什么时候发生的,但最近我的客户注意到will_paginate的寻呼机有奇怪的输出。以下生成的视图片段显示了意外情况: {"tag"="" 在标签属性和非常难看的调试信息 <div class="pagination" {"tag"=""> "Black & White", "action"=>"index", "controller"=>"photos"}="{:order=>nil}"> <span class="pre

我不知道这是什么时候发生的,但最近我的客户注意到will_paginate的寻呼机有奇怪的输出。以下生成的视图片段显示了意外情况:

{"tag"=""
在标签属性和非常难看的调试信息

<div class="pagination" {"tag"="">
  "Black & White", "action"=>"index", "controller"=>"photos"}="{:order=>nil}">
  <span class="previous_page disabled">← Previous</span>
  <em class="current">1</em>
  <a href="/photos?page=2&tag=Black+%26+White" rel="next">2</a>
  <a class="next_page" href="/photos?page=2&tag=Black+%26+White" rel="next">Next →</a>
</div>
我使用Ruby 1.9.3、Rails 3.2.16和haml 4.0.2


我不知道如何解决这个问题。

可能是因为您传入了变量,所以它对params做了一些奇怪的事情。我想你的意思是:

= will_paginate @photos, :params => {:order=>params['order']}

也许它对params做了一些奇怪的事情,因为您传入了变量。我想你的意思是:

= will_paginate @photos, :params => {:order=>params['order']}

已修复,问题是由缺少冒号引起的。已修复,问题是由缺少冒号引起的。