-
Notifications
You must be signed in to change notification settings - Fork 0
Feature ad making #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 8 commits
da88770
c6e61bb
447eca2
dca848f
3359d06
a14df47
183e852
9a83d44
c8826cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| <% if @ad.errors.any? %> | ||
| <% @ad.errors.full_messages.each do |error| %> <%# formが空白だった場合にエラーを表示 %> | ||
| <li><%= error %></li> | ||
| <li class="h2"><%= error %></li> | ||
| <% end %> | ||
| <% end %> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
| <%= render partial: "errorlog" %> | ||
| <%= form_for(@ad ,url: ad_path(@ad),html: {method: "patch",class: "form-group"}) do |f| %> <%##入稿フォーム %> | ||
| <div class="form-group"> | ||
| <p>text</p> | ||
| <div class="form-group h3"> | ||
| <p>広告文</p> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ここは「テキスト」いいよ |
||
| <%= f.text_area :text,value: @ad.text,class: "form-control" %> | ||
| <p>price</p> | ||
| <p>単価</p> | ||
| <%= f.number_field :price,value: @ad.price %> | ||
| <p>advertiser_id</p> | ||
| <p>広告主ID</p> | ||
| <%= f.number_field :advertiser_id,value: @ad.advertiser_id %> | ||
| <p>image</p> | ||
| <p>イメージ</p> | ||
| <%= f.file_field :image,value: @ad.image,class: "form-control-file" %> | ||
| <%= f.submit class: "btn btn-primary",value: "更新" %> | ||
| <%= f.submit class: "btn btn-primary h2",value: "更新" %> | ||
| </div> | ||
| <% end %> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,39 @@ | ||
| <div class="ads"> | ||
| <div class="each_ad"> <%# 広告を一つ一つ表示 %> | ||
| <% @ads.each do |ad| %> | ||
| <li> | ||
| <span>ad_id :<%= ad.id %></span> | ||
| </li> | ||
| <li> | ||
| <span>text :<%= ad.text %></span> | ||
| </li> | ||
| <li> | ||
| <span>price :<%= ad.price %></span> | ||
| </li> | ||
| <li> | ||
| <%= image_tag ad.image.to_s %> | ||
| </li> | ||
| <div class="edit_button"> | ||
| <%= link_to("Edit", edit_ad_path(ad)) %> | ||
| </div> | ||
| <div class="delete_button"> | ||
| <%= link_to("Delete", ad_path(ad) ,method: :delete) %> | ||
| </div> | ||
| <% end %> | ||
| <div> | ||
| <%= link_to("New", new_ad_path) %> | ||
| </div> | ||
| <div class="links"> | ||
| <p class="h2"> | ||
| <%= link_to("新規作成", new_ad_path) %> | ||
| <!-- Reportへのリンクは他Branch(feature_adreport)で挿入します --> | ||
| </p> | ||
| </div> | ||
|
|
||
| <table class="table"> | ||
| <thead class="thead-dark"> | ||
| <tr> | ||
| <th scope="col" class="h2">広告ID</th> | ||
| <th scope="col" class="h2">広告主ID</th> | ||
| <th scope="col" class="h2">広告文</th> | ||
| <th scope="col" class="h2">単価</th> | ||
| <th scope="col" class="h2">イメージ画像</th> | ||
| <th scope="col" class="h2">操作</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <tr> | ||
| <% @ads.each do |ad| %><%# 広告を一つ一つ表示 %> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. コメント不要(処理見れば何やってるかわかる) |
||
| <td class="h3 align-middle"><%= ad.id %></td> | ||
| <td class="h3 align-middle"><%= ad.advertiser_id %></td> | ||
| <td class="h3 align-middle"><%= ad.text %></td> | ||
| <td class="h3 align-middle"><%= ad.price %></td> | ||
| <td class="h3 align-middle"><%= image_tag ad.image.to_s %></td> | ||
| <td ><p class="edit_button h4"> | ||
| <%= link_to("変更", edit_ad_path(ad)) %> | ||
| </p> | ||
| <p class="delete_button h4"> | ||
| <%= link_to("削除", ad_path(ad) ,method: :delete) %> | ||
| </p> | ||
| </td> | ||
| </tr> | ||
| <% end %> | ||
| </tbody> | ||
| </table> | ||
| </div> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
| <%= render partial: "errorlog" %> | ||
| <%= form_for(@ad ,url: ad_index_path,html: {method: "post",class: "form-group"}) do |f| %> <%##入稿フォーム %> | ||
| <div class="form-group"> | ||
| <p>text</p> | ||
| <div class="form-group h3"> | ||
| <p>広告文</p> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 「テキスト」でよろしく |
||
| <%= f.text_area :text,value: @ad.text,class: "form-control" %> | ||
| <p>price</p> | ||
| <p>単価</p> | ||
| <%= f.number_field :price,value: @ad.price %> | ||
| <p>advertiser_id</p> | ||
| <p>広告主ID</p> | ||
| <%= f.number_field :advertiser_id,value: @ad.advertiser_id %> | ||
| <p>image</p> | ||
| <p>イメージ</p> | ||
| <%= f.file_field :image,value: @ad.image,class: "form-control-file" %> | ||
| <%= f.submit class: "btn btn-primary",value: "入稿" %> | ||
| <%= f.submit class: "btn btn-primary h2",value: "入稿" %> | ||
| </div> | ||
| <% end %> | ||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
render('new')で行けたらそれで