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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:50:29+00:00 2026-05-11T11:50:29+00:00

the following is my dropdown to select chat rooms: <% form_for :chat_room do |form|

  • 0

the following is my dropdown to select chat rooms:

<% form_for :chat_room do |form| %>           <%= form.select(:title, @chat_rooms.collect! {|x| x.title},{:include_blank =>'select a chat room'}) %>         <% end %> 

My routes are:

ActionController::Routing::Routes.draw do |map|    map.resource :account, :controller => 'users'   map.resources :poll   map.resources :users,:has_many => :stories   map.resources :chat_rooms ,:member => {:create_message => :post},:collection => {:ajax_updater=>:get}   map.logout 'logout', :controller => 'user_sessions', :action =>'destroy'   map.resource :user_session   map.resource  :welcome   map.connect '/', :controller => 'welcome', :action => 'index'    map.connect ':controller/:action/:id'   map.connect ':controller/:action/:id.:format' end 

On changing values in the drop down I want to navigate to a particular chatroom chosen. How do I do that?

  • 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. 2026-05-11T11:50:29+00:00Added an answer on May 11, 2026 at 11:50 am

    one (simple) way would be to add the :onchange parameter to the select helper

    form.select(:title, @chat_rooms.collect! {|x| [x.title, x.id] },{:include_blank =>'select a chat room'}, :onchange => 'window.location.href = 'chat_rooms/' + this.getAttribute('value')') 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which loads a xml file to populate a dropdown.
I'm creating a dropdown box dynamically in jQuery by appending html as follows: .append(<br><SELECT
I have stolen/found/used/written and edited the following widget of jQuery for a auto-completing dropdown.
I have the following JQuery, I want to display the default divarea1 visible when
I have the following code to hide/show elements depending on what value is selected
I have the following code. What I'm trying to do is to show a
EDIT: The drop down menus have the following listed in them: Typing Course Daily
I have the following code to validate some fields on a sharepoint newform.aspx. To
i have an asp.net mvc page and i want to have a dropdown list
jsFiddle I'm using a jQuery plugin that allows the user to draw boxes in

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.