search for: model_id

Displaying 20 results from an estimated 24 matches for "model_id".

2006 Mar 06
5
Question about file_column plugin
Hi! File_column plugin saves uploaded files to "public/model/image/model_id/filename", if i understand it correctly. Does it mean that it creates new folder for every image? I have product (model) that has_many images (model). Is it possible to use (or modify) this plugin that it would save my images to different folder, so the id of the model_id part would be id...
2006 Nov 29
5
Collection_select with two columns and a prompt
Hello, I am quite a newbie to RoR, I hope you maybe able to help. I have a collection_select in a _form.rhtml: "collection_select(:assets, :model_id, @models, :id, :model_ref,options={:prompt => ''- Select a model -''})" As you see my drop down menu will show the model_ref column. 1) Is it possible to have more than one column. For example I would like to concatenate the "description" column after each model_r...
2008 Jul 22
2
ActiveRecord Associations issue
...is message. I am new to RoR, and ruby too, but i am quite excited about it. I am developing a RoR project and with active record associations in the following manner # Tables (all tables have only one record) CREATE TABLE `webcars_development`.`cars` ( `id` int(11) NOT NULL auto_increment, `model_id` int(11) NOT NULL default ''0'', `photo` blob, `created_at` datetime default NULL, `updated_at` datetime default NULL, PRIMARY KEY (`id`), KEY `FK_CARS_MODELS` (`model_id`), CONSTRAINT `FK_CARS_MODELS` FOREIGN KEY (`model_id`) REFERENCES `models` (`id`) ); CREATE TABLE...
2009 Apr 24
1
RoR - getting started with database relations
...y, if I enter a part for a 1999 Jeep Cherokee, how would I link the part (say with part_id = 1337) to 1999, Jeep, and Cherokee? Would I need to refine my setup here and link the part directly to the year, make, and model by adding belongs_to and has_many or would I simply add a column for make_id, model_id, year_id to my "create_table :parts" method? ie: create_table :parts do |t| t.column :year_id t.column :make_id t.model :model_id end The other thing confusing me is the ":through => something" stuff. In one example I see can see creating a friendship table that link...
2007 Dec 03
5
spec for model_id should eql
Hello, I''m confused why the spec described below is failing. Other simple comparison specs are passing fine for the same model. The code is working accordingly when I test it through the console, I''m just having difficulty getting this spec to work. Any pointers would be appreciated. Failure message: ''Address fetch and geocode should extract department and write to
2007 Sep 19
3
Create method calling wrong column name in a table
...have a multitable database with an observer logging changes into a datachange table. The create method inserts the data into the data change table, updates my model, and then trys to load from the datachange table. When it does this it WHERE clause that is generated for me is looking for a column model_id which I dont have. I don''t want to even have a field because this table will be loggin changes for all models and having the ids stored is undesirable. The generated sql statment is SELECT * FROM datachanges WHERE datachanges.model_id = 56 where 56 is the id of the model Any help to fix...
2006 Mar 22
3
Parent-Child Tables Help
can someone help me with this i have a table cars ( id int model_id int make_id int color_id int description text constraint fk_cars_carmake foreign key(make_id) references carmakes(id), constraint fk_cars_carmodel foreign key(model_id) references carmodels(id), constraint fk_cars_color foreign key(color_id) references colors(id) ) carmakes ( id int carm...
2006 Jan 17
5
simple question
How do I pass parameters from one controller to another during redirect_to command? I want to pass both model and non-model objects. The solution I use is via session, but I rather pass it as parameters to the redirect_to Thanks. -- Posted via http://www.ruby-forum.com/.
2008 Jul 17
5
.build method
I have gone to the api and have searched the internet and looked through the books that I have, but I am having trouble finding an explanation on what the .build method actually does and how it is used. I guess the best example is if I want to create a todo list application where I can create a new todo list and add to do items all at the same time. I would post to the todolist controller to
2006 Nov 26
0
concatenate fields in collection_select
Hi, I am filling a collection_select with a list of models references based on a column named "model_ref". <%= collection_select(:assets, :model_id, @models, :id, :model_ref,:prompt => ''- Select a model -'') %></p> I have two issues : 1) I would like to concatenate another column next to the model reference inside the option value with the description of this model reference. I''ve tried : <%= collecti...
2008 Jan 13
2
module_eval and scope question
...39;m still lacking knowledge about scope issues in Ruby. Here is a stripped down version of the code I''m trying to understand (in case you happen to use Rails: This is from file scaffolding.rb): module ActionController module Scaffolding .. module ClassMethods def scaffold(model_id, options = {}) ... unless options[:suffix] module_eval <<-"end_eval", __FILE__, __LINE__ def index list end end_eval end ... end end end The purpose of this code is to create at run-t...
2017 Aug 28
3
Extracting subset from netCDF file using lat/lon and converting into .csv in R
...Conventions: CF-1.4 title: Model output climate of GFDL-ESM2M r1i1p1 Interpolated to 0.5 degree and bias corrected using observations from 1960 - 1999 for EU WATCH project CDO: Climate Data Operators version 1.7.0 (http://mpimet.mpg.de/cdo) product_id: input model_id: gfdl-esm2m institute_id: PIK experiment_id: historical ensemble_id: r1i1p1 time_frequency: daily creator: isimip at pik-potsdam.de description: GFDL-ESM2M bias corrected impact model input prepared for ISIMIP2 Now I want to extract a subset from thi...
2011 Apr 02
2
[patch] ~420 seconds in cpu_detect
...info_x86 *c, s_cpu * cpu) { clock_t et = times(NULL); printf("sizeof(cpu->vendor): %d\n", sizeof(cpu->vendor)); printf("sizeof(cpu->model): %d\n", sizeof(cpu->model)); cpu->family = c->x86; cpu->vendor_id = c->x86_vendor; cpu->model_id = c->x86_model; cpu->stepping = c->x86_mask; print_timer(et, "family-vendor-model-stepping"); /* THIS TAKES 420 seconds it blows up cuz c->x86_vendor is 255, > X86_VENDOR_NUM, so code is overrunning memory - lucky result wasnt more severe....
2011 Apr 02
2
[patch] ~420 seconds in cpu_detect
...info_x86 *c, s_cpu * cpu) { clock_t et = times(NULL); printf("sizeof(cpu->vendor): %d\n", sizeof(cpu->vendor)); printf("sizeof(cpu->model): %d\n", sizeof(cpu->model)); cpu->family = c->x86; cpu->vendor_id = c->x86_vendor; cpu->model_id = c->x86_model; cpu->stepping = c->x86_mask; print_timer(et, "family-vendor-model-stepping"); /* THIS TAKES 420 seconds it blows up cuz c->x86_vendor is 255, > X86_VENDOR_NUM, so code is overrunning memory - lucky result wasnt more severe....
2017 Aug 28
0
Extracting subset from netCDF file using lat/lon and converting into .csv in R
....4 > title: Model output climate of GFDL-ESM2M r1i1p1 Interpolated > to 0.5 degree and bias corrected using observations from 1960 - 1999 > for EU WATCH project > CDO: Climate Data Operators version 1.7.0 (http://mpimet.mpg.de/cdo) > product_id: input > model_id: gfdl-esm2m > institute_id: PIK > experiment_id: historical > ensemble_id: r1i1p1 > time_frequency: daily > creator: isimip at pik-potsdam.de > description: GFDL-ESM2M bias corrected impact model input > prepared for ISIMIP2 > >...
2006 Apr 12
0
fixtures advanced question
...marques = Marque.find_all %> <% models = Array.new %> <% Model.find_all.each do |model| %> models[model.marque_id]<<model <% end %> <% 0.upto(10) do |i| %> <% marque_i = rand marques.length %> car<%= i %>: marque_id: <%= marques[marque_i].id %> model_id: <%= models[marques[marque_i].id].id %> <% end %> But it looks like Marque.find_all doesn''t return anything because doing "marques[marque_i].id" makes error. It says, that I can not access id of object nil. My fixture loading order is defined so that first models...
2006 Mar 01
0
link_to problem when used in folder
...et the following: !ruby/hash:HashWithIndifferentAccess reg_year_to: price_from: "0" transmission_id: fuel_type_id: reg_year_from: metallic: action: results color_id: make_id: category_id: *controller: site/search* used: order_by: price mileage_to: mileage_from: "0" price_to: model_id: The way to workaround this for me was to add the following code: params.update({:controller => controller.controller_name, :action => controller.action_name}) however, clearly this is not the way it should be... am I doing something wrong or is it a bug? -- Posted via http://www.ruby-...
2012 Jul 22
0
Preferred CPU model not allowed by hypervisor
...;/model> qemu-kvm does (as far as I can tell) support Nehalem: $ qemu-kvm -cpu ?model | grep Nehalem x86 Nehalem Intel Core i7 9xx (Nehalem Class Core i7) Nehalem is defined in qmeu's target-x86_64.conf: grep Nehalem /etc/qemu/target-x86_64.conf name = "Nehalem" model_id = "Intel Core i7 9xx (Nehalem Class Core i7)" And if I run a cpu check on the processor, it seems to work fine: $ qemu-kvm -cpu Nehalem,check VNC server running on `127.0.0.1:5900' So, I I'm creating the new domain as a virt-install with the qemu-kvm backend as follows: virt-i...
2007 Mar 28
1
acts_as_list nested scope
Here''s what I''m trying to do: class Model < AR::Base acts_as_list :scope => [:key_one_id, :key_two_id, :key_three_id] end with the idea being that there are these three references from this table (one of them being optional) that define the list. I don''t think acts as nested set works in this situation because I''m still just dealing with a single list
2012 May 27
3
Dumb question
Folks Can a model just have a belongs_to only? or do you have to have a belongs_to and a has_many or has_one on the other model? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To