search for: type_id

Displaying 20 results from an estimated 35 matches for "type_id".

2006 Jul 16
2
HELP - Save drop down list using "collection_select"
Each post has a single category, which I''m filling a drop down list by using this: #view <p><label for="post_type_id">Category</label><br /> <%= collection_select(:id, :type_id, Type.find(:all), :id, :category) %> </p> In my Post model I have a field called "type_id" which is to be filled by the id in the Type table upon selection. When I click "create" on my...
2006 Mar 19
1
some strange behavior for has_many with STI
...on on a table using the single table inheritance model that I''m hoping someone can help me with. The schema for the table is: CREATE TABLE `comments` ( `id` int(11) NOT NULL auto_increment, `user_id` int(11) default NULL, `type` varchar(20) NOT NULL default '''', `type_id` int(11) NOT NULL default ''0'', `name` varchar(255) default NULL, `comment` text NOT NULL, `created_at` datetime default NULL, `updated_at` datetime default NULL, PRIMARY KEY (`id`), KEY `FK_users_comments` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ALTER TAB...
2009 Aug 11
2
Bugzilla not working following RHEL to CentOS migration
...o classifications.id... ... from products.classification_id. Checking references to keyworddefs.id... ... from keywords.keywordid. Checking references to fielddefs.id... ... from bugs_activity.fieldid. ... from profiles_activity.fieldid. Checking references to flagtypes.id... ... from flags.type_id. ... from flagexclusions.type_id. ... from flaginclusions.type_id. Checking references to bugs.bug_id... ... from bugs_activity.bug_id. ... from bug_group_map.bug_id. ... from bugs_fulltext.bug_id. Software error: DBD::mysql::st execute failed: Table 'bugs.bugs_fulltext' doesn't...
2010 Jun 23
0
Rails 3 - AJAX Response
...ns in the browser. The user is updated. I''m actually not sure where to put either my JS / RJS file ( I''ve tried both, but neither do anything. ) So here''s my code: The form: ==== <%= form_for(@user, :remote => true) do |f| %> <%= f.select("type_id" , Type.all.collect{ |t| [t.name,t.id] } ) %> #TYPE is another model. User belongs_to Type <%= f.submit "Save" %> <% end %> ==== The model: ==== class UsersController < ApplicationController skip_before_filter :authorize, :only => [:new, :create...
2006 Mar 21
3
Newbie - ActiveRecord relationships
...`estimated_hours` int(4) NOT NULL default ''0'', `start_on` date default NULL, `due_on` date NOT NULL default ''0000-00-00'', `user_id` int(4) NOT NULL default ''0'', #Task owner `client_id` int(4) NOT NULL default ''0'', `type_id` int(4) NOT NULL default ''0'', `urgent` tinyint(4) default NULL, `on_hold` tinyint(4) default NULL, `percent_complete` int(4) NOT NULL default ''0'', PRIMARY KEY (`id`), KEY `parent_id` (`parent_id`), KEY `client_id` (`client_id`), KEY `type_id` (`typ...
2010 Jun 08
9
[Rails Heroku] Problem with saving object (on heroku hosting)
...All, I have some strange problem which appears only on heroku hosting 2.3.5 default stack (not on my local computer) I have some models. Here they are: class Contact < ActiveRecord::Base belongs_to :user belongs_to :type, :class_name => "ContactType", :foreign_key => "type_id" validates_presence_of :name, :on => :create, :message => "can''t be blank" validates_presence_of :type, :on => :create, :message => "can''t be blank" validates_presence_of :number, :on => :create, :message => "can''t be...
2006 Jul 18
5
Newbie RoR question
I am currently working on a small database project to track company assets. Right now my Database consists of 3 tables. 1 for the equipment, 1 for the users info, and 1 for the type of equipment. I have all 3 databases working on a model test site using RoR. Where i am having trouble is getting the databases to talk together. I can''t find this answer anywhere else. My main table
2005 Mar 09
10
Confused about extending the login generator ''user''
I''ve been using the login generator ''out of the box'' for simple authentication, and its been working fine. Now I want to extend it by simply adding ''type_id'' field which links to my ''user_types'' table, but I''m hitting: #<ActionController::SessionRestoreError: Session contained objects where the class definition wasn''t available. Remember to require classes for all objects kept in the session. The session...
2006 Jan 25
1
If Param not set...
...er localhost:3000/browse/by_type/ will display an error page (becuase the id param is not set) in my by_type.rhtml view, how to i check to see if the param is set? and if not display a message? Also similar question: I have a Property model where I use @properties = find(:all, :condition["type_id = ?", @param[''id'']]) How do I display a "no items found message" if @properties is empty (ie: no products for that category) Thanks! -- Posted via http://www.ruby-forum.com/.
2006 Nov 01
0
Re: YAML.load(some_string) doesn't return hash?
...ere. As per documentation on > http://corelib.rubyonrails.org/classes/YAML.html YAML.load(string) > should just return a hash. However on my windows machine it returns > something like this: > > #<YAML::Syck::DomainType:0x36d5038 > @domain="yaml.org,2002", > @type_id="map:HashWithIndifferentAccess", > @value= > {"key"=>"value", > "key"=>"value", > "key"=>"value", > "key"=>"value", > }> > > Obviously, on windows machine...
2005 Dec 12
2
count sql failing with unknown table....
...', `created_at` datetime NOT NULL default ''0000-00-00 00:00:00'', `valid_on` datetime default NULL, `invalid_on` datetime default NULL, `location_id` mediumint(9) NOT NULL default ''0'', `user_id` mediumint(9) NOT NULL default ''0'', `type_id` mediumint(9) NOT NULL default ''0'', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `sectors` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(50) NOT NULL default '''', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CH...
2006 Mar 05
1
Help with Self-Referential HABTM
...is also submitting info for the join table too. So in my model I have: class Type < ActiveRecord::Base has_and_belongs_to_many :subtypes, :class_name => ''Type'', :join_table => ''subtypes_types'', :association_foreign_key => ''subtype_id'', :foreign_key => ''type_id'' Then in the form I have this (@subtype carries the detail of the a parent -- so this form is called by a link "create a new subtype from this type". NB each type can have many subtypes and belong to many types to -- hence n...
2005 Nov 22
11
Building a conditions clause (for find) of multiple optional params?
I want to be able to find items according to various params - category_id, member_id, type_id, rating, etc. What I have now is something like: if(@params[''category_id'']) @items=Item.find(:all, :conditions=>["category_id=?", @params[''category_id'']) elsif(@params[''category_id''] and @params[''member_id''])...
2005 Dec 22
7
Ruby on Rails and lookup tables
Hi, I''m a newbie on both Ruby and Ruby on Rails, and I''m struggling with my first app. I have a table with a column called "employee_id" which is a foreing key associating it with the "employees" table. I have populated both tables. When I run "ruby script/generate scaffold <model name> <controller>" it generates a web page with all
2009 Jan 16
12
running a ruby expression stored in a database
Is this even possible? I''ve got a ruby expression stored in a database, it''s the code to run a plugin since I was having trouble passing variables stored in the database. When I try to call the code, it either outputs it as text, or doesn''t display it at all. It''s supposed to generate an image and display it. right now the code is stored in the database as:
2006 Jun 03
8
confused about ActiveRecord relationships
I am very confused about where to put the belongs_to and the has_one (and other relationship identifiers). I have read the RDoc and the agile book many times about this and I think i still see it backwards. Let me outline my app so you have an understanding... I have 2 tables: Schools { id, school_name, address_id } and Addresses { street1, street2, city, state, zip, country } *** this
2006 Jul 20
5
How can I make has_many prevent a delete that would lead to orphans?
...ass Asset < ActiveRecord::Base validates_presence_of :asset_number, :make, :model, :location, :name, :serial_number validates_numericality_of :asset_number validates_uniqueness_of :asset_number belongs_to :user belongs_to :location belongs_to :asset_type, :foreign_key => ''type_id'' end class Location < ActiveRecord::Base validates_presence_of :name validates_uniqueness_of :name has_many :assets end If I create a Location, with name ''London'' and then create an Asset with that location it makes sense for me to be able to delete the asset...
2006 Aug 17
1
More on n-way.
...r*, that is ALSO a *Director* or a *Writer too. If I update some Actor information, I have to update it on the other tables (Directors,Writers), if it''s there. Solution ? Using database, I solve like this. @person id name birth ... @type id name @movies_people_types movie_id person_id type_id In this way, I can have the same person working on a movie as a Director AND as an Actor, and I just update information in one place, the Person model. How to put this on Rails ? If theres another way to get in the same result, I`d appreciate suggetsiont. PS. Sorry my English, I don''t...
2006 Jan 21
0
Display options from HABTM
I have a large certifications table that I would like to have a little more controll over, it is part of a HABTM relationship. ----------------------------------- db''s (simplified) >certifications id course >employees id department_id type_id name >departments id name >types id kind >certifications_employees certification_id employee_id ----------------------------------------- Models class Employee < ActiveRecord::Base belongs_to :type belongs_to :department has_and_belongs_to_many :certifications end cla...
2006 Jan 25
1
cache_sweeper causes undefined method error
...nController::Caching::Sweeper observe Item def after_create(item) expire_index item end def after_destroy(item) expire_index item end def after_update(item) expire_index item end private def expire_index(item) expire_fragment "#index_new_items_type#{item.type_id}" end end thanks for any help! csn -- Posted via http://www.ruby-forum.com/.