Ruby on rails Haml-非法嵌套:在纯文本中嵌套是非法的
我在使用HAML时遇到了一个奇怪的错误,我的代码在本地机器上运行,但是当我部署它时,我得到了以下错误 ActionView::Template::Error(非法嵌套:在纯文本中嵌套是非法的): 我的代码如下所示Ruby on rails Haml-非法嵌套:在纯文本中嵌套是非法的,ruby-on-rails,ruby-on-rails-3,haml,Ruby On Rails,Ruby On Rails 3,Haml,我在使用HAML时遇到了一个奇怪的错误,我的代码在本地机器上运行,但是当我部署它时,我得到了以下错误 ActionView::Template::Error(非法嵌套:在纯文本中嵌套是非法的): 我的代码如下所示 %td{ :style => 'width:10px' } = link_to('Dashboard', dashboard_admin_clients_account_path(client)) if client.is_member? = link_to('Edit'
%td{ :style => 'width:10px' }
= link_to('Dashboard', dashboard_admin_clients_account_path(client)) if client.is_member?
= link_to('Edit', edit_admin_clients_account_path(client))
- if client.removed_at.nil?
= link_to('Delete', admin_clients_account_path(client), :method => :delete, :confirm => 'Are you sure you want to delete')
- else
= link_to('Restore', restore_admin_clients_account_path(client))
我是哈姆的新手
%td{ :style => 'width:10px' }
justtext
=link_to ....
%td{ :style => 'width:10px' }
= link_to('Dashboard', dashboard_admin_clients_account_path(client)) if client.is_member?
= link_to('Edit', edit_admin_clients_account_path(client))
- if client.removed_at.nil?
= link_to('Delete', admin_clients_account_path(client), :method => :delete, :confirm => 'Are you sure you want to delete')
- else
= link_to('Restore', restore_admin_clients_account_path(client))
尝试以下代码:
%td{ :style => 'width:10px' }
justtext
=link_to ....
%td{ :style => 'width:10px' }
= link_to('Dashboard', dashboard_admin_clients_account_path(client)) if client.is_member?
= link_to('Edit', edit_admin_clients_account_path(client))
- if client.removed_at.nil?
= link_to('Delete', admin_clients_account_path(client), :method => :delete, :confirm => 'Are you sure you want to delete')
- else
= link_to('Restore', restore_admin_clients_account_path(client))
是的,这是我的分部的一部分,但代码在我的本地计算机上运行正常。我在查找此问题的原因时遇到一些困难,因为错误在使用
渲染的分部中,但堆栈跟踪指向父级。