similar to: Re: collection_select question about selected_value

Displaying 20 results from an estimated 100 matches similar to: "Re: collection_select question about selected_value"

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 Aug 13
0
selected_value or select not work
I''am try using collection_select helper, but the option selected_value not work i try like this: <%= collection_select("user", "gender_id", @genders, "id", "description", {:include_blank => true, :selected_value => "2"} []''s Bruno -- Posted via http://www.ruby-forum.com/.
2006 Nov 28
2
collection_select and selected_value
Hi, I am using collection_select to build a drop down list. I would like to have the current value selected. How can I do that? My current code is straight from the example in Pragmatic Programmers book [2nd ed, p480] copying here for reference. <%= @users = User.find(:all, :order => "name" ) form.collection_select(:name, @users, :id, :name) %> I went through the api docs
2006 Jun 10
4
collection_select question
How do I specify which option should be initially selected when using the collection_select command? I''ve tried: collection_select(:selectionfilter, :producer_id, Producer.find(:all), :id, :name, {:include_blank => true, :selected_value => @initial_selection}) However it doesn''t return the desired results (the option with the value of @initial_selection selected).
2006 Jan 11
6
How to display the error messages from the controller
I have a wizard which consists of two pages. To keep it simple let''s say that the first page asks the user to select a state from the drop down menu. In case the user doesn''t select any state, an error message needs to be displayed. Ideally I would like to do something like this. def new selected_value = params[:addevent][:state_id] if selected_value == "-1"
2006 Mar 30
3
Rails 1.1, Markaby, options_from_collection
Last night, I upgraded one of my rails apps to 1.1. This app uses Markaby exclusively for its'' views, and once I checked out the latest revisiong of Markaby (r33), everything was working fine except for one thing: select_tag(''province_id'', options_from_collection_for_select(@provinces, "id", "name")) Now returns this (as you see it is spitting
2006 Aug 17
1
2 newbie question
Hey all, I have 2 newbie questions, 1st question: <%= collection_select (:region, :id, @regionall, :id, :title,options={:prompt=>"- Select cat -"}) %> Ignores the :prompt part while options={:include_blank => true} works. Any idea what I?m doing work with :prompt ? 2nd question: How can make my collection_selected to display it''s third key by default? I know it has
2008 Jun 08
1
Unable to get selected option with options_from_collection_for_select
I''m in Rails 2.1, Ruby 1.8.6 -- http://pastie.org/211063 <%= params[:doctor_id] %> <%= options_from_collection_for_select(Doctor.active, :id, :name, :selected => params[:doctor_id]) %> <%= options_from_collection_for_select(Doctor.active, :id, :name, :selected_value => params[:doctor_id]) %> Returns: 53 <option value="49">Michael
2006 Jun 28
6
select_tag
in my controller @cursos = Curso.find_all in my view i''m trying to do a select_tag with the results @cursos, using a helper select_tag "name" options_for_select(@cursos) --------> not works select_tag "name" @cursos --------> not works how to do it, using the helper? tks -- Posted via http://www.ruby-forum.com/.
2011 Apr 03
2
:HELP
Hello, &nbsp; I want to sum first three terms of each column of matrix. But I don't calculate with "apply" function. &nbsp; skwkrt&lt;-function(N=10000,mu=0,sigma=1,n=100, nboot=1000,alpha=0.05){ x&lt;-rnorm(N,mu,sigma)#population samplex&lt;-matrix(sample(x,n*nboot,replace=T),nrow=nboot) #... } &nbsp; is that: suppose a is a 5x2 matrix. &nbsp;a={1,2,3,4,5
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
2011 Sep 20
1
Add a function in rq
Hi, I am trying to add a function in a linear quantile regresion to find a breakpoint. The function I want to add is: y=(k+ax)(x&lt;B)+(k+(a-d)B+dx)(x&gt;B) How do I write it in the rq() function? Do I need to define the parameters in any way and how do I do that? I'm a biologist new to R. Thanks! -- View this message in context:
2007 Jan 27
5
Prototype not processing javascript
I''m trying to change over from Rails 1.1.6 to 1.2.1 and have discovered that either something is wrong with Prototype of else something has changed that I am not aware of and cannot find documentation on. (I just joined this group, so if this has already been cussed and discussed here or in another list then please point me in the right direction.) I am trying to use the
2006 Jul 02
0
Problem with select, options_from_collection_for_select for selected items
I''m having problems to make the selected works, i''ve been trying with select and options_from_collection_for_select. I''ve tried, :selected, :selected_key, :selected_value, and all i can got from the doc page ( http://rubyonrails.org/api/classes/ActionView/Helpers/FormOptionsHelper.html#M000399 ) and from wiki. Code: select(''informacao'',
2014 Oct 16
3
question about libvirt network Xml
Hi, I’m an openstack developer trying to use Assignment from a pool of SRIOV VFs in a libvirt <network> definition from this link http://wiki.libvirt.org/page/Networking My question is is it possible for nova (the openstack compute) to know which VF out of the pool will be allocated to a VM before it invokes libvirt to launch it? Thanks In advance, Robert
2010 Apr 23
2
3D Plot
Hi guys of the R-Help-Team!<br /><br />First of all - you do a great job!<br />I've found a lot of your mails in the internet. So I thought it would be a good idea to ask you a question about R.<br /><br />R is new to me, so sorry, if the question is too simple :)<br /><br />I have a matrix.<br />I can make a 2D Heatmap of this matrix.<br
2006 Jan 13
4
missing foreign key fields in scaffold views
Is there any reason that foreign key fields do not show in any of the scaffold views ? project table: id serial primary key, category_id integer, user_id integer, name varchar, morestuff varchar foreign key (category_id) references categories(id), foreign key (user_id) references users(id) scaffold generated views only show name, morestuff fields
2010 Jun 17
1
Problem with options_for_select
Hi, I have a problem with the form select. In the value field I have the generated html... <%= f.select :brand_id, options_for_select([[''Brands'', 0]] + @search_brands.map { |b| [b.name, b.id]}), {:id => ''cbxBrand'', :tabindex => (@tabindex += 1)} %> This is the html: <select name="search[brand_id]"
2006 Dec 18
13
unit testing wxruby GUIs
paul.allton at uk.bnpparibas.com wrote: > I''m a big fan of automated UI testing (i.e. driving the UI from some robot API). I appreciate this > is potentially a whole new project, but does wxwidgets provide a method of clicking buttons, > typing into components ... if so, would it be technically possible to expose this in wxruby. I like automated UI testing too, but
2000 May 02
3
Possible bug in factor (PR#531)
The expressions > x<-factor(x) and > class(x)<-"factor" behave differently when x is already an ordered factor. It may not be a bug but it caught me out when I was trying to remove the "orderedness" from a factor variable. The following R code illustrates the difference. Is this difference between the 2 commands desirable? > x<-1:3 > class(x) NULL