Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6874043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:08:44+00:00 2026-05-27T04:08:44+00:00

= tabs_tag(:open_tabs => { :id => menu }) do |tab| – menu_tabs.each do |menu_tab|

  • 0
= tabs_tag(:open_tabs => { :id => "menu" }) do |tab| 
  - menu_tabs.each do |menu_tab|
    - if !menu_tab.only_if.nil?
      - if menu_tab.only_if.call
        = tab.send menu_tab.tab_name, menu_tab.display_name, menu_tab.path, :span => "arrow-down"
          - if !menu_tab.child_elements.blank?
            %ul
            - menu_tab.child_elements.each do |child_tab|
              %li
                =link_to child_tab.display_name, child_tab.path
    - else
      = tab.send menu_tab.tab_name, menu_tab.display_name, menu_tab.path

The error message is

app/views/menu_builder/_tab_view.html.haml:15: syntax error, unexpected keyword_else, expecting keyword_end
app/views/menu_builder/_tab_view.html.haml:21: syntax error, unexpected keyword_ensure, expecting $end

(btw the line numbers are wrong too, I don’t know if this is a haml thing)

I have checked the indentation and everything should be correct, and that else should correspond to if !menu_tab.only_if.nil?, so I don’t understand why this error message is appearing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:08:44+00:00Added an answer on May 27, 2026 at 4:08 am

    I’m guessing it’s because you’re doing this:

    = tabs_tag(:open_tabs => { :id => "menu" }) do |tab| 
    

    and

    = tab.send menu_tab.tab_name, menu_tab.display_name, menu_tab.path, :span => "arrow-down"
    

    and then nesting content under that which is illegal in HAML. You get the same error when you try to do:

    = render :partial => "some/view", :locals => { :local_var => @var }
      - if something
        -# do something
    

    HAML will choke on that since it doesn’t know how to render the if statement within the partial file (based on spacing, location of the if statement within it, etc.). Same thing applies with other code helpers like the tabs you’re using.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application with various tabs (on a tabhost), each tab is an
If I have 10 tabs opened, I have to close each one using :q
Suppose i have some tabs (e.g. jquery tab) and I want to dynamically load
I have three tabs. When I press the tab button on the bottom, is
How to create trapezoid tabs in WPF tab control? I'd like to create non
I'm working on adding a tab to an application, but the last two tabs
I have a number of tabs and one is a search tab. When the
I currently have a tabview with 3 tabs. 1 tab loads an ActivityGroup which
I have to tabs, new and REPORTS. In the REPORTS tab, I'm creating a
How to call a JavaScript Function from href tag in html? I have created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.