similar to: Passing variables across forms

Displaying 20 results from an estimated 300 matches similar to: "Passing variables across forms"

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 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 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 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
2013 Mar 14
7
hiera_hash lookups for included classes?
When using "include" to include a class Hiera helpfully performs an autolookup on the parameters of the included class. Specially-named variable names are automatically pulled from the Hiera datastore(s) and passed into the included module. This is pretty awesome. But it looks like included resources _only_ perform a hiera() lookup. If we have a hash defined in several levels of our
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
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
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'',
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 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:
2011 Apr 21
0
Get data from 2 tables
Hi, i have 4 tables: questions, answers, users, and inquiries (relationship) def index question_id = params[:id].to_i question = Question.find(question_id) @answers = question.answers respond_to do |format| format.ext_json { render :json => @answers.to_ext_json(:class => Answer) } end end I have several scaffold in extjs, when I click on row, i get
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 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
2009 Feb 27
5
Polymorphic association..explain the extra query ?
Can anyone explain to me the sql query done in the last step : http://pastie.org/402200 -- Arpit Jain --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group,
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
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
2010 Mar 10
6
Email section
Sir , I want to implement email section in ma web application.. so i found the method ''server_setting'' for it... Following is the method: config.action_mailer.server_settings = { :address => "smtp.gmail.com" , :port => 25, :domain => "gmail.com" , :authentication => :login, :user_name => "manish" , :password =>
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 Dec 21
1
dealing with multipart forms in a Mongrel::HttpHandler
Hi everyone, Is there an easy way to parse multipart form requests from within a Mongrel::HttpHandler subclass or do I need to break out RFC 2388 and a bunch of regexps? Thanks, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061221/9e756aa8/attachment.html