similar to: Select not maintaining state on nested form with

Displaying 20 results from an estimated 1000 matches similar to: "Select not maintaining state on nested form with"

2007 Nov 08
3
options_from_collection_for_select
I need to add a blank or dashed field to the options_from_collection_for_select helper but can''t seem to get it to work. Tried this, but with no effect: <%= options_from_collection_for_select @airlines, ''id'', ''name''], {:include_blank=>true} %> Anyone know how to do this? Thanks, -S -- Posted via http://www.ruby-forum.com/.
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'',
2011 May 19
1
update_attributes updates data from second instance of nested form but not the first
Got a weird situation with an update put to a controller with a form with nested attributes. On the data below, I am updating data for both items (''0'' and ''1'') in rosters_attributes (in the example below I am updating the ''name'' attribute to a new value in both cases. What I am stuck on is that ''1'' gets its data updated,
2005 Jul 06
1
collection_select not selecting the selected item
Hi ! I have Event belongs_to Category. The generated source is: <p><label for="event_category">Category</label><br/> <select id="event_category" name="event[category]"> <option value="8">Introduction</option> <option value="7">Programming</option> </select></p> Notice no
2007 Nov 14
0
Problem time_select with fields_for
Hi, I''m using fields_for and a time_select but he isn''t saving the time in the db just 00:00:00 All the other fields are fine, but the time_field isn''t working:s This is my code: <% form_for :activity, @activity,:url => {:action => "create"} do |activity_form| %> <td><%= activity_form.time_select :datum_1_twrak_van, :order =>[ :hour,
2006 Mar 16
3
inserted_at seems buggy in production mode?
Hi, I''ve got a table with an inserted_at column. When I insert a record it automatically injects the current date/time, all is well. Then when I insert a second record, it uses the exact same timestamp that is used in the first record. This behavior only seems to occur in production mode. When I restart the server, the problem goes away but then immidetatly occurs again on the
2005 Dec 15
3
Rails: Select and html forms
I''m close to getting this to work, but not quite there. I''m trying to implement a dropdown control, with the current choice selected. I have the following code in the view: 5 <select id="product_product_type" name="product[product_type]"> 6 <%= 7 types = ProductType.find(:all, :order => "product_type") 8
2005 Dec 19
0
Pre-selecting options_from_collection_for_select Options
I''m trying to use options_from_collection_for_select to generate options for a multiple select: <select id="metro_area_states" name="states[]" size="10" multiple="multiple"> <%= options_from_collection_for_select State.find(:all), :id, :name, @metro_area.states %> </select> When selecting values for the first time, it works
2012 Aug 16
6
undefined method `with_indifferent_access' for "":String
Hi I''m having a issue with one object when try to update the attributes in this object previously saved in the database I have one object comp and one object reg they have this relationship comp has_many regs reg belongs_to comp when run use the method valid? like this current_contribuyente.comps.build(params[:comp]).valid? it returns: IndexError (string not matched) And when
2006 Feb 21
4
Select error
This code: <p> <label for="resource_type">Type</label><br/> <%= select(:resource, :type, %w{ Web Data }, { :include_blank => true }) %> </p> Produces this error: TypeError in Resources#new Showing app/views/resources/_form.rhtml where line #6 raised: wrong argument type String (expected Module) Extracted source (around line
2006 Jul 30
2
options_from_collection_for_select & multiple columns
I have a table with first_name and last_name, and wan''t to populate a drop-down with the id and the person''s name consisting of the first and last names concatenated together. Can''t figure out how to tell options_from_collection_for_select to do that. Any ideas? I basically need to do something like: <%= options_from_collection_for_select @media_creators,
2006 Mar 06
2
form_tag error -- not found, 404 -- action DOES exist!
Hi -- I''ve got a very strange error. I have an action called ''commit_input'' on a controller called ''SiteVisitController''. This definately exists, and is called from the functional test for it, and passes fine. My problem is with the form that is supposed to call this action. The form tag is: <%=
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 Apr 04
1
habtm and options_from_collection_for_select [1.0.0]
I ran into a problem using options_from_collection_for_select : ActiveRecord::AssociationTypeMismatch (Topic expected, got String): /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ active_record/associations/association_collection.rb:128:in `raise_on_type_mismatch'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/
2006 Jan 03
1
options_from_collection_for_select - NIL Object
i am kind of desparated i try with options_from_collection_for_select to get option values, but it says You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.inject but @customers is not empty -> def get_customer @customers=Customer.find_all end i have tested it and also the attributes "id"
2008 Jul 31
1
Stuck on options_from_collection_for_select
Hi everyone, I''m stuck on something that seems to be super easy, but maybe I''m just too tired to see the obvious answer. I''m trying to make a drop down with select_tag and options_from_collection_for_select. I''m trying to fill this drop down list with different human races (white, black, hispanic, etc. in the database under the name field, with a unique id
2006 Apr 19
2
select_tag and :include_blank => true not working
Guys, I''m using select_tag to display a non-model dropdown, which works fine. However, I''ve tried every which way to use the :include_blank => true option, but it simply won''t display a blank value. Using :include_blank => true with select on model fields works fine. Can someone please show me a working example? -- Posted via http://www.ruby-forum.com/.
2009 Apr 30
0
Trunicating Names in options_from_collection_for_select
Anyone know how I could trunicate the names of a passed in array in options_from_collection_for_select? I tried a few things but nothing worked. Any ideas would be appreciated! <%= options_from_collection_for_select available_projects, :id, :name, @selected_project_id %> -- Posted via http://www.ruby-forum.com/.
2005 Dec 01
0
problem with options_from_collection_for_select() need id not name
hey, i need a select list with a id property and not name, cuz i just ajax with this list and it checks on id not name if @request.post? #called by ajax if @request.xml_http_request? #called by ajax @geotag_id=params[:geotag_id].nil? ? -2 : params[:geotag_id] else @geotag_id=params[:geotag][:id].blank? ? -1:params[:geotag][:id] end else @geotag_id = -1 end i use this @geotags =
2004 Jun 11
1
Regression query : steps for model building
Hi I have a set of data with both quantitative and categorical predictors. After scaling of response variable, i looked for multicollinearity (VIF values) among the predictors and removed the predictors who were hinding some of the other significant predictors. I'm curious to know whether the predictors (who are not significant) while doing simple 'lm' will be involved in