teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

修正

2018/10/30 04:15

投稿

shinn_sora
shinn_sora

スコア13

title CHANGED
File without changes
body CHANGED
@@ -1,31 +1,31 @@
1
1
  今railsのチュートリアルを勉強をしているのですが以下のエラーが出てしましました。
2
- """
2
+ ```
3
3
  ERROR["test_should_get_about", StaticPagesControllerTest, 0.15483889400002226]
4
4
  test_should_get_about#StaticPagesControllerTest (0.16s)
5
5
  ActionView::Template::Error: ActionView::Template::Error: undefined method `full_title' for #<#<Class:0x0000000442a7a8>:0x007efde9027ea0>
6
6
  app/views/layouts/application.html.erb:4:in `_app_views_layouts_application_html_erb___878930355759497988_69814500201200'
7
7
  test/controllers/static_pages_controller_test.rb:21:in `block in <class:StaticPagesControllerTest>'
8
- """
8
+ ```
9
9
 
10
- """
10
+ ```
11
11
  ERROR["test_should_get_help", StaticPagesControllerTest, 0.17752699900029256]
12
12
  test_should_get_help#StaticPagesControllerTest (0.18s)
13
13
  ActionView::Template::Error: ActionView::Template::Error: undefined method `full_title' for #<#<Class:0x0000000442a7a8>:0x007efde8b425c0>
14
14
  app/views/layouts/application.html.erb:4:in `_app_views_layouts_application_html_erb___878930355759497988_69814500201200'
15
15
  test/controllers/static_pages_controller_test.rb:15:in `block in <class:StaticPagesControllerTest>'
16
- """
16
+ ```
17
17
 
18
- """
18
+ ```
19
19
  ERROR["test_should_get_root", StaticPagesControllerTest, 0.19998181099981593]
20
20
  test_should_get_root#StaticPagesControllerTest (0.20s)
21
21
  ActionView::Template::Error: ActionView::Template::Error: undefined method `full_title' for #<#<Class:0x0000000442a7a8>:0x007efde8665ca0>
22
22
  app/views/layouts/application.html.erb:4:in `_app_views_layouts_application_html_erb___878930355759497988_69814500201200'
23
23
  test/controllers/static_pages_controller_test.rb:9:in `block in <class:StaticPagesControllerTest>'
24
- """
24
+ ```
25
25
  以上が出ている出ているエラーで
26
26
 
27
27
 
28
- """
28
+ ```
29
29
  module ApplicationHelper
30
30
 
31
31
  # ページごとの完全なタイトルを返します。
@@ -38,11 +38,11 @@
38
38
  end
39
39
  end
40
40
  end
41
- """
41
+ ```
42
42
 
43
43
  これがmethodを定義したfileです。
44
44
 
45
- """
45
+ ```
46
46
  <% provide(:title, "Help") %>
47
47
 
48
48
  <h1>Help</h1>
@@ -53,9 +53,9 @@
53
53
  <a href="https://railstutorial.jp/#ebook">
54
54
  <em>Ruby on Rails Tutorial</em> book</a>.
55
55
  </p>
56
- """
56
+ ```
57
57
 
58
- """
58
+ ```
59
59
 
60
60
  <!DOCTYPE html>
61
61
  <html>
@@ -72,9 +72,9 @@
72
72
  </body>
73
73
  </html>
74
74
 
75
- """
75
+ ```
76
76
 
77
- """
77
+ ```
78
78
 
79
79
  <h1>Sample App</h1>
80
80
  <p>
@@ -82,7 +82,7 @@
82
82
  <a href="https://railstutorial.jp/">Ruby on Rails Tutorial</a>
83
83
  sample application.
84
84
  </p>
85
- """
85
+ ```
86
86
 
87
87
  これらがhtmlfileです。
88
88
  よろしくお願いします。

1

エラーコード

2018/10/30 04:15

投稿

shinn_sora
shinn_sora

スコア13

title CHANGED
File without changes
body CHANGED
@@ -1,23 +1,88 @@
1
1
  今railsのチュートリアルを勉強をしているのですが以下のエラーが出てしましました。
2
+ """
2
3
  ERROR["test_should_get_about", StaticPagesControllerTest, 0.15483889400002226]
3
4
  test_should_get_about#StaticPagesControllerTest (0.16s)
4
5
  ActionView::Template::Error: ActionView::Template::Error: undefined method `full_title' for #<#<Class:0x0000000442a7a8>:0x007efde9027ea0>
5
6
  app/views/layouts/application.html.erb:4:in `_app_views_layouts_application_html_erb___878930355759497988_69814500201200'
6
7
  test/controllers/static_pages_controller_test.rb:21:in `block in <class:StaticPagesControllerTest>'
8
+ """
7
9
 
10
+ """
8
11
  ERROR["test_should_get_help", StaticPagesControllerTest, 0.17752699900029256]
9
12
  test_should_get_help#StaticPagesControllerTest (0.18s)
10
13
  ActionView::Template::Error: ActionView::Template::Error: undefined method `full_title' for #<#<Class:0x0000000442a7a8>:0x007efde8b425c0>
11
14
  app/views/layouts/application.html.erb:4:in `_app_views_layouts_application_html_erb___878930355759497988_69814500201200'
12
15
  test/controllers/static_pages_controller_test.rb:15:in `block in <class:StaticPagesControllerTest>'
16
+ """
13
17
 
18
+ """
14
19
  ERROR["test_should_get_root", StaticPagesControllerTest, 0.19998181099981593]
15
20
  test_should_get_root#StaticPagesControllerTest (0.20s)
16
21
  ActionView::Template::Error: ActionView::Template::Error: undefined method `full_title' for #<#<Class:0x0000000442a7a8>:0x007efde8665ca0>
17
22
  app/views/layouts/application.html.erb:4:in `_app_views_layouts_application_html_erb___878930355759497988_69814500201200'
18
23
  test/controllers/static_pages_controller_test.rb:9:in `block in <class:StaticPagesControllerTest>'
24
+ """
25
+ 以上が出ている出ているエラーで
19
26
 
20
27
 
28
+ """
21
- fulll_title mthodはちゃんとhelper以下のapplication.helper.rbで定義しています。
29
+ module ApplicationHelper
22
30
 
31
+ # ページごとの完全なタイトルを返します。
32
+ def full_title(page_title = '')
33
+ base_title = "Ruby on Rails Tutorial Sample App"
34
+ if page_title.empty?
35
+ base_title
36
+ else
37
+ page_title + " | " + base_title
38
+ end
39
+ end
40
+ end
41
+ """
42
+
43
+ これがmethodを定義したfileです。
44
+
45
+ """
46
+ <% provide(:title, "Help") %>
47
+
48
+ <h1>Help</h1>
49
+ <p> Get help on the Ruby on Rails Tutorial at the
50
+ <a href="https://railstutorial.jp/help">Rails Tutorial help
51
+ page</a>.
52
+ To get help on this sample app, see the
53
+ <a href="https://railstutorial.jp/#ebook">
54
+ <em>Ruby on Rails Tutorial</em> book</a>.
55
+ </p>
56
+ """
57
+
58
+ """
59
+
60
+ <!DOCTYPE html>
61
+ <html>
62
+ <head>
63
+ <title><%= full_title(yield(:title)) %></title>
64
+ <%= csrf_meta_tags %>
65
+ <%= stylesheet_link_tag 'application', media: 'all',
66
+ 'data-turbolinks-track': 'reload' %>
67
+ <%= javascript_include_tag 'application',
68
+ 'data-turbolinks-track': 'reload' %>
69
+ </head>
70
+ <body>
71
+ <%= yield %>
72
+ </body>
73
+ </html>
74
+
75
+ """
76
+
77
+ """
78
+
79
+ <h1>Sample App</h1>
80
+ <p>
81
+ This is the home page for the
82
+ <a href="https://railstutorial.jp/">Ruby on Rails Tutorial</a>
83
+ sample application.
84
+ </p>
85
+ """
86
+
23
- を間違えているのしょうか?
87
+ れらがhtmlfileす。
88
+ よろしくお願いします。