Question

In this gist I put an error in a slim file, that disappears when I uncomment all which comes below the - else:

= link_to "Spm", root_path, :class => 'brand'
ul.nav.pull-right
  li.dropdown
    - if user_signed_in?
      a#drop.dropdown-toggle href='#' role='button' data-toggle='dropdown' = current_user.name
        b.caret
      ul.dropdown-menu role='menu' aria-labelledby='drop'
        li = link_to 'Logout', destroy_user_session_path, :method=>'delete'
        li = link_to 'Edit account', edit_user_registration_path
        - if current_user.has_role? :admin
          li = link_to 'Admin', users_path

    - else
      / a#drop.dropdown-toggle href='#' role='button' data-toggle='dropdown' = current_user.name
      /   b.caret
      / ul.dropdown-menu role='menu' aria-labelledby='drop'
      /   li = link_to 'Login', new_user_session_path
      /   li = link_to 'Sign up', new_user_registration_path

There is no tabs, I had checked it 10 times. I checked that there is no - end statement, so I don't know what what's the problem.

Was it helpful?

Solution

The issue was link with content in same line and b.caret below:

  a#drop.dropdown-toggle href='#' role='button' data-toggle='dropdown'
    = current_user.name
    b.caret

this works fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top