2011-05-16 8 views
1

라이언의 우수한 스크린 캐스트 그가 _form.html.erb 파일에 다음 코드 줄을 추가 말한다 (# 263 client_side_validations)이 에피소드를보고받은 적이 이 작업을하는 방법에 대한Rails3 클라이언트 측 검증 문제

<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name))  do |f| %> 

어떤 아이디어 : 사용자 고안들이 다음과 같은 코드가 이미 오류를 생성하는 상단에 설치되어있는 new.html.erb 파일에 코드를 넣어됩니다 설치되어있는 경우?

/app/views/devise/registrations/new.html.erb where line #4 raised: 

compile error 
/app/views/devise/registrations/new.html.erb:4: syntax error, unexpected tIDENTIFIER, expecting kEND 
...tion_path(resource_name)) user, validate => do |f| @output_b... 
         ^
app/views/devise/registrations/new.html.erb:4: syntax error, unexpected tASSOC, expecting '=' 
...ource_name)) user, validate => do |f| @output_buffer.safe_co... 
         ^
app/views/devise/registrations/new.html.erb:26: syntax error, unexpected kENSURE, expecting $end 
Extracted source (around line #4): 

1: 
2: <h2>Sign Up</h2> 
3: 
4: <%= form_for (resource, :as => resource_name, :url => registration_path(resource_name)) user, validate => do |f| %> 
5: <%= devise_error_messages! %> 
6: 
7: <p><%= f.label :username %><br /> 

들으 # 새로운 고안/등록에서

구문 에러.

답변

2

이 시도 :

<%= form_for(resource, :validate => true, :as => resource_name, :url => registration_path(resource_name))  do |f| %> 
+0

감사합니다 - 완벽하게 작동합니다! – ubique

관련 문제