Skip to content

Commit

Permalink
テストデータ編集
Browse files Browse the repository at this point in the history
  • Loading branch information
KOH6 committed Sep 17, 2023
1 parent 9bfab44 commit 75ceb2a
Show file tree
Hide file tree
Showing 22 changed files with 92 additions and 23 deletions.
Binary file added app/assets/images/イブニングドレス.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/ウィンターコート.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/ベビーカーシート.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/ワークブーツ.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/views/admin/orders/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
<!-- Footer-->
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Copyright &copy; KOH's Shop 2023</p>
<p class="m-0 text-center text-white">Copyright &copy; KOKOTOWN 2023</p>
</div>
</footer>
2 changes: 1 addition & 1 deletion app/views/admin/orders/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
<!-- Footer-->
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Copyright &copy; KOH's Shop 2023</p>
<p class="m-0 text-center text-white">Copyright &copy; KOKOTOWN 2023</p>
</div>
</footer>
2 changes: 1 addition & 1 deletion app/views/admin/products/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
<!-- Footer-->
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Copyright &copy; KOH's Shop 2023</p>
<p class="m-0 text-center text-white">Copyright &copy; KOKOTOWN 2023</p>
</div>
</footer>
2 changes: 1 addition & 1 deletion app/views/admin/products/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<!-- Footer-->
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Copyright &copy; KOH's Shop 2023</p>
<p class="m-0 text-center text-white">Copyright &copy; KOKOTOWN 2023</p>
</div>
</footer>
2 changes: 1 addition & 1 deletion app/views/admin/products/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<!-- Footer-->
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Copyright &copy; KOH's Shop 2023</p>
<p class="m-0 text-center text-white">Copyright &copy; KOKOTOWN 2023</p>
</div>
</footer>
2 changes: 1 addition & 1 deletion app/views/admin/products/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
<!-- Footer-->
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Copyright &copy; KOH's Shop 2023</p>
<p class="m-0 text-center text-white">Copyright &copy; KOKOTOWN 2023</p>
</div>
</footer>
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>KOH's Shop</title>
<title>KOKOTOWN</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1, shrink-to-fit=no">
<%= csrf_meta_tags %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/orders/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@
</div>
</main>
<footer class="my-5 pt-5 text-body-secondary text-center text-small">
<p class="mb-1">Copyright &copy; KOH's Shop 2023</p>
<p class="mb-1">Copyright &copy; KOKOTOWN 2023</p>
</footer>
</div>
4 changes: 2 additions & 2 deletions app/views/products/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<header class="bg-dark py-5 my-5">
<div class="container px-4 px-lg-5 my-5">
<div class="text-center text-white">
<h1 class="display-4 fw-bolder">KOH's Shop</h1>
<h1 class="display-4 fw-bolder">KOKOTOWN</h1>
<p class="lead fw-normal text-white-50 mb-0">選りすぐりの商品をあなたへ</p>
</div>
</div>
Expand All @@ -22,6 +22,6 @@
<!-- Footer-->
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Copyright &copy; KOH's Shop 2023</p>
<p class="m-0 text-center text-white">Copyright &copy; KOKOTOWN 2023</p>
</div>
</footer>
4 changes: 2 additions & 2 deletions app/views/products/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="col-md-6"><%= image_tag @product.image, class: "img-fluid" %></div>
<div class="col-md-6">
<div class="small mb-1"><%= @product.sku %></div>
<h1 class="display-5 fw-bolder"><%= @product.name %></h1>
<h1 class="display-7 fw-bolder"><%= @product.name %></h1>
<div class="fs-5 mb-5">
<span><%= convert_to_jpy(@product.price) %></span>
</div>
Expand Down Expand Up @@ -50,6 +50,6 @@
<!-- Footer-->
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Copyright &copy; KOH's Shop 2023</p>
<p class="m-0 text-center text-white">Copyright &copy; KOKOTOWN 2023</p>
</div>
</footer>
2 changes: 1 addition & 1 deletion app/views/shared/_navigation.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
<div class="container px-4 px-lg-5">
<a class="navbar-brand" href="/">KOH's Shop</a>
<a class="navbar-brand" href="/">KOKOTOWN</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0 ms-lg-4">
Expand Down
89 changes: 79 additions & 10 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,84 @@

Product.destroy_all

10.times do |n|
count = n + 1
product = Product.new(
name: "商品#{count}",
sku: "testCode:#{count}",
price: 1000 * count,
stock: 5 * count,
description: "descriptionTest#{count}ダミー説明ダミー説明ダミー説明ダミー説明ダミー説明ダミー説明ダミー説明ダミー説明ダミー説明ダミー説明"
)
product.image.attach(io: File.open(Rails.root.join('app/assets/images/dummy.jpg')), filename: 'dummy.jpg')
# db/seeds.rb

products = [
{
name: 'メンズカジュアルTシャツ',
sku: 'TS001',
price: 2500,
stock: 100,
description: 'クラシックなデザインのメンズTシャツ。快適な綿素材で、白、黒、青、赤のカラーバリエーションから選択可能。'
},
{
name: 'レディースデニムジーンズ',
sku: 'DJ002',
price: 3800,
stock: 75,
description: 'スタイリッシュなレディースデニムジーンズ。サイズとカラーのバリエーションで個性を表現。'
},
{
name: 'キッズスポーツシューズ',
sku: 'SS003',
price: 2200,
stock: 50,
description: '子供用のスポーツシューズ。軽量で快適、白、黒、ピンク、青のカラーで楽しい遊びをサポート。'
},
{
name: 'ウィンターコート',
sku: 'WC004',
price: 6500,
stock: 40,
description: '暖かくてスタイリッシュなウィンターコート。寒冷地に対応し、グレー、ネイビー、カーキのカラーバリエーション。'
},
{
name: 'ベビーコットンロンパース',
sku: 'CR005',
price: 1200,
stock: 60,
description: '赤ちゃん用のコットンロンパース。やさしい素材で快適さと可愛さを提供。ピンク、ブルー、イエローから選択可能。'
},
{
name: 'スポーツジャケット',
sku: 'SJ006',
price: 4200,
stock: 30,
description: 'スタイリッシュなスポーツジャケット。運動中や日常のアウトドア活動に最適。機能的で快適な素材を使用。'
},
{
name: 'ユニセックスビーニー帽',
sku: 'BH007',
price: 800,
stock: 120,
description: 'シンプルなデザインのビーニー帽。暖かく、ファッショナブル。男女兼用で着こなせる。'
},
{
name: 'ワークブーツ',
sku: 'WB008',
price: 5500,
stock: 45,
description: '丈夫で快適なワークブーツ。作業現場やアウトドアでの使用に適しています。'
},
{
name: 'イブニングドレス',
sku: 'ED009',
price: 9800,
stock: 25,
description: '華やかなイブニングドレス。パーティーや特別なイベントにぴったり。魅力的なシフォン素材を使用。'
},
{
name: 'ベビーカーシート',
sku: 'CS010',
price: 6000,
stock: 35,
description: '赤ちゃんのための快適なカーシート。安全性と快適さを両立させたデザイン。多彩なカラーオプション。'
}
]

products.each do |product_data|
product = Product.new(product_data)
product.image.attach(io: File.open(Rails.root.join("app/assets/images/#{product.name}.jpg")),
filename: "#{product.name}.jpg")
product.save
end

0 comments on commit 75ceb2a

Please sign in to comment.