similar to: select box''s

Displaying 20 results from an estimated 1000 matches similar to: "select box''s"

2006 Apr 06
6
select method
The documentation states as an example: select("post", "person_id", Person.find_all.collect {|p| [ p.name, p.id ] }, { :include_blank => true }) could become: <select name="post[person_id]"> <option></option> <option value="1" selected="selected">David</option> <option
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 Aug 09
2
how to access selected value in controller action
I have this in a view: <%= start_form_tag :action => ''create_price'', :id => @media.id %> <%= select("media", "price_code_id", PriceCode.find_all.collect {|pc| [pc.name, pc.id ] }, { :include_blank => false }) %> <%= submit_tag ''Add Price Code'' %> <%= end_form_tag %> My question is, how would I access the
2005 Dec 23
2
Bizarre problems with AJAX / missing variables
I''m having some really weird problems with an app I''m writing. Everything is working as expected on my development machine (OSX, Rails 0.14.4) but is cacking out with weird errors on the Textdrive demo site (FreeBSD, Rails 1.0.0). It complains about missing variables, with errors like this: undefined local variable or method `rawcode'' for
2006 Feb 19
8
select, first option empty value?
using the below: <%= select(''project'', ''project_type_id'', @project_types.collect {|x| [x.name,x.id]}, {:include_blank => true}) %> but i''d like that first option to have something like "select project type" with an empty value?
2006 Mar 22
4
Newbie - populating select list from db
Can''t seem to find an example of this anywhere - how do I populate a select list in a form from a database? I have a form to create a new task. The task is for a client, so there should be a select list populated from my clients table. I thought this would work: <%= select ''task'', ''client_id'', Client.find_all, "id", "name"
2006 Feb 23
7
How to set a relationship with a value from a selection list
I realize this is probably a very basic problem but I''m developing my first rails app and running into this problem. I''m trying to write a photoblog application. I have a photo table and an album table. Photo has a to-one relationship to Album. Photo.album_id => Album.id In my view for photo I have a selection list that''s populated with all the available albums.
2006 Jul 19
1
Updating a model from a checkbox (noob question)
Hello everyone, I''m trying to wire a combobox in a view to update the database. When I select something in the combobox and press ''update'' it goes through fine, except it places the default value for the field of the combobox. Any suggestions? Here''s the model: class TestResult < ActiveRecord::Base has_one :status_index has_one :test_type has_one
2006 May 18
4
Problems using ''select''
I use :filter action to display form and allow record filtering. It contains form with combo box, submit button and list of record matching value in combo. filter.rb: class Filter attr_accessor :owner def initialize(params) @owner = ''''; if !params[:filter].nil? and params[:filter].has_key?(:owner) @owner = params[:filter][:owner] end end end Controler: @users =
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/.
2006 Jan 01
7
Can''t get select helper to populate dropdown w/default value
Guys, I searched this forum and found plenty of people having this problem, but I didn''t see any definitive solution. Usings Rails 1.0. When I edit an existing record, I can''t get the basic "select" helper to display the current value contained in the field of the record. All of my other (text) fields populate correctly with current field values. There appears
2006 Jul 04
1
select(object, method, choices, options = {}, html_options = {})
Hi, I''m using: select(object, method, choices, options = {}, html_options = {}) I''ve read the API where there''s this example: select("post", "person_id", Person.find_all.collect {|p| [ p.name, p.id ] }, { :include_blank => true }) should give this code: <select name="post[person_id]"> <option></option>
2006 Jul 02
6
remote form w/ evalScripts:true
Hello. I want to select an item from a select list and have that result in an ajax call that updates two sections on the page. Here is the code in the controller def create ... render :update do |page| page.replace_html ''list_items'', :partial => ''lists/list_items'' page.replace_html ''add_item'', :partial =>
2009 Sep 02
8
select_month helper
I''m trying to rewrite a fusebox-like application (Active4D plugin to 4D database) in RoR/postgres and I''m doing okay - but keep running into things that stump me. It seems like it takes me hours to figure out something that I could have written in pure code in minutes. The select_month and select_day helper has been my latest waste of time. All I''m trying to do is add
2007 Aug 10
2
Select doenst pass the correct value
Hello, I have in my view a select tag that doesnt return the right value, could anyone point me what am I doing wrong? Heres whats in my view <%=select "", "situacao", {"Open"=>0,"Closed"=> 1},:include_blank=>true%> Then in my controller I do this def status if request.post? #Do some stuff @situacao = params[:situacao]
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/.
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).
2009 Jan 08
4
Problem with disable_with
Hi Group, I have a registration.html.erb page with the following JavaScript at the top which I use to validate form fields: <script type="text/javascript"> <!-- function validate(){ if ((document.myForm.email_projectname.value=="")|| (document.myForm.email_projecttype_id.selectedIndex<1)|| (document.myForm.email_region_id.selectedIndex<1)) { alert
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/.
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