简体   繁体   中英

Rails 2.2.2 to Rails 3 - Sortable

I am migrating an old Rails 2.2.2 project to Rails 3 and I have been fixing things along the way - The latest is below.

undefined method `sortable'

Apparently Rails 2.2.2 had a method or keyword called "sortable"? Is that part of the Rails 2.2.2 framework?

Does the same functionality exist in Rails 3?

How do I change this over to work in Rails 3?

Thanks

<tr>
            <th style="padding-left:20px;"><%= sortable "name", "Name" %></th>
            <th><%= sortable "company", "Company" %></th>
            <th>Email</th>
            <th><%= sortable "created_at", "Created On" %></th>
        </tr>

我认为您正在使用handles_sortable_columns gem, 这是如何为Rails 3设置此gem

我认为,Ryan Bates的这段视频课http://railscasts.com/episodes/228-sortable-table-columns可以为您提供帮助。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM