Displaying 5 results from an estimated 5 matches for "problem_id".
Did you mean:
problem_
2006 Jun 09
2
Creating An Extra Association Between Two Tables
...have the tag already in the DB and just want to link it to
another problem it does not really like me. I do it like this:
self.tags << Tag.find_by_name(tag)
I get the following error:
Mysql::Error: Duplicate entry ''20'' for key 1: INSERT INTO
problems_tags (`tag_id`, `problem_id`, `id`) VALUES (20, 33, 20)
The problem is basically that it is trying to create a row in
problem_tags with an ''id'' that already exists. How come it is trying
to do that? How can I prevent it from doing that?
Thanks for your help guys and gals!
John Kopanas
http://www.ko...
2006 Jun 12
4
Some help with fun SQL stuff...
I have one table that stores data related to math problems, and
another table that stores users'' answers to those problems. To make
this very simple, we''ll say that the math table has two numbers that
get subtracted, and the answers table has a field that can either be
"pos" or "neg"
math
_____
2 5
8 3
Okay so if we do the math, we know that the
2008 Aug 25
2
to catch exception from update_attribute
Hi
begin
ActiveRecord::Base.transaction do
pb_status_history = ProblemStatusHistory.new
pb_status_history.problem_id = @problem.id
pb_status_history.problem_status_id =
@problem.problem_status_id
pb_status_history.save!
ret_val=@problem.update_attribute("problem_status_id",''ab'')
if ret_val==false
raise ActiveRecord::ActiveRecordError...
2006 May 23
2
HABTM for Dummies Question
...quot;, :datetime
end
create_table "tags" do |t|
t.column "name", :string
t.column "created_at", :datetime
t.column "updated_at", :datetime
end
create_table "problems_tags" do |t|
t.column "problem_id", :integer
t.column "tag_id", :integer
end
====
Now, from the console I do the following:
====
problem = Problem.find(1)
problem.tags.create :name => "test this tag"
====
The problem is that a row is added to the Tags table but nothing is
added to the...
2007 Dec 27
6
populate data in another fields on selection
Hi,
I would like to know how to populate data in another text fields on
selection from a drop down
For Ex
1) The form contains 4 fields out of which 3 are text fields and the 4th
one is
drop down list.
1) i would like to know how to populate the 3 text fields with data
simultaneously
on selection from the drop down list.
Please Help.
--
Posted via http://www.ruby-forum.com/.