0

app/views/users/_form.html.haml,第 10 行

= form_for @user do |f|
  - if @user.errors.any?
    #error_explanation
      %h2= "#{pluralize(@user.errors.count, "error")} prohibido que este usuario se guarde:"
      %ul
        - @user.errors.full_messages.each do |msg|
          %li= msg

  .field
    = f.label 'Usuario'
    = f.text_field :username
  .field
    = f.label :email
    = f.text_field :email
  .field
    = f.label 'Teléfono'
    = f.phone_field :phone
  .field
    = f.label 'Contraseña'
    = f.password_field :password
  .field
    = f.label 'Reingresar Contraseña'
    = f.password_field :password_confirmation
  .control-group
    //= f.label 'Permisos'
    %ul.unstyled
      - for role in Role.find(:all)
        %li
          = check_box_tag "user[role_ids][]", role.name, @user.roles.include?(role)
          = role.name
    %br
  .actions
    = f.submit 'Guardar',:class => 'btn btn-primary'

错误似乎在= f.label我已经删除了所有= f.label并且没有抛出任何错误,也没有运气就改变= f.label 'Usuario'了。= f.label :username

错误信息:

ArgumentError in Users#new

Showing C:/Sites/AutosCostaRica/app/views/users/_form.html.haml where line #10 raised:

syntax error in "<reader>", line 3, column 18:
        next_label: >>
                     ^

更新:

我刚刚发现它在 Ruby 1.8 上完美运行,但我想成为 1.9。

有任何想法吗?

4

0 回答 0