Displaying 8 results from an estimated 8 matches for "presentation_id".
2006 Apr 20
1
Rails is losing key information
I am using ruby 1.8.4 with rails 1.0 under fedora core 3 on a WIntel
platform.
Rails appears to be losing key information under some circumstances.
Specifically, in the Questions class that follows, the presentation_id
property is apparently being lost.
The STDOUT dump from the create method indicates that the
presentation_id should be 42, but the dump from the database shows that
it is 43, which is the same as the explanation_presentation_id
Any ideas? Is this a known bug that is fixed in a more recent versio...
2006 Mar 28
1
Rails generates query with reserved word for field name
...he Questions code:
class Question < ActiveRecord::Base
require ''presentations''
require ''question''
include UUIDHelper
has_many :answers, :order => :seq
belongs_to :presentation, :class_name => "Presentations", :foreign_key
=> :presentation_id
belongs_to :parent, :class_name => "Quiz"
acts_as_list :scope => :parent_id
# TODO: auto-increment for seq
end
create table questions
(
ID char(36) not null primary key,
PARENT_ID char(36) not null,
presentation_id char(36) not null,
seq integer not null,...
2006 Apr 02
2
"Quiz" site
Hi,
I am thinking about how to best design a quiz site in RoR. I think it
should be fairly easy, but have run into a wall. In the simplest form,
the view would grab all of the questions for a particular quiz and
display them (e.g. multiple choice, so 4 option buttons per question).
However, I can''t figure out how to "mark" the quiz. The form is
submitted to the
2006 Jul 14
3
Rails newbie: How does the submit_tag work?
...td>
</tr>
</thead>
<tbody id="answersBody">
<%
if !@question.id.nil?
answers = Answers.find (:all, :conditions => "parent_id = " +
@question.id.to_s)
for answer in answers
presentation = Presentations.find_by_id
(answer.presentation_id.to_s);
-%>
<tr>
<td><input type="hidden" name="answerId[]" value="<%= answer.id %
>"/></td>
<td background="<%= ''/images/cbUnchecked.png'' %>"
onClick="checkboxClick(this)"...
2006 Apr 01
0
Okay, what gives? find_by_id is failing.
...code for question:
class Question < ActiveRecord::Base
require ''presentations''
require ''question''
include UUIDHelper
has_many :answers, :order => :seq
belongs_to :presentation, :class_name => "Presentations", :foreign_key
=> :presentation_id
belongs_to :parent, :class_name => "Quiz"
acts_as_list :scope => :parent_id, :column => :seq
end
Here is the code for question_controller:
def create
# changed because we are instantiating the presentations here
# may not be needed if we instantiate presentations in t...
2006 Mar 15
8
Tags to ruby interface: What I am missing? (repost)
I offer my apologies in advance for the repost. On a list as busy as
this, it is sometimes easy to get missed in the shuffle.
I am trying to create, display and edit a referenced object''s text field
on the same view as my root object.
For example:
-------------------------
Quiz: <<quiz.name>>
Preamble: <<quiz.preamble_presentation.text>>
Postamble:
2006 Mar 18
4
new user.presentation
Hi,
I''m creating an RoR application right now and i''ve got the following
question:
An user has one presentation.
So i''ve got an user table and in that table is an field
fkPresentationID. Now i want to create an new user and at the same
moment an new presentation for that user. I thought it would work with
something like this, but it didn''t work.
@user =
2006 Jun 03
12
How to get dynamically created inputs from html form back to rails app
...body.appendChild(row);
}
The equivalent RHTML fragment that builds the table from previosly
stored data is:
<%
answers = Answers.find (:all, :conditions => "parent_id = " +
@question.id.to_s)
for answer in answers
presentation = Presentations.find_by_id
(answer.presentation_id.to_s);
-%>
<tr>
<td><%= answer.id %></td>
<td><%= answer.seq %></td>
<td><input type="text"><%= answer.iscorrect %></input></td>
<td><%= text_field_tag ''answer.points...