similar to: Newbie - populating select list from db

Displaying 20 results from an estimated 800 matches similar to: "Newbie - populating select list from db"

2006 Apr 27
4
select item based on previous select list selection?
So I have a select list with a list of items. When a user selects an item, another select list should have its default selected item set to a specific item (the default associated with the first select list). This is in a form to create a new task. The first select list is a list of parent tasks. When one selects the parent task, the clients select list must default to the same client as its
2006 Mar 23
0
Newbie - populating select list from db - BUMP :)
Hi! in the same problem with a select with some values from db: the following select in test.rhtml: <%= select(:listSetting, :code, @listSettings) %> where @listSettings = ListSetting.find(:all, :order => "code").map {|u| [u.code, u.id] } i have an observer_field defined in test.rhml as below: <%= observe_field("listSetting_code", :update =>
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
2011 Apr 08
3
Ruby on rails migration problem
Hello all, I have created a migration add_details _to users ... ( city_id , profession ) and then migrated it.. when i use params[:user] to update the database by taking user inputs from forms in views, it is not updating the database for these city_id and profession... ( not changing from null ) if add validation for presence of city_id .. it is giving the error "City id cant be
2006 Aug 16
8
Multiple (AJAX) Observers on the Same Field and MSIE
I have been using multiple observers, i.e., observe_field(), on the same input field and relying on them to execute in the same order that they appear in the page. This has been working fine in FireFox, but it does not seem to work in MSIE; the requests come in and are processed in a different order. Now, I''ve always been a little hesitant about using this technique, but it always
2006 Jul 25
6
form and pagination question
Hello, How do I get params from a form to use with a paginator? debug(params) shows this city: !map:HashWithIndifferentAccess id: "1" but in my controller, when I try to use @hotel_pages = Paginator.new self, Hotel.count(:conditions => "hotels.city_id = params[:city][:id]"), 3, @params[''page''] it doesn''t work. I suppose it''s a simple
2012 May 28
4
How to load a selection list into the method new of a controller?
Hi friends! I''m relatively new with Rails and I''m struggling for a long time with this problem (it should have a pattern solution but until now I didn''t find it): I have the following models: Institution, City, State and Country. class Country < ActiveRecord::Base has_many :states has_many :cities, :through => :states end # == Schema Information # Table
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
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
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]]
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
2012 Jan 26
6
Issue Installing Puppet on Red Hat6
I have been trying to follow the bootstrap instructions for installing puppet-dashboard. I keep getting error about rubyge(rake) and rubygems. I''d appreciate any help or corrections, thanks in advance. ruby-libs-1.8.7.299-4.el6.x86_64 ruby-1.8.7.299-4.el6.x86_64 These are some installation steps I took. rvm tools rvm-env ruby bash rvm install 1.8.7 yum install ruby downloaded
2008 Jul 07
1
Non model cascading selects
In my model I have a city_id. ON the form I am using a cascading select to select the state, which then does a remote_submit to get the list of cities (and hence the city_id) for the selected state. The problem that I am having is that if I make a selection, hit SUBMIT and validation fails, the original selected state/city is now reset (ie, the values aren''t saved). Since they
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 Jan 31
2
Relationship navigation issue
class Event < ActiveRecord::Base belongs_to :venue belongs_to :category end class Venue < ActiveRecord::Base belongs_to :city end class City < ActiveRecord::Base belongs_to :state end I want to retrieve all event records belonging to a state. Coming from hibernate background I tried something like this: def self.list_for_a_state(state_id) find_by_sql(["select e.*
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.