質問編集履歴
2
each doメソッドの前後にもeach doを入れているため、もしかして前後に原因があるかもと思い変更しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,41 +18,161 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
-
```HTML
|
21
|
+
```HTML
|
22
22
|
|
23
|
-
<
|
23
|
+
<div class="mypage-contents">
|
24
24
|
|
25
|
-
<div
|
25
|
+
<div class="tab_wrap">
|
26
26
|
|
27
|
-
<
|
27
|
+
<input id="tab1" type="radio" name="tab_btn" checked>
|
28
28
|
|
29
|
-
<di
|
29
|
+
<input id="tab2" type="radio" name="tab_btn">
|
30
30
|
|
31
|
-
|
31
|
+
<input id="tab3" type="radio" name="tab_btn">
|
32
32
|
|
33
|
-
|
33
|
+
<div class="tab_area">
|
34
34
|
|
35
|
-
|
35
|
+
<% if @user.id == current_user.id %>
|
36
36
|
|
37
|
-
</
|
37
|
+
<label class="tab1_label" for="tab1">MYNOTE</label>
|
38
38
|
|
39
|
-
<
|
39
|
+
<label class="tab2_label" for="tab2">いいねのNOTE</label>
|
40
40
|
|
41
|
-
<
|
41
|
+
<% else %>
|
42
42
|
|
43
|
-
|
43
|
+
<label class="tab1_label" for="tab1">
|
44
44
|
|
45
|
-
</
|
45
|
+
<%= @user.name %>のNOTE</label>
|
46
46
|
|
47
|
-
<
|
47
|
+
<% end %>
|
48
48
|
|
49
|
-
<
|
49
|
+
<% if @user.id == current_user.id %>
|
50
50
|
|
51
|
-
<
|
51
|
+
<label class="tab3_label" for="tab3">コメントしたNOTE</label>
|
52
52
|
|
53
|
-
|
53
|
+
<% end %>
|
54
54
|
|
55
|
-
</div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div class="panel_area">
|
58
|
+
|
59
|
+
<div id="panel1" class="tab_panel">
|
60
|
+
|
61
|
+
<% @note.each do |note| %>
|
62
|
+
|
63
|
+
<div class="mylist">
|
64
|
+
|
65
|
+
<h2>
|
66
|
+
|
67
|
+
<%= link_to note.title, note, class: 'mylist-buttom' %>
|
68
|
+
|
69
|
+
</h2>
|
70
|
+
|
71
|
+
<% if @user.id == current_user.id %>
|
72
|
+
|
73
|
+
<div class="mylist-right">
|
74
|
+
|
75
|
+
<% if @user.id == current_user.id %>
|
76
|
+
|
77
|
+
<p>
|
78
|
+
|
79
|
+
<%= link_to '編集 ', edit_note_path(note),class: 'mylist-buttom'%>
|
80
|
+
|
81
|
+
</p>
|
82
|
+
|
83
|
+
<p>
|
84
|
+
|
85
|
+
<%= link_to '削除', note, method: :delete, data: { confirm: 'Are you sure?' } ,class: 'mylist-buttom'%>
|
86
|
+
|
87
|
+
</p>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<% end %>
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<% end %>
|
98
|
+
|
99
|
+
<% if @user.id == current_user.id %>
|
100
|
+
|
101
|
+
<div id="panel2" class="tab_panel">
|
102
|
+
|
103
|
+
<% @goods.each do |good| %>
|
104
|
+
|
105
|
+
<div class="mylist">
|
106
|
+
|
107
|
+
<% note= Note.find_by(id: good.note_id) %>
|
108
|
+
|
109
|
+
<h2>
|
110
|
+
|
111
|
+
<%= link_to(note.title, "/notes/#{note.id}") %>
|
112
|
+
|
113
|
+
</h2>
|
114
|
+
|
115
|
+
<div class="mylist-right">
|
116
|
+
|
117
|
+
<p>
|
118
|
+
|
119
|
+
<%= link_to 'Show', note, class: 'buttom' %>
|
120
|
+
|
121
|
+
</p>
|
122
|
+
|
123
|
+
</div>
|
124
|
+
|
125
|
+
</div>
|
126
|
+
|
127
|
+
<% end %>
|
128
|
+
|
129
|
+
<% end %>a
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
<% if @user.id == current_user.id %>
|
134
|
+
|
135
|
+
<div id="panel3" class="tab_panel">
|
136
|
+
|
137
|
+
<% @comments.uniq.each do |c| %>
|
138
|
+
|
139
|
+
<div class="mylist">
|
140
|
+
|
141
|
+
<% c.body %>
|
142
|
+
|
143
|
+
<% note= Note.find_by(id: c.note_id) %>
|
144
|
+
|
145
|
+
<h2>
|
146
|
+
|
147
|
+
<%= link_to(note.title, "/notes/#{note.id}") %>
|
148
|
+
|
149
|
+
</h2>
|
150
|
+
|
151
|
+
<div class="mylist-right">
|
152
|
+
|
153
|
+
<p>
|
154
|
+
|
155
|
+
<%= link_to 'Show', note, class: 'u-buttom' %>
|
156
|
+
|
157
|
+
</p>
|
158
|
+
|
159
|
+
</div>
|
160
|
+
|
161
|
+
</div>
|
162
|
+
|
163
|
+
<% end %>
|
164
|
+
|
165
|
+
<% end %>
|
166
|
+
|
167
|
+
<% end %>
|
168
|
+
|
169
|
+
</div>
|
170
|
+
|
171
|
+
</div>
|
172
|
+
|
173
|
+
</div>
|
174
|
+
|
175
|
+
</div>
|
56
176
|
|
57
177
|
```
|
58
178
|
|
1
文章の最後にスクリーンショット画像添付しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -73,3 +73,5 @@
|
|
73
73
|
end
|
74
74
|
|
75
75
|
```
|
76
|
+
|
77
|
+
![イメージ説明](b7c87d1b40e1f18e6194dade22c3a113.png)
|