$ docker-compose build ## σʔλϕʔε(PostgreSQL)Λ࡞ $ docker-compose run web rails db:create ## ্ཱͪ͛Δ $ docker-compose up ## GET http://localhost:3000/ ## Yay!! You’re on Rails!!
create_table :questions do |t| t.string :content t.integer :order_index, null: false, default: 0 t.timestamps end end end # order_indexʹNOT NULL੍ͱॳظ0Ληοτ
For details on the DSL available within this file, see http:// guides.rubyonrails.org/routing.html end HTTPϦΫΤετͱControllerΛ݁Ϳ # config/routes.rb Rails.application.routes.draw do root to: 'questions#index' get :result, to: ‘questions#result’, as: :result end
*OUFHFS DPOUFOU 4USJOH JNBHF 4USJOH ChoiceͱAttributeΛଟରଟͷؔʹ͢Δͱεέʔϥϒϧ 1 N Attributeςʔϒϧ OBNF 4USJOH Choice-Attribute ςʔϒϧ RVFTUJPO@JE *OUFHFS BUUS@JE *OUFHFS QPJOU *OUFHFS 1 N 1 N N M