Displaying 20 results from an estimated 35 matches for "type_ids".
Did you mean:
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
2006 Mar 19
1
some strange behavior for has_many with STI
Hi all,
I''m having some trouble with a has_many association 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
2009 Aug 11
2
Bugzilla not working following RHEL to CentOS migration
Dear listmates,
I've recently moved a server from RHEL5 to CentOS 5.3 after it was
decided not to renew the subscripton. Everything works beautifully
except for Bugzilla, which throws MySQL errors. For example, the
sanitycheck.cgi page says:
# # #
Bugzilla ? Sanity Check
* Home
* | New
* | Search
* |
* | Reports
*
* | My Votes
* | Preferences
2010 Jun 23
0
Rails 3 - AJAX Response
Hi,
I need help with some AJAX in rails 3.
So basically, I have a select option in my index page for my User
model. This select option is a form that modifies the user''s type. The
" :remote => true " works and the type is changed when hit the submit
button. But, nothing happens in the browser. The user is updated.
I''m actually not sure where to put either my JS /
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
2010 Jun 08
9
[Rails Heroku] Problem with saving object (on heroku hosting)
Hi 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 =>
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
2006 Jan 25
1
If Param not set...
Hello all, I''m developing an application which allows users to browse
items for sale...
Using the url localhost:3000/browse/by_type/2 (2 is the id of the
category they are in)
Displays the information I want, however 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
2006 Nov 01
0
Re: YAML.load(some_string) doesn't return hash?
Oleg Kh wrote:
> A small problem here. 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",
>
2005 Dec 12
2
count sql failing with unknown table....
Hey Rails People,
I''m doing my first Rails app and I''m having a newbie problem with the
count method....
Mysql::Error: #42S02Unknown table ''jobs_sectors'' in where clause: SELECT
COUNT(*) FROM jobs WHERE (jobs_sectors.sector_id = 1 )
Extracted source (around line #4):
1: <div class="sectors">
2: <ul>
3: <% for sector in @sectors
2006 Mar 05
1
Help with Self-Referential HABTM
With the help of the Rails Recipes have got a self-referential HABTM
relationship working, but I''m really struggling with getting a new entry
from a form accepted. i should say here that the form 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'',
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?
e.g.
class 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
2006 Aug 17
1
More on n-way.
Hey, i found some n-way threads on the list, but I think they don`t
solve my case, or I didn`t understand how all of it works. I''m new to
Rails, so be pacient. :)
I''ll use an example of movie catalog, I''m realing doing a kind of
movie catalog, for laerning rails, and I did this:
Models:
Movie, Actor, Director, Writer, Country, Language
The Movie model HABTM Actor,
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
2006 Jan 25
1
cache_sweeper causes undefined method error
I created a sweeper ItemSweeper and saved it in
app/models/item_sweeper.rb. Then I put this in my item_controller.rb:
cache_sweeper :item_sweeper, :only => [:create, :destroy, :update]
But now when I call the view action, I get this error:
ActionView::TemplateError (undefined method `title'' for nil:NilClass) on
line #5 of app/views/item/view.rhtml:
5: <H1