Skip to content

Commit f1dcfc2

Browse files
fix texts and db
1 parent c6e61bb commit f1dcfc2

5 files changed

Lines changed: 19 additions & 29 deletions

File tree

app/views/ad/edit.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<%= render partial: "errorlog" %>
22
<%= form_for(@ad ,url: ad_path(@ad),html: {method: "patch",class: "form-group"}) do |f| %> <%##入稿フォーム %>
33
<div class="form-group">
4-
<p>text</p>
4+
<p>広告文</p>
55
<%= f.text_area :text,value: @ad.text,class: "form-control" %>
6-
<p>price</p>
6+
<p>単価</p>
77
<%= f.number_field :price,value: @ad.price %>
8-
<p>advertiser_id</p>
8+
<p>広告主ID</p>
99
<%= f.number_field :advertiser_id,value: @ad.advertiser_id %>
1010
<p>image</p>
1111
<%= f.file_field :image,value: @ad.image,class: "form-control-file" %>

app/views/ad/index.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<div class="each_ad"> <%# 広告を一つ一つ表示 %>
33
<% @ads.each do |ad| %>
44
<li>
5-
<span>ad_id :<%= ad.id %></span>
5+
<span>広告ID:<%= ad.id %></span>
66
</li>
77
<li>
8-
<span>text :<%= ad.text %></span>
8+
<span>広告文 :<%= ad.text %></span>
99
</li>
1010
<li>
11-
<span>price :<%= ad.price %></span>
11+
<span>単価 :<%= ad.price %></span>
1212
</li>
1313
<li>
1414
<%= image_tag ad.image.to_s %>

app/views/ad/new.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<%= render partial: "errorlog" %>
22
<%= form_for(@ad ,url: ad_index_path,html: {method: "post",class: "form-group"}) do |f| %> <%##入稿フォーム %>
33
<div class="form-group">
4-
<p>text</p>
4+
<p>広告文</p>
55
<%= f.text_area :text,value: @ad.text,class: "form-control" %>
6-
<p>price</p>
6+
<p>単価</p>
77
<%= f.number_field :price,value: @ad.price %>
8-
<p>advertiser_id</p>
8+
<p>広告主ID</p>
99
<%= f.number_field :advertiser_id,value: @ad.advertiser_id %>
1010
<p>image</p>
1111
<%= f.file_field :image,value: @ad.image,class: "form-control-file" %>

db/migrate/20190604073026_add_report_column_to_ads.rb

Lines changed: 0 additions & 8 deletions
This file was deleted.

db/schema.rb

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# frozen_string_literal: true
21
# This file is auto-generated from the current state of the database. Instead
32
# of editing this file, please use the migrations feature of Active Record to
43
# incrementally modify your database, and then regenerate this schema definition.
@@ -11,16 +10,15 @@
1110
#
1211
# It's strongly recommended that you check this file into your version control system.
1312

14-
ActiveRecord::Schema.define(version: 2019_06_04_073026) do
15-
create_table 'ads', force: :cascade do |t|
16-
t.integer 'advertiser_id', default: 0, null: false
17-
t.string 'image', default: '', null: false
18-
t.integer 'price', default: 0, null: false
19-
t.string 'text', default: '', null: false
20-
t.datetime 'created_at', null: false
21-
t.datetime 'updated_at', null: false
22-
t.integer 'click'
23-
t.integer 'imp'
24-
t.integer 'cv'
13+
ActiveRecord::Schema.define(version: 2019_05_28_085221) do
14+
15+
create_table "ads", force: :cascade do |t|
16+
t.integer "advertiser_id", default: 0, null: false
17+
t.string "image", default: "", null: false
18+
t.integer "price", default: 0, null: false
19+
t.string "text", default: "", null: false
20+
t.datetime "created_at", null: false
21+
t.datetime "updated_at", null: false
2522
end
23+
2624
end

0 commit comments

Comments
 (0)