I am facing a weird error in my code while using HAML where my code is working on my Local Machine but when I am deploying it I am getting the following error
ActionView::Template::Error (Illegal nesting: nesting within plain text is illegal.):
My code looks like this
%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))
I am new to HAML
Because 'illegal nesting' usually happens when you do like this:
%td{ :style => 'width:10px' }
justtext
=link_to ....
Try this code:
%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))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With