Closed jendiamond closed 8 years ago
You don't need to have experience to attend, just excitement and an interest. We just need to know a few things to help us group the students better at the event.
$ rails generate migration add_columns_to_questions newbie:boolean html_css:boolean tutorials:boolean study_group:boolean program:boolean website:boolean work:boolean bootcamp:boolean compsci:boolean rlsgrl_rlsbrg:boolean
$ rails generate migration add_more_columns_to_questions continue:string support:string experience:string
newbie html_css tutorials study_group program website work bootcamp compsci rlsgrl_rlsbrg continue support experience
User has_many :subscriptions has_many :magazines, through: :subscriptions
Magazine has_many :subscriptions has_many :users, through: :subscriptions
Subscription belongs_to :user belongs_to :magazine
Join table(subscription)
user = User.first magazine = Magazine.first user.subscriptions.create(magizine: magazine) user.magazines
$
rails g model Answer user_id:integer question_id:integer
$
rails g scaffold Question boolean_question:boolean string_question:string text_question:text integer_question:integer
User.rb
Question.rb
Answer.rb (Join table)
create_table "answers", force: :cascade do |t| t.integer "user_id" t.integer "question_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false end
create_table "questions", force: :cascade do |t| t.boolean "boolean_question" t.string "string_question" t.text "text_question" t.integer "integer_question" t.datetime "created_at", null: false t.datetime "updated_at", null: false end
Add Questions to the Form
http://stackoverflow.com/questions/2182428/rails-nested-form-with-has-many-through-how-to-edit-attributes-of-join-model