The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Pagination/Sorting/Filtering Automation

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Maxim Kulkin

Posts: 58
Nickname: hapk
Registered: Sep, 2006

Maxim Kulkin is developer in Selectosa Systems.
Pagination/Sorting/Filtering Automation Posted: Sep 10, 2006 9:03 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Maxim Kulkin.
Original Post: Pagination/Sorting/Filtering Automation
Feed Title: Software development
Feed URL: http://maximkulkin.blogspot.com/feeds/posts/full?alt=rss
Feed Description: Software development
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Maxim Kulkin
Latest Posts From Software development

Advertisement
After reading "Nested with_scope" post I thought that it would be handy way to create entity lists with sorting, pagination and filtering features.

You could setup an around filter that would automatically paginate and filter your model entities.


class MyController < ApplicationController
around_filter SearchFilter.new(:products, :search_string), :only => :list
around_filter PagintationFilter.new(:products, 20), :only => :list

def list
@products = Product.find(:all)
end
end


Those could be wrapped in some kind of DSL (class methods).

The problem with similar sorting filter is that AR::Base::with_scope doesn't allow :order param.

Read: Pagination/Sorting/Filtering Automation

Topic: How-to: Ruby on Rails and Rmagick Crop, Resize, Rotate, Thumbnail and Upload Images Previous Topic   Next Topic Topic: Danes On Rails

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use