「Tabetai」を編集中
この編集を取り消せます。
下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 | 編集中の文章 | ||
28行目: | 28行目: | ||
production: | production: | ||
<<: *default | <<: *default | ||
− | database: | + | database: koresore_production |
username: jq | username: jq | ||
− | password: <%= ENV[" | + | password: <%= ENV["KORESORE_DATABASE_PASSWORD"] %></nowiki> |
<nowiki># /config/environments/production.rb | <nowiki># /config/environments/production.rb | ||
39行目: | 39行目: | ||
config.action_mailer.delivery_method = :smtp | config.action_mailer.delivery_method = :smtp | ||
#host = 'localhost' | #host = 'localhost' | ||
− | host = 'http:// | + | host = 'http://koresore.pokpok.jp' |
config.action_mailer.default_url_options = { host: host }</nowiki> | config.action_mailer.default_url_options = { host: host }</nowiki> | ||
データベース作成 | データベース作成 | ||
− | $ createdb | + | $ createdb koresore_production |
$ rails db:migrate RAILS_ENV=production | $ rails db:migrate RAILS_ENV=production | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== テスト用のデータで開発用のデータをつくる設定 == | == テスト用のデータで開発用のデータをつくる設定 == | ||
73行目: | 52行目: | ||
puts "\n== Seeding the database with fixtures ==" | puts "\n== Seeding the database with fixtures ==" | ||
system("bin/rails db:fixtures:load")</nowiki> | system("bin/rails db:fixtures:load")</nowiki> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== user == | == user == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
% bin/rails generate devise:install | % bin/rails generate devise:install | ||
167行目: | 103行目: | ||
Viewを作成 | Viewを作成 | ||
$ rails generate devise:views users | $ rails generate devise:views users | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
ログインしないとアクセスできないようにする | ログインしないとアクセスできないようにする | ||
181行目: | 111行目: | ||
end</nowiki> | end</nowiki> | ||
− | == | + | == home == |
+ | ホームを作る | ||
+ | % rails generate controller Pages home | ||
− | + | homeコントローラーはパブリックなので、認証をはずす | |
− | + | <nowiki># app/controllers/pages_controller.rb | |
− | |||
− | + | skip_before_action :authenticate_user! | |
− | + | </nowiki> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | <nowiki> | + | ルートパス |
− | + | <nowiki># config/routes.rb | |
− | |||
− | + | root to: "pages#home"</nowiki> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |