HAML indentation error -
so have following haml code
.navbar-collapse.collapse - if user_signed_in? %ul.nav.navbar-nav %li = link_to "all journeys", journeys_path %li = link_to "new journey", new_journey_path %ul.nav.navbar-nav.navbar-right %li = link_to "edit user", edit_user_registration_path %li = link_to "sign out", destroy_user_session_path, :method => :delete
i want move link_to "all journeys" outside both of if statement, right beneath .navbar-collapse.collapse. when try so, keeps on giving me the line indented 3 levels deeper previous line. error.
what suppose do?
you have unconventional (bad) indentation going on here. each line should 1 indentation below previous line proper nesting. it's not clear want pull out of if
statement, should @ least valid statement. first block show if user_signed_in?
returns true, second block show regardless.
.navbar-collapse.collapse - if user_signed_in? %ul.nav.navbar-nav %li = link_to "all journeys", journeys_path %li = link_to "new journey", new_journey_path %ul.nav.navbar-nav.navbar-right %li = link_to "edit user", edit_user_registration_path %li = link_to "sign out", destroy_user_session_path, :metho
Comments
Post a Comment