레일스 애플리케이션에서 사용자 경로를 설정하는 데 문제가 있습니다.사용자 경로 - 레일
routes.rb에서 나는 resources :users
을 추가했습니다.
class UsersController < ApplicationController
def new
end
def show
@user = User.find(params[:id])
end
end
그리고 라인의 새로운 show.html.rb 파일을 만든 : users_controller.rb에서
TestApp::Application.routes.draw do
resources :users
root :to => 'xxx#home'
match '/about', to: 'xxx#about'
match '/test', to: 'xxx#test'
match '/news', to: 'xxx#news'
match '/signup', to: 'users#new'
end
나는 추가
<%= @user.name %>, <%= @user.email %>
을하지만 Heroku가에 배포하고있을 때 나는이 정보를 얻었고 나는 그 페이지를 볼 수 없다.
heroku[router]: at=info method=GET path=/users/1
이 문제가 해결되었거나 잘못되었습니다.
AFAIK, 작동해야합니다. 그 통나무는 뭐라고 말합니까? –
Heroku 로그 : heroku [라우터] : = 정보 메서드 = GET 경로 =/users/1 호스트 = testapp.herokuapp.com fwd = 78.0.234.91 dyno = web.1 대기열 = 0 대기 = 0ms 연결 = 1ms 서비스 = 25ms 상태 = 404 바이트 = 728. 페이지가로드 될 때 500 오류가 발생합니다. DB에 추가 된 사용자가 없기 때문에 id : 1 인 사용자가 있기 때문에 생각했습니다. – netman
로그에만 표시됩니까? 일반적으로 로그에는 스택 추적이 있습니다. –