I have next code in haml, dispalying error: Showing /home/ubuntu/workspace/app/views/layouts/application.html.haml where line #24 raised: Illegal nesting: content can't be both given on the same line as %a and nested within it.
line 24 is = current_user.name What is wrong with haml code?
!!!
%html
%head
%title Chat
= stylesheet_link_tag
= javascript_include_tag
= csrf_meta_tags
%body
%div.navbar.navbar-default.navbar-static-top
.container
.navbar-header
= link_to 'Chat', root_path, class: 'navbar-brand'
.navbar
%ul.nav.navbar-nav
%li
= link_to 'Home', root_path
%ul.nav.navbar-nav.pull-right
- if user_signed_in?
%li.dropdown
%a.dropdown-toggle {"data-toggle": "dropdown", href: "#"}
= current_user.name
%ul.dropdown-menu {role: "menu">
%li
= link_to 'Profile', edit_user_registration_path
%li
= link_to 'Log out', destroy_user_session_path, method: :delete
- else
%li
= link_to 'Log In', new_user_session_path
%li
= link_to 'Sign Up', new_user_registration_path
.container
= flash.each do |key, value|
%div.alert.alert-"#{key}"
= value
= yield
%footer
%p Copyright © #{Time.now.year}