質問編集履歴

1

# mypages/index.html.hamlを追加。今回のリンク先です。

2020/07/17 02:59

投稿

gaffai
gaffai

スコア1

test CHANGED
File without changes
test CHANGED
@@ -40,6 +40,8 @@
40
40
 
41
41
  #config/routes.rb
42
42
 
43
+
44
+
43
45
  Rails.application.routes.draw do
44
46
 
45
47
  devise_for :users
@@ -60,6 +62,8 @@
60
62
 
61
63
  #mypages_controller.rb
62
64
 
65
+
66
+
63
67
  class MypagesController < ApplicationController
64
68
 
65
69
  def index
@@ -134,6 +138,8 @@
134
138
 
135
139
  #app/views/mypages/new.html.haml
136
140
 
141
+
142
+
137
143
  .Main__Contents
138
144
 
139
145
  = form_with model: @feature, local: true do |f|
@@ -152,6 +158,50 @@
152
158
 
153
159
  ```
154
160
 
161
+ ```ruby
162
+
163
+ #app/views/mypages/index.html.haml
164
+
165
+
166
+
167
+ .UpperContents
168
+
169
+ .UpperContents__userName
170
+
171
+ = current_user.name
172
+
173
+ .UpperContents__topmessage
174
+
175
+ 体重の変化
176
+
177
+ .UpperContents__edit
178
+
179
+ = link_to edit_user_path(current_user) do
180
+
181
+ = icon('fas', 'cog')
182
+
183
+ .UpperContents__information
184
+
185
+ = link_to edit_mypage_path(current_user) do #今回のリンク先
186
+
187
+ 情報
188
+
189
+ = line_chart @chart, width: "900px", height: "500px"
190
+
191
+ .BottomContents
192
+
193
+ = render partial: "feature", collection: @features
194
+
195
+ .BottomMain
196
+
197
+ %form.BottomMain__Weight
198
+
199
+ %input.weightBtn{url: '#', type: 'number', placeholder: '今日の体重を入力'}
200
+
201
+ %input.submitBtn{url: '#', type: 'submit', value: '登録する'}
202
+
203
+ ```
204
+
155
205
  ```
156
206
 
157
207
  #rails routes