# URLへリダイレクト(アクションはconfig/routes.rbを参照) redirect_to URL # indexアクションへリダイレクト redirect_to action: 'index' # usersコントローラのindexアクションへリダイレクト redirect_to controller: 'users', action: 'index' # usersコントローラーのshowアクションのid=8へリダイレクト redirect_to controller: 'users', action: 'show', id: 8 # 前ページへリダイレクト redirect_to :back # indexアクションへstatusコード404でリダイレクト redirect_to action: 'index', status: 404 # indexアクションへstat