Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6720363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:12:12+00:00 2026-05-26T09:12:12+00:00

I am learning ruby on rails. So, I created a sample application in which

  • 0

I am learning ruby on rails. So, I created a sample application in which I am displaying some stuffs. Now I want to add the functionality of narrowing down items depending upon user’s selection like changing price ranges, selecting type and so on.

Please suggest some articles / tutorials which can help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:12:12+00:00Added an answer on May 26, 2026 at 9:12 am

    Do this through model finders.

    e.g.
    http://railscasts.com/episodes/37-simple-search-form

    http://railscasts.com/episodes/111-advanced-search-form

    This tutorial is about scopes… http://railscasts.com/episodes/111-advanced-search-form but is very relevant and actually has some of the simplest examples.

    One of the biggest gains from doing the search in the model (as opposed to the controller) is testing. You can now have unit tests, e.g. rspec model tests if you use rspec, just within the model.

    Perhaps you want dynamic scope?
    Dynamic scopes allow filtering on the fly and method chaining. For example:

    Order.scoped_by_customer_id(12)
    Order.scoped_by_customer_id(12).find(:all,
      :conditions => "status = 'open'")
    Order.scoped_by_customer_id(12).scoped_by_status("open")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning Ruby on Rails. I'm using some associations (has_many :through, ...) But i'm
I'm starting learning Ruby on Rails. So my application, like every Rails app, has
So I'm getting started learning Rails. Now that Rails 3 is out, I want
I am modifying a Ruby Rails application - Redmine. I want to modify a
Now about 2 weeks into learning Ruby and Rails, I've found myself using the
I have a Rails application with several models-views-controllers which have some similar characteristics, for
As part of learning ruby/rails, I'm trying to implement http://github.com/professionalnerd/simple-private-messages into my application from
I am learning ruby on rails using aptana studio 3. I created a view
A few years back, I started learning Ruby/Rails from some beginner's guide for Rails.
So right now I'm learning Ruby on Rails, and I'm working through the book

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.