similar to: Obtain selected value from collection_select

Displaying 20 results from an estimated 20000 matches similar to: "Obtain selected value from collection_select"

2007 Apr 15
0
how to obtain the selected value from collection_select
Hi, I''m want to obtain the selected value from collection_select and to use it to display something from the same table or other tables. There is my short code : <TR> <TD><label for="country">country name</label></TD> <TD><%= collection_select(:country, :country_id, @countries, :id, :name) %></TD> </TR> by selecting a
2007 May 09
0
How can I specify the selected value in collection_select when fieldname different than variable?
Hi all, I have a relatively simple scenario. I have a form that can have a list of multiple phone objects in it. I''m trying to get the edit and entry screens to work with unique field names. I have entry and record creation working, but I''m still working on edit. Is it possible for me to specify the value of the selected index to the "collection_select" method via
2009 Jan 15
2
collection_select not selecting default value
Hi, I''m trying to create a dropdown using collection_select. However, I cant seem to get it to select the right option by default. In my controller I have a setup like this: @content = Content.new @content.selection_id = 3 @selections = Selection.find(:all) In my view I have: <% form_for :content, @content, :url => { :action => ''create'' } do |f| %>
2007 Jan 11
4
collection_select - how to set selected options?
In a form, I am trying to use collection_select with multiple=true, like so: collection_select(:user, :roles, Role.find(:all), ''id'', ''name'', {}, :multiple => true) %> My multiple select box is rendered fine, but... I want the select to have the current role options for the user pre-selected when I view it. So if there are five roles in the database and
2009 Jan 23
0
:selected option is ignored for collection_select
Is there a workaround for this issue yet? I just wasted a ton of time trying to debug this in an AJAX form. http://rails.lighthouseapp.com/projects/8994/tickets/1037-selected-option-is-ignored-for-collection_select ----------- Reported by YoNoSoyTu | September 12th, 2008 @ 11:07 PM | in 2.3 The :selected option in collection_select is ignored. This patch uses the value of :selected option if
2012 Apr 02
0
active admin saving selection from collection_select and passing to controller
hi i am using active admin for my app i have a partial with a drop down list where the menu and recipe are populated this page is to group the recipe in a menu _menu_recipe.html.erb <%= semantic_form_for [:admin, @menu_recipe] do |f| %> <p> <%= f.collection_select :recipe_id, Recipe.all,:id,:name,:prompt => true%> </p> <p> <%= f.collection_select :menu_id,
2008 Jan 12
1
Collection_Select not showing Selected option
Hi, I''m having some problem with getting collection_select to return the current value when editing a record. According to everything I''ve seen, there was an issue but it''s been fixed, but I can''t figure out why it isn''t returning the current value as a selected option. I''ve checked the table structures, and both the call_driver.product_line_id
2006 May 23
0
return value from collection_select
Hi everyone I am trying to get the return value from collection_select helper method. Here is what I did collection_select(''product'', ''product_id'', @products, ''id'', ''name'', {}, {:onchange => remote_function(:url => {:action => :myFunction}, :with => "this[this.selectedIndex].value")}) then in my
2008 Jul 30
0
getting value of collection_select
<%= collection_select(:post, :id, @posts, :id, :title, options ={:prompt => "-Select categories-"}, :class=>"category_dropdown_list") %> Hi, how would I send the value of the selected item in the collection_select? I''m trying to use an observe_field for an input, and in the action I''ll perform the steps corresponding to the collection_select.
2011 Nov 10
1
Auto populate text_fields based on selected item from another collection_select
Hello people I''m trying to figured this out, but I still can''t do it. I have a rails 3 app, I''m working with invoices and payments. In the form for payments I have a collection_select where I display all the invoices number (extracted from a postgres database), and what I''m trying to do is when i select an invoice autopopulate others text_fields (provider,
2007 Nov 01
1
Default value for collection_select
Hi all, Can we use collection_select with default selected option. I am implementing countries and its corresponding states dropdown through Ajax and I have used collection_select method to select countries. Now for editing point of view I want the country which is selected earlier should come. Please let me know if someone has any idea about this. Thanks Ruchita Sharma. -- Posted via
2010 Aug 30
1
update form text_field on collection_select selection
I have form and a collection_select control. I would like to update form fields (text box) when I select an item from the collection_select box. It''s like selecting template from the collection_select and the template automatically loads to text boxes. Any help? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups
2005 Dec 20
1
How do I persist a value in a collection_select
Hi: I am using a collection_select to select which client''s records I want. Everything works properly EXCEPT the list box reverts to its initial value rather than holding onto the client whose records I am now viewing. ?
2006 May 22
15
collection_select default selected value
Hiall, Unfortunately I just can''t find out how to setup a default selected value when using collection_select. My call is like so: <%= collection_select(:consultant, :lastname, @consultants, :id, :lastname, { :selected => @current_consultant.id } ) %> which is not working, I debugged so far that I know that @current_consultant.id contains the correct value. Any tips? cheers
2008 Jan 17
0
collection_select unique value
I have a table named "posts" with an "author" attribute. At the posts index page, the user should be able to sort the posts through a drop down list that contains the author name. My problem is, when I use form option helper "collection_select", it gives me all the authors that contained in the "field" - 3 Johns and 4 Chris -. How can I remove the
2006 Apr 20
0
collection_select returning multiple values
Hey, Is is possible to make collection_select return multiple values? If yes, how can it be done? I?ve tried: <%= collection_select("group[]", "id", @groups, "id", "name", {},{:multiple => true}) %> Leading to: You have a nil object when you didn''t expect it! You might have expected an instance of ActiveRecord::Base. The error
2009 Mar 19
0
How to send multiple values to controller using :with option of collection_select
Hi, Thank u all for replying my previous posts. I have following problem I want to send multiple selected values from collection_select using ":with" option to a controller without submitting the form, i have following code <%= collection_select(:cluster, :CLST_RegionID, regions, :id, :REG_RegionName, {:prompt => "Please Select"},
2006 Apr 27
3
collection_select to display 2 fields
I''m trying to get a collection_select generated Drop-down box to display two fields from a table (first name & last name); however, I am having trouble concatenating the symbols. It appears as though any code I put in the 5th argument for collection_select is processed prior to executing the collection_select method. The code executes successfully with 1 symbol in the 5th
2013 Jun 18
1
How to Pass Jquery selected dropdown values and radio button values to controller
Hi, I have an advance search page and its code is as follows - I have written my code like this <div class="container"> <%= form_tag search_index_path, method: :get do %> <%= radio_button_tag ''user_type'', ''customer'' %><p>Customer</p> <%= radio_button_tag ''user_type'',
2011 Jul 05
2
Using Capybara to select from a collection_select call (select tag)
I''m trying to use Capybara to test this. I have a step that goes When I select "Price Chopper" from "Organization" And the step definition is When /^(?:|I )select "(.+)" from "(.+)"$/ do |value, field| select(value, :from => field) end For some reason, I keep getting the error: cannot select option, no select box with id,