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

  • SEARCH
  • Home
  • 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 8158819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:44:17+00:00 2026-06-06T17:44:17+00:00

I am using Ruby on Rails 3.2.2 and ruby 1.9 . I do have

  • 0

I am using Ruby on Rails 3.2.2 and ruby 1.9 .

I do have a model tender and one of the attributes is status. On the index page, the first time it is loaded, it displays the tender data based on the user’s company who already logged in (it will also display the status).

I want to have a filter by combo box which will contain all the statuses (Initiated, Closed, Won ..etc )so when the user changes the filter by, I want to change the table data as well by submitting the status to a controller which will filter out tenders based on the status. How can I do that? How about using Ajax (since the only thing that is changed is the table data not the whole page)?

I also have different filter by options other than the status, like by the bid_amount (also one of the attributes). How can I combine the bid_amount filter by data with the status (i.e if the user wants to display closed statuses which has a bid amount b/n 10,000-100,000). I won’t have a problem writing the query on the controller but I don’t know how to use it from the view.

Since ruby doesn’t have an Enum like Java I also load those statuses from an array in the model class. Is that a good way of doing it?

Any recommendations will also be appreciated.

  • 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-06-06T17:44:18+00:00Added an answer on June 6, 2026 at 5:44 pm

    The rails way of executing things via ajax is using :remote => true.
    A simple search will get you quite a few tutorials.

    Non ajax solution might be structured like this.

     def index
        if params[:status] || params[:bid_amount]
             # Tailored Query
        else
             # Generic Query
        end
     end
    

    View

     <%= form_tag index_route_path do %>
         # Statuses that are pulled form symbolize via Model
         # Bid Amount Boxes
     <% end %>
    
     # Display query results 
    

    ALso I would checkout the gem Symbolize, to help you out with your Enums
    https://github.com/nofxx/symbolize

    Its still not super clear to me what our looking to do. If your looking to populate your bid amount boxes based on what the user sets the status too. You could trigger a form submit onChange, and use a helper to populate your bid_amount values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Ruby on Rails with Active Admin and I have one model
I'm using ruby 1.9.2 and rails 3.2.2. I have a 'domain' model (domain.rb): class
I have 2 attributes opening_date and closing_date in a Tender model. On the index
I have created a blog application using Ruby on Rails which includes the ability
I am using Ruby on Rails 3.2.2, cucumber-rails-1.3.0, rspec-rails-2.8.1, capybara-1.1.2 and factory_girl-2.6.3. I have
I have built a very simple blog application using Ruby on Rails. New to
I have a Rails 3.2.2 application using Ruby version 1.9.2. I have created basic
Using Ruby 1.8.7-p358, Rails 3.0.12, gem responder, gem simple-form; jquery_ujs.js I have a form
we have a mixed development environment using ASP.NET MVC and Ruby on Rails. We
I have a deployment using: rails 2.3.2 ruby 1.8.7 mysql db and 3 mongrel

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.