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

質問編集履歴

1

修正したらerrorメッセージが変わりました。よろしくお願いいたします。

2018/08/26 03:06

投稿

gunofu
gunofu

スコア8

title CHANGED
@@ -1,1 +1,1 @@
1
- railsの起動時のRouting Errorについて
1
+ railsの起動時のName Errorについて
body CHANGED
@@ -102,7 +102,6 @@
102
102
  def authorize
103
103
  redirect_to sign_in_path unless user_signed_in?
104
104
  end
105
- redirect_to sign_in_path unless user_signed_in?
106
105
  # サインイン済みならトップページに遷移する
107
106
  def redirect_to_top_if_signed_in
108
107
  redirect_to top_path and return if user_signed_in?
@@ -126,4 +125,31 @@
126
125
  # メールアドレスとパスワードをもとにデータベースからデータを取得
127
126
  user = User.find_by(email: user_params[:email], password: password_md5)
128
127
  end
129
- ```
128
+ ```
129
+
130
+ 皆様、ご意見ありがとうございます。
131
+ 返信遅くなり申し訳ありません。
132
+ users_helper.erの6行目のご指摘がありましたので、修正したところ以下のerrorメッセージに
133
+ 変わりました。
134
+ ![イメージ説明](10123099a7ef0ca8f6191f51f27b77c1.png)
135
+
136
+ ちなみにroutes.rbは以下になります。
137
+ ```routes.rb
138
+ Rails.application.routes.draw do
139
+ root 'users#sign_up'
140
+ get'top', to:'users#top', as: :top
141
+ get 'users/top'
142
+ resources :posts
143
+ get '/profile/(:id)', to:'users#show',as: :profile
144
+ get '/profile/edit', to:'users#edit',as: :profile_edit
145
+ get '/follower_list/(:id)', to:'users#follower_list',as: :follower_list
146
+ get '/follow_list/(:id)', to:'users#follow_list',as: :follow_list
147
+ get '/sign_up', to:'users#sign_up',as: :sign_up
148
+ get '/sign_in', to:'users#sign_in',as: :sign_in
149
+ get '/sign_out', to:'users#sign_out',as: :sign_out
150
+ post '/sign_up', to:'users#sign_up_process'
151
+ post '/sign_in', to:'users#sign_in_process'
152
+ # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
153
+ end
154
+ ```
155
+ ご意見、ご教授お願い致します。