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 8225223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:20:43+00:00 2026-06-07T15:20:43+00:00

I want to create a menu like on this design A menu where you

  • 0

I want to create a menu like on this design

A menu where you choose how you sort and which category you want to be in. So when people press “featured designs”, all the iPhone designs with the field “featured” set to true, will be shown. I want people to be able to choose iPad-designs from the drop down-menu and then the featured iPad-designs should show up. I have no idea how to accomplish this though.

Can somebody give me a pointer?

I’m using rails 3.2.2 and mongoid.

MORE INFO

So I have the whole thing up and running at Meer.li. The menu is there and everything. The only thing I need to add, is a dropdown menu (like the ones you see in forms), so I will be able to choose whether I want to see iPhone, iPad, Windows designs etc.

I can create a drop down menu in rails, but how to use it as a way to query (like you do with a regular menu), is a whole other thing.

Model code:

field :featured, :type => Boolean, :default => false
field :project_number, :type => Integer, :default => 0
field :show, :type => Boolean, :default => true
field :full_member, :type => Boolean, :default => false
field :first_design, :type => Boolean, :default => false
field :option, :type => String 

default_scope desc(:created_at)
scope :full_member_and_show, where(full_member: true).and(show: true)
scope :not_full_member_and_show, where(full_member: false).and(show: true)

Controller code:

def newest
  designs = Design.full_member_and_show

  respond_to do |format|
    format.html
  end
end

So basically I want to add a .and(:option => “iPad”) to the end if the query whenever I choose another item from the drop down menu.

Does it make sense?

  • 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-07T15:20:46+00:00Added an answer on June 7, 2026 at 3:20 pm

    You’re close. When I do faceted searches, I first start by creating an empty array in my controller :

    @current_items = []
    

    Then I start adding items based on the params I’m getting. Now if you want to be really DRY here, you should be naming your Scopes off of the names of the faceted items in your form. Or vice versa, name your scopes, off of the form. In this way you could do something like this :

    params[:faceted_items].each do |item|
      @current_items << Object.where("#{item}" => true)
    end
    

    Then call @current_items as the array of returned items in your view.

    Update per comments

    Faceted Search is a search that can narrowed down by selecting and or selecting against different attributes.

    If that’s what you’re looking for, it sounds like you might want to embed a whole search feature. I recommend either sunspot-solr or sphinx. Both do an alright job at the task.

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

Sidebar

Related Questions

I want to create an Activity which shows a sort of menu a user
Hi I want to create a html structure like this: <ul class=menu> <li class=top><a></a></li>
I want to create an eclipse plugin which appears in the new menu like
I want to create a simple menu function which can call it example get_menu()
I want to create a Window like when a context menu pops up or
That show up on menu bar It's like this question: How to create a
I want to create a rectangle glass and a menu exact like that is
I want to create a custom menu, in the buttom of the screen, like
Im looking for help to create a menu like this This is the menu
I want to create this menu where on hover a dropdown menu appears and

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.