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 9131747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:11:37+00:00 2026-06-17T08:11:37+00:00

I have some static pages in a navigation menu. I want to add more

  • 0

I have some static pages in a navigation menu. I want to add more element to the item which is currently displaying.

navigation on view layout/adminzor.html.erb

<ul class='main-nav'>
    <%= nav_link 'Dashboard', adminzor_path %>
</ul>

on application_helper.rb

def nav_link(link_text, link_path)
  class_name = current_page?(link_path) ? 'active' : ''
    content_tag(:li, :class => class_name) do
      link_to link_text, link_path
    end
 end

and output

<ul class='main-nav'>
   <li class="active">
      <a href="/adminzor">Dashboard</a>
   </li>
</ul>

because I’m using the nav_link helper with Twitter Bootstrap’s nav component which prefers links to be wrapped inside li tags and the “active” class applied to the outer li.
and i add some element on view such as

<%= nav_link adminzor_path, :class => "light" do %>
  <div class="ico"><i class="icon-home icon-white"></i></div>
  Dashboard
<% end %>

and helper

def nav_link(link_text, link_path)
      class_name = current_page?(link_path) ? 'active' : ''
        content_tag(:li, :class => class_name) do
          link_to link_path do
           link_text
          end
        end
   end

but error

ArgumentError in Adminzor/dashboards#index

Showing c:/Sites/zionrails/app/views/layouts/adminzor.html.erb where line #44 raised:

wrong number of arguments (3 for 2)

i want to output such as

<ul class='main-nav'>
<li class="active">
 <a href="/adminzor" class="light">
    <div class="ico">
       <i class="icon-home icon-white"></i>
    </div>Dashboard
 </a>
</li>
</ul>

Are there any other solutions? thank’s

  • 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-06-17T08:11:38+00:00Added an answer on June 17, 2026 at 8:11 am

    solved

    application_helper.rb

    def is_active?(link_path)
      if current_page?(link_path)
        "active"
      else
        ""
      end
    end
    

    and on layout/adminzor.html.erb such as

    <li class="<%= is_active?(adminzor_path) %>">
                    <%= link_to adminzor_path, :class => 'light' do %>
                    <div class="ico"><i class="icon-home icon-white"></i></div>
                    Dashboard
                    <% end %>
    </li>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some static pages in a navigation menu. I want to add a
I have developed a site, which has some static pages. Like explore, home, feedback.
I have a Yesod form for editing the contents of some static pages which
I am struggling to achieve this simple thing... I have some static pages which
I have some static error pages under /public , in which I have linked
I have some static (pure html) pages in my MVC application that I need
I have a 'pages' controller with some static pages instead of using the rest
I have some static websites. By static I mean all the pages are simple
I have routes defined to some static pages and also to some controllers (users
I'm planning to develop a web application which will have many static pages (about,

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.