質問編集履歴

1

routes.rbとstatic_pages_controller.rbの中身です

2018/09/23 15:28

投稿

sirs
sirs

スコア15

test CHANGED
File without changes
test CHANGED
@@ -15,3 +15,45 @@
15
15
 
16
16
 
17
17
  言葉での説明が難しくて伝わりづらいかもしれませんが、static_pages/homeへページを切り替える方法がわかる方がいらっしゃいましたら教えていただけると幸いです。
18
+
19
+
20
+
21
+ **routes.rb**
22
+
23
+ Rails.application.routes.draw do
24
+
25
+ get 'static_pages/home'
26
+
27
+ get 'static_pages/help'
28
+
29
+ get 'static_pages/about'
30
+
31
+ root 'application#hello'
32
+
33
+ end
34
+
35
+
36
+
37
+ **static_pages_controller.rb**
38
+
39
+ class StaticPagesController < ApplicationController
40
+
41
+ def home
42
+
43
+ end
44
+
45
+
46
+
47
+ def help
48
+
49
+ end
50
+
51
+
52
+
53
+ def about
54
+
55
+ end
56
+
57
+
58
+
59
+ end