Jump to content

The ultimate community for Ruby on Rails developers.


Noob question about creating a model

  • Please log in to reply
1 reply to this topic

#1 jamesdaley1



  • Members
  • 1 posts

Posted 10 November 2013 - 09:39 PM

I'm creating a small rails app, but getting started on it is the hardest part.


Basically, I know I need a user model, that simply has the attributes of username and password.


But the system works like this: a user logs in, and then can create an 'appeal' to partake in extramural activies by filling out a form. The form consists of stuff like 'location', 'activity', 'insurance code', 'date range', etc. So my question is - is the 'appeal' a model, with each of the questions on the form being an attribute (similar to how user has attributes username and password)? If this is the case, how do I say what each thing is? Like, if in the form it's a radio button, or 2 calendars to select a date range, what data type is that?


Thanks in advance, I'm really just beginning on my rails journey so excuse my noobishness.

#2 jemiller1963



  • Members
  • 2 posts

Posted 11 November 2013 - 06:23 PM   Best Answer

I would say yes to the "appeals" being its own model.  The way I understand, your models are User, Appeal, Question, Answer. Then you would have the associations between models; User has_many :appeals, Appeal belongs_to :user, Appeal has_many :questions, Question has_many :answers, Question belongs_to :appeal, Answer belongs_to :question.


You should start here:


and here:


also here:



Have fun!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users