質問編集履歴

2

説明不足

2019/06/25 01:06

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -26,21 +26,55 @@
26
26
 
27
27
 
28
28
 
29
- ```ここに言語を入力
30
-
31
- # config/application.rb
29
+ config/application.rb
32
30
 
33
31
 
34
32
 
33
+ ```ここに言語を入力
34
+
35
+ require_relative 'boot'
36
+
37
+
38
+
39
+ require 'rails/all'
40
+
41
+
42
+
43
+ # Require the gems listed in Gemfile, including any gems
44
+
45
+ # you've limited to :test, :development, or :production.
46
+
47
+ Bundler.require(*Rails.groups)
48
+
49
+
50
+
35
- module YourAppName
51
+ module Myapp
36
52
 
37
53
  class Application < Rails::Application
38
54
 
55
+ # Initialize configuration defaults for originally generated Rails version.
56
+
57
+ config.load_defaults 5.2
58
+
39
59
  config.i18n.default_locale = :ja
60
+
61
+ config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.yml').to_s]
62
+
63
+
64
+
65
+ # Settings in config/environments/* take precedence over those specified here.
66
+
67
+ # Application configuration can go into files in config/initializers
68
+
69
+ # -- all .rb files in that directory are automatically loaded after loading
70
+
71
+ # the framework and any gems in your application.
40
72
 
41
73
  end
42
74
 
43
75
  end
76
+
77
+
44
78
 
45
79
  ```
46
80
 

1

説明を足した。

2019/06/25 01:05

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -26,9 +26,31 @@
26
26
 
27
27
 
28
28
 
29
+ ```ここに言語を入力
30
+
31
+ # config/application.rb
32
+
33
+
34
+
35
+ module YourAppName
36
+
37
+ class Application < Rails::Application
38
+
39
+ config.i18n.default_locale = :ja
40
+
41
+ end
42
+
43
+ end
44
+
45
+ ```
46
+
47
+
48
+
29
- posts/new.html.erb
49
+ posts/new.html.erb
30
50
 
31
51
  ```ここに言語を入力
52
+
53
+
32
54
 
33
55
  <%= form_tag("/posts/create", {multipart: true}) do %>
34
56
 
@@ -98,7 +120,7 @@
98
120
 
99
121
 
100
122
 
101
- ja.yml
123
+ ja.yml
102
124
 
103
125
  ```ここに言語を入力
104
126