레일 4 및 Devise gem을 사용하여 권한을 부여합니다. 나는 '이름' 라는 장치에 대한 등록 양식에 추가 필드를 추가 은 여기에 : 나는 그것을 이런 식으로 수행로컬 작업, Heroku ActionView :: Template :: Error
enter code here
<div><%= f.label :username %><br />
<%= f.text_field :username, autofocus: true %></div>
: https://stackoverflow.com/a/20667360/3826643
지역을 그것을 잘 작동합니다. 가입 할 수 있으며 사용자 패널에 sugn으로 입력 한 사용자 이름을 볼 수 있습니다. .
에게 Heroku에난 '을 클릭 죄송합니다 "나는 줄"가입하지만, 문제가 발생했습니다 "
Heroku가 여기에 기록합니다
2014-07-11T10:02:24.514630+00:00 heroku[router]: at=info method=GET path="https://stackoverflow.com/users/sign_up" host=test-app12.herokuapp.com request_id=32d968fd-2154-4a02-ba8a-878bb7f85a02 fwd="78.8.153.110" dyno=web.1 connect=5 service=378 status=500 bytes=857
2014-07-11T10:02:24.509598+00:00 app[web.1]: Rendered devise/registrations/new.html.erb within layouts/application (73.9ms)
2014-07-11T10:02:24.515127+00:00 app[web.1]:
2014-07-11T10:02:24.515132+00:00 app[web.1]: ActionView::Template::Error (undefined method `username' for #<User:0x007f2b303b0378>):
2014-07-11T10:02:24.515134+00:00 app[web.1]: 8: <%= f.email_field :email, autofocus: true %></div>
2014-07-11T10:02:24.515136+00:00 app[web.1]: 9:
2014-07-11T10:02:24.515138+00:00 app[web.1]: 10: <div><%= f.label :username %><br />
2014-07-11T10:02:24.515140+00:00 app[web.1]: 11: <%= f.text_field :username, autofocus: true %></div>
2014-07-11T10:02:24.515142+00:00 app[web.1]: 12:
2014-07-11T10:02:24.515145+00:00 app[web.1]: 13: <div><%= f.label :password %><br />
2014-07-11T10:02:24.515147+00:00 app[web.1]: 14: <%= f.password_field :password, autocomplete: "off" %></div>
2014-07-11T10:02:24.515150+00:00 app[web.1]: app/views/devise/registrations/new.html.erb:11:in `block in _app_views_devise_registrations_new_html_erb__2151626084088518473_69911734787000'
2014-07-11T10:02:24.515152+00:00 app[web.1]: app/views/devise/registrations/new.html.erb:4:in `_app_views_devise_registrations_new_html_erb__2151626084088518473_69911734787000'
2014-07-11T10:02:24.515154+00:00 app[web.1]:
2014-07-11T10:02:24.515156+00:00 app[web.1]:
2014-07-11T10:02:24.510327+00:00 app[web.1]: Completed 500 Internal Server Error in 195ms
내가 어떤 DB 마이그레이션을 수행하지 않은 그리고 그런 물건. 나를 위해
그것은 모든 지역 OK입니다 조금 유선입니다하지만 Heroku가에 액션보기 오류가 있습니다. 물론
내가 자식 새보기에서 밀어 전에 d 컨트롤러에 추가 필드 'username'이 있으면 잘 작동합니다.
사용자 필드에 대해 new.html.erb 줄을 제거하면 의미가 :
<%= f.text_field :username, autofocus: true %>