Hi! I have two models questions and questionresponses, which is dependent on questions. I am not sure whether to use questionsrespones or question_responses, for example, in the build statement in the controller: @questionresponse => @question.question_responses.build(params[:questionresponse])Thanks! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/5RvSN5zqCC0J. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 15 March 2012 10:29, Jacob Hume <jacobhumming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi! > > I have two models questions and questionresponses, which is dependent on > questions. I am not sure whether to use questionsrespones or > question_responses, for example, in the build statement in the controller:The models should probably be Question and QuestionResponse. The capitalisation is important. Then the tables are questions and question_responses. Assuming that you have Question has_many :question_responses and QuestionResponse belongs_to :question then the relationships are also named question and question_response. Colin> >> @questionresponse >> @question.question_responses.build(params[:questionresponse]) > > > Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/5RvSN5zqCC0J. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en.-- gplus.to/clanlaw -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thank you for your response. On Thursday, March 15, 2012 3:59:29 PM UTC+5:30, Jacob Hume wrote:> > Hi! > > I have two models questions and questionresponses, which is dependent on > questions. I am not sure whether to use questionsrespones or > question_responses, for example, in the build statement in the controller: > > @questionresponse = >> @question.question_responses.build(params[:questionresponse]) > > > Thanks! >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/VsW5ie6yiaIJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.