2016-09-05 37 views
-2

私は自分のローカルホストに接続しようとしていて、それは私に@titleを与えます。以下は私のコードです:赤い線は、3行目の認証を示します。 [::インデックス、:ショー]構文エラー、予期しないtIDENTIFIER、expecting keyword_end before_action:authenticate_user! [:index、:show]^

それは以下のようにする必要があり、問題ここ

class MoviesController < ApplicationController 
    before_action :set_movie, only: [:show, :edit, :update, :destroy] 
    before_action :authenticate_user! except: [:index, :show] 

答えて

1

からB可能性が何を '' を除く前に逃しました。

class MoviesController < ApplicationController 
    before_action :set_movie, only: [:show, :edit, :update, :destroy] 
    before_action :authenticate_user!, except: [:index, :show] 
0

authenticate_userの後に '、'が見つかりませんでした。この行を置換する

before_action :authenticate_user!, except: [:index, :show] 
関連する問題