similar to: Default value for collection_select

Displaying 20 results from an estimated 20000 matches similar to: "Default value for collection_select"

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 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
2006 Aug 17
3
Use collection_select
I use the following code in my view: <%= collection_select(''datedata'', ''date'', @allDate, :id, :date) %> It''s show me the date of all entries in the database (Dropdown menu). Additional, I wrote a helper method "showDate" in the application_helper.rb! How can I use this method in the collection_select for every date entry? thanks
2006 Mar 18
10
collection_select''s linked
I created a form with two collection_select, country and state and would like to bring up to date the state list when to select a new country. How I can make this in Rails? Thanks Eleudson Brazil <p><label for="person_country_id">Country</label><br/> <%= collection_select(:person, :country_id, @countries, :id, :name) %></p> <p><label
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'',
2009 Jan 28
3
Apply style in collection_select ?????
Hi to all, i have this snip i want to apply style to this combo but there is no effect help....... <%= collection_select(:customer,:country_id, @countries,:id, :country, html_options={ "style" => "width:110px" },:onchange => ''updateState('''');'',:id =>''country_id'' )%> Thanks, -- Posted via
2009 Dec 18
2
NLS-Weibull-ERROR
Hello I was trying to estimate the weibull model using nls after putting OLS values as the initial inputs to NLS. I tried multiple times but still i m getting the same error of Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates. The Program is as below > vel <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14) > df <- data.frame(conc, vel) >
2010 Mar 16
3
collection_select has_many
hi i have two models: GeoRegion & GeoRegionSub which have a has_many relation to each other. how can include the has_many relation in the collection_select helper? i want to have that dropdown where the parent is in black and the children indented. <%= collection_select :dl,:parent_id, GeoRegion.all.????, :id, :title %> thx -- You received this message because you are subscribed
2007 Mar 20
2
collection_select - why doesn't it work?
Hi all I guess this is quite a newbie question, but I''m just stuck here and don''t know why. <%= form.collection_select :origin_country, Country.find(:all), :id, :name %> gives me a select list with name="member[origin_country]". When submitting the form the following error is shown: Country expected, got String When I try <%= form.collection_select
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
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.
2006 Apr 25
1
simple collection_select problem.
Hi, I can do this : collection_select "state", :id, TrainingState.find_all,:id,:name but not this : collection_select "state[]", :id, TrainingState.find_all,:id,:name Anyone any idea why? Is there something about collection_select that does not allow collections? Thanks Chris -- Posted via http://www.ruby-forum.com/.
2006 May 15
0
collection_select default
Hi, I have a form where i have two drop down lists formed by using the collection_select helper. I need the second list "selected" item to change depending on what was selected in the first list. I am currently using an onChange ajax call when the first list is changed, but I cannot get the second lists default value to change. I have read that if I set the @variable.attribute
2008 Jan 13
0
Obtain selected value from collection_select
Hi Im trying to change the layout of a view depending on the value selected in a collection_select box dynamically. Iow the value selected must be passed to the controller without any submit buttons beings pressed. Ultimately I wanna know how to obtain the selected value from collection_select and refresh this value if the collection is changed.... Any help would be appreciated!! thx -- Posted
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 Dec 14
2
R square in NLS-urgent help
Hello I need one urgent help I am trying to fit the Sigmod curve of logistic growth model using NLS estimation. But i do not get the R square value in that even after getting the "Summary" In that case how to compare the fit for 3 models and find which one is better fit?? How to get this R Square value when using NLS estimation? Thanks Ruchita [[alternative HTML version deleted]]
2006 Mar 12
2
Default option in collection_select
I need a way to set a default in a collection_select. Any way? -- Posted via http://www.ruby-forum.com/.
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. ?
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