2012-01-12 67 views
0

有人能請解釋一下爲什麼我得到這個錯誤:

app/views/students/registrations/new.html.haml:28: syntax error, unexpected keyword_ensure, expecting $end 

Extracted source (around line #28): 

25: = render :partial => "devise/shared/links" 

這裏是形式:

%h2 Sign up 
= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| 
    = devise_error_messages! 
    %div 
    = f.label :email 
    %br/ 
    = f.email_field :email 
    %div 
    = f.label :password 
    %br/ 
    = f.password_field :password 
    %div 
    = f.label :password_confirmation 
    %br/ 
    = f.password_field :password_confirmation 

    %p 
    = f.label 'country', 'Country' 
     %span 
     (displayed in your articles/comments) 
    = f.select :country_id, @countries 
    %div= f.submit "Sign up" 
= render :partial => "devise/shared/links" 
+0

我猜它與'= f.select:country_id,@ countries'有關......可以向我們展示您的控制器代碼,用於註冊#new'操作嗎?另外,'resource'確實具有所有這些模型屬性,對嗎? – iwasrobbed 2012-01-12 22:47:49

回答

0

這是由於您的嵌套的標籤以內的下面幾行:

= f.label 'country', 'Country' 
    %span 
    (displayed in your articles/comments) 

嘗試將其更改爲

= f.label 'country', 'Country' 
%span (displayed in your articles/comments) 

和樣式一個不同的方式。

相關問題