質問編集履歴

2

ファイル名追記

2019/03/15 05:03

投稿

nnnn5
nnnn5

スコア18

test CHANGED
File without changes
test CHANGED
@@ -30,7 +30,9 @@
30
30
 
31
31
 
32
32
 
33
+ ```
34
+
33
- ```article.rb
35
+ article.rb
34
36
 
35
37
 
36
38
 
@@ -52,7 +54,9 @@
52
54
 
53
55
 
54
56
 
57
+ ```
58
+
55
- ```tops_controller.rb
59
+ tops_controller.rb
56
60
 
57
61
  @articles = Article.search(params[:search])
58
62
 
@@ -61,6 +65,8 @@
61
65
 
62
66
 
63
67
  ```
68
+
69
+ index.html.erb
64
70
 
65
71
  <% @articles.each do |article| %>
66
72
 

1

ビューファイル追加しました!

2019/03/15 05:03

投稿

nnnn5
nnnn5

スコア18

test CHANGED
File without changes
test CHANGED
@@ -60,6 +60,38 @@
60
60
 
61
61
 
62
62
 
63
+ ```
64
+
65
+ <% @articles.each do |article| %>
66
+
67
+ <div class = "article-box">
68
+
69
+ <div class = "image">
70
+
71
+ <%= link_to image_tag("#{article.image_url}",:class=>"image"), top_path(:id => article.id) %>
72
+
73
+ </div>
74
+
75
+ <h3 class="title"><%= link_to article.title , top_path(:id => article.id)%></h3>
76
+
77
+ <p class = "tag"><%= link_to article.tags.first.name, "#" %></p>
78
+
79
+ <time class="date"><%= article.created_at.strftime("%Y-%m-%d") %></time>
80
+
81
+ </div>
82
+
83
+ <% end %>
84
+
85
+ ```
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
63
95
  ### 試したこと
64
96
 
65
97