similar to: select item based on previous select list selection?

Displaying 20 results from an estimated 2000 matches similar to: "select item based on previous select list selection?"

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"
2007 Dec 22
3
collection_select validation problem
I''m trying to assign a parent foreign key value using collection_select from my child "new" form. The problem I''m having is if I do not make a selection, I get the following error instead of the Rails validates_presence_of error: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occurred while evaluating
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 =>
2006 Mar 29
4
using onchange options in forms
Hello, I''m trying to get a select field to update a view via the ''onchange'' option. I''ve seen examples of it here in the forum where people hardcode the forms and use javascript to trigger the change (and nearly all have complained that it''s a hack) and I''m wondering if anyone has a more elegant solution using the embedded ruby methods?
2006 Apr 30
4
Adding values from a db the rails way?
I have a log table which has a column recording the number of hours worked on a task. So there''ll be multiple lines for a particular task. I want to retrieve the total number of hours worked on a task, so that I can include the information when one views the task details. I can write a sql query to do this easily enough, like "SELECT SUM(hours) AS total FROM tasklog WHERE
2010 Feb 22
3
Rails 2.3.5/Ruby1.8.7 Collection_Select Labels with ampersands "&"
I am having an annoying problem displaying the labels of a select box correctly where there is an ampersand contained within the label string. On a form being rendered with the form_for helper the collection_select reads data from a Mysql 5.075 database the text stored in the database is "Surabaya & Surrounding Areas" when rendered and displayed in firefox 3.6 or safari is is
2006 Mar 21
3
Newbie - ActiveRecord relationships
So I''ve worked through Agile Web Development with Rails and I''m now trying my first little app to get into the swing of things. Its a task tracking app where people can create tasks and assign them to others, and also log time against the tasks. I''m having trouble working out the model relationships. This is what I''ve got so far, but its not right as
2006 Apr 30
1
Select Lists
Is there any way to trigger a controller action when the user picks an option from a selection list? -- Posted via http://www.ruby-forum.com/.
2008 Feb 13
2
How to handle Which on two matrices that do not have same number of rows
R-newbie question I have 2 matrices (a) P1 has only one column of 32K rows (b) PC has 2 column {P, C} of 3200 rows Every values in P1 matches with a value in PC[,p] (column p). I would like to use Which to search for all value in P1 that matchex PC[,p] and get the PC[,c]. However because P1 and PC does not have the same number of rows, I got lots of 'NA'. Thanks for your
2005 Dec 29
3
Post problem with select lists
hey, i have this problem how come i always get -1 for the select list?? rhtml First, select a client. <select id="client_id" name="client[id]" onChange="submit();" > <%= options_for_select(@client_options, @client_id.to_i) %> </select><%= @client_id %> controller if @request.post? if @request.xml_http_request? #called by ajax,
2006 Feb 08
2
compound conditions in find
can''t seem to find the right syntax for this... /script/../config/../app/controllers/placements_controller.rb:155: syntax error :conditions => [["placements.client_id = ?", params[:client_id] ] and "placements.discharge_date IS NOT NULL" ], this part works... :conditions => ["placements.client_id = ?", params[:client_id] ] this is what I
2006 Apr 28
5
Newbie: using date-picker
Finally found a nice date chooser script (http://projects.exactlyoneturtle.com/date_picker), but am a little confused how to implement it. So I put this where I need the date picker: <a id="_name_link" href="#" onclick="DatePicker.toggleDatePicker(''name'')" class="demo_link">[ choose date ]</a> <div
2008 Jan 15
1
Retrieve results from chisq.test programmatically
Hello, I would like to run a series of chisq.test() and store results (x-square, df, p-value) in a matrix for further analysis, but don't know how to do such. Currently I run the command line for each set of data at a time and it is time consuming. Thank you for your help. --My Coyne [[alternative HTML version deleted]]
2009 Jun 23
7
can't get remote_function working on rails 2.3.2
I''ve tried moving the code around in different ways, but so far I haven''t gotten remote_function to work for me (I''m using Rails 2.3.2 on my Mac). I want to make an AJAX call when I double-click a word on my page, and the Javascript function is being called when the ondblclick event is fired, but nothing happens when it gets to my the "new Ajax.Request" part
2006 Jul 08
4
Hidden fields in forms
Please can someone show me the correct syntax for a hidden field in forms, this is my code <%= start_form_tag :action => ''create'' %> <div class="form1"> <table width="auto" boader="8" cellspacing="5" cellpadding="5"> <% hidden_field ''line_item'', ''client_id'', :value
2006 Mar 07
6
how to add onchange javascript event to select field
I would like to add javascript ''onChange'' event handling for a select field, such as <%= collection_select("job", "client_id" , @clients, "id", "name") %> with onChange="xxx" Anyone know how to make this work? Thank you, Scott -- Posted via http://www.ruby-forum.com/.
2015 Nov 05
3
Install R on Ubuntu with libcurl support
Thanks for the advice. Going to look into this more this evening and hopefully get everything working. Thanks again! On Thu, Nov 5, 2015 at 11:56 AM, Dirk Eddelbuettel <edd at debian.org> wrote: > > On 5 November 2015 at 11:44, Michael Coyne wrote: > | What do you have installed as far as libcurl goes? Would you mind > | listing your packages and greping for libcurl entries.
2006 Jun 19
3
Using set_primary_key breaks acts_as_tree with non-integer column
I just switched from using the standard "id" column into using my own primary key and generating my own unique id for each record. But, this breaks acts_as_tree. Because my new primary key is not an integer, it breaks the SQL query as follows: StatementInvalid in PagesController#create --------------------------------------------------------------------------------------
2006 Jun 13
13
Pass infomation between different views and controllers
Hi, I am a rails and ruby nuby :-) How do you pass data between different controllers and views? I have a page ( a quote) that I am editing url ....quote/edit/6 6 id the current id. I then go to a catalog (url....catalog) to add an item to my quote (I do this via a line_item file that the quote reads) I now want to go back to the quote. I have tried this <%= link_to ''Back to
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