similar to: Get data from 2 tables

Displaying 20 results from an estimated 100 matches similar to: "Get data from 2 tables"

2009 Sep 22
0
EXTJS + drag and drop
Hello friends I need to configure the extjs drag and drop but somehow i am not able to display it. my controller contains the following code def index respond_to do |format| format.html format.ext_json { render :json => User.all.to_ext_json } end end and in the index.erb <div id="layout"></div> I have included all the necessary js file which is
2006 Apr 04
2
Syntax Error in find()
Maybe I misunderstand the parameterization of find(), I am getting this syntax error for <% @choices = Choic e.find(:all, :conditions => "question_id" = question.id, :order => "order") %> ---- ERROR LOG ---- ActionView::TemplateError (compile error ../config/../app/views/admin/test/show.rhtml:37: syntax error _erbout.concat " "; @choices =
2006 Jan 04
4
many to many link table compound primary key explosion
Hi, I have a many-to-many relationship between two tables, questions and answers. My MySQL schema for the link table creates a primary key from the two fields to prevent duplicate records. When I add the same answer to the same question more than once, rails attempts to create a duplicate record and explodes with a MySQL error: MysqlError: Duplicate entry ''3-3'' for key 1:
2006 Mar 08
0
Unit tests dynamic finders
Hi all, I am having a problem with unit tests. Whenever I have a dependency between two models (B depends on A) deleting A should also delete B. This is simple with the dependent parameter in the model file of A. But when I write a test the dependency seems to work, I can''t find the answer with id 1 anymore(Answer.find(1)). But I appearently _do_ find it with
2006 Jul 01
4
Radio_button in loop problem
Hi all, I can''t figure out why my radio_buttons won''t reflect the values stored in my database. I read through some of the previous posts -- is it true that they don''t work with integers? This is the code I''m using: <% for question in @survey.questions %> <%= debug question %> <%= radio_button ( "question", :question_id,
2006 Jan 19
8
Passing variables across forms
I''ve been reading my Agile Dev book over and over again, but I can''t wrap my head around how to do this. There''s a question and answer portion site of my site. You begin the process by adding a question to the database. After that, the program should redirect you straight to adding an answer for that question. The problem is, I don''t know how to keep
2020 Apr 16
3
Crash after Update to 4.12.1 with vfs full_audit
Am 16.04.20 um 14:18 schrieb Rowland penny via samba: > On 16/04/2020 12:45, Christian Naumer via samba wrote: >> Hello alAl, >> after update of our test server to 4.12.1 from 4.11 it crashes. If the >> vfs module is removed from the config everthing works as before. > > The only change was to upgrade to 4.12.1 ? > > If there were no other changes, then Samba
2006 Mar 10
0
Multiple radio buttons for defining multiple objects?
Hi, I''ve been working on a multiple choice Question/Answer system. The response object (analagous to a lineitem) has a question_id, user_id, and the actual response. What''s a good way of making a form with multiple response objects which are created from the radio_button helper? Right now I''ve got the following code:
2012 Oct 06
0
rails 3.2 question/answer with a through table
I have a person has many questions through person_questions. I have an extra column in the join table for the answer. The section below works for a new submit but when I edit I get 3 each with the first 2 of each selected tand the third not so I get 6 check boxes some selected some not. Is there a way to get this to work properly os just the questions in the db show up once each with the
2006 Aug 07
1
Unable to page.replace_html from rjs
I am having problems updating a div defined in a partial using both Element.update and page.replace_html in an rjs. I can put a link_to_remote in the partial using an :update, and the div updates fine. Does anyone have any idea why this might be happening? In the partial: <div><div> . . <div id="question_<%=question.id%>_error"></div> . (if a
2006 Jun 04
4
Multiple checkboxes
Please could someone suggest what might be wrong here. In my view I''m displaying a series of check boxes and when the form is submitted I want the controller to iterate over the values and contatenate them all into a string "1" if the box was checked and "0" if it wasn''t. I''m new to Ruby and Rails and I can''t seem to get any values out of
2020 Apr 16
0
Crash after Update to 4.12.1 with vfs full_audit
Am 16.04.20 um 14:23 schrieb Christian Naumer via samba: > Am 16.04.20 um 14:18 schrieb Rowland penny via samba: >> On 16/04/2020 12:45, Christian Naumer via samba wrote: >>> Hello alAl, >>> after update of our test server to 4.12.1 from 4.11 it crashes. If the >>> vfs module is removed from the config everthing works as before. >> >> The only change
2006 Apr 02
5
adding primary_key to join table using migrations
Hi list, My tag_question_user join table is not currently a full-blown model. It doesn''t have a primary key - just tag_id, question_id, and user_id. I now want to add a primary key to this model (because I want to add a "description" column as well so users can describe the tag. I''m not sure how to add this using migrations. Here is what I have: class AddNotesToTags
2012 May 02
2
Column with dynamic db type
Hi, I have a Question model where the answer to the question can have multiple db type (integer, string, boolean, ...). I would like to know if you have a better solution than this one: Question: question:string answer_type:string AnsweredQuestion: question_id:integer answer:text answer_type:string Ex: AnsweredQuestion.create(:question => 1, :answer => ''5'',
2012 Sep 29
0
rails 3.2 nested form names not correct
I have a person has many questions model, I have accepts_nested_Attributes set up properly. the question from the db show up, but the index is not incrementing: <%= f.fields_for :person_questions do |pregunta| %> Questions: <br/> <% Question.all.each do |question| %> <%= render ''questions/question_type'', :pregunta =>
2011 Mar 28
0
Token Poken :( I'm stuck with this
Hay all! I have question-answer base.. like quiz, yeah? yes! So i need to do this way... my project without registration so this way i need token.. user can answer on my question only once.. How can i do this? Iand i can give him link, and link should be like : localhost:3000/token .. he gets on this link, answer and click go and that''s all. If he want to get on this page once again he
2020 Apr 16
4
Crash after Update to 4.12.1 with vfs full_audit
Hello alAl, after update of our test server to 4.12.1 from 4.11 it crashes. If the vfs module is removed from the config everthing works as before. Logs from the crash see here: .0.31:445] Apr 16 13:36:47 lx-sv-03 smbd_audit[6263]: [2020/04/16 13:36:47.546559, 0] ../../source3/lib/util.c:830(smb_panic_s3) Apr 16 13:36:47 lx-sv-03 smbd_audit[6263]: PANIC (pid 6263): vfs_full_audit.c: name table
2020 Apr 16
0
Crash after Update to 4.12.1 with vfs full_audit
Forgot to mention that this is on Centos 8. So maybe something different than this: https://www.spinics.net/lists/samba/msg163085.html Regards Christian Am 16.04.20 um 13:45 schrieb Christian Naumer via samba: > Hello alAl, > after update of our test server to 4.12.1 from 4.11 it crashes. If the > vfs module is removed from the config everthing works as before. Logs > from the
2006 Jan 18
22
Creating multiple child objects from the same form
I''ve been digging into rails, but this one question has been a two day stumper. I''ve got a question/answer model that I''m trying to work out. Each question has multiple answers (they''re more like choices, it doesn''t matter whether they''re right or wrong), and I''d like to have the question creation form also have multiple fields in
2006 Jun 02
7
Unit Tests crashing out for a table without an ID
I''m having problems unit testing my model- I have a kind of quiz functionality user table and a question table and a user_question_response table that contains the id for the user, the id for the question and the user''s response. The user_question_response has it''s own model belongs_to/has_many with users and questions and it works fine in the actual application but