質問編集履歴

1

routes.rb、temperaturas/index.html.haml追加しました

2021/02/06 13:22

投稿

kuromame6145
kuromame6145

スコア16

test CHANGED
File without changes
test CHANGED
@@ -84,6 +84,64 @@
84
84
 
85
85
 
86
86
 
87
+ Rails.application.routes.draw do
88
+
89
+ devise_for :users
90
+
91
+ # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
92
+
93
+
94
+
95
+ root "temperaturas#index"
96
+
87
- resources :users, only: [:edit, :update]
97
+ resources :users, only: [:edit, :update]
98
+
99
+
100
+
101
+ resources :temperaturas, only: [:index, :new, :create]
102
+
103
+
104
+
105
+
106
+
107
+ resources :groups, only: [:new, :create, :edit, :update]
108
+
109
+
110
+
111
+ end
112
+
113
+
88
114
 
89
115
  ```
116
+
117
+
118
+
119
+
120
+
121
+ temperaturas/index.html.haml
122
+
123
+ ```ruby
124
+
125
+
126
+
127
+ .Header
128
+
129
+ = form_with model: @temperatura , local: true do |f|
130
+
131
+ = f.select :budget_d, [["--", 0],["1月", 1],["2月", 2],["3月",3],["4月",4],["5月",5],["6月",6],["7月",7],["8月",8],["9月",9],["10月",10],["11月",11],["12月",12]]
132
+
133
+
134
+
135
+ .tempereture
136
+
137
+ .under_tempereture
138
+
139
+ = link_to new_temperatura_path , class: 'tempereture__text' do
140
+
141
+ 体温を記録する
142
+
143
+
144
+
145
+ = link_to edit_user_path(current_user.id)
146
+
147
+ ```