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

  • Home
  • SEARCH
  • 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 8965115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:44:37+00:00 2026-06-15T16:44:37+00:00

In view I set validation for roles (gems cancan and rolify). As example in

  • 0

In view I set validation for roles (gems cancan and rolify).

As example in HAML

=if current_user.has_role? :admin
  = link_to current_user.name, '#' 

Generated HTML

<a href="#">Administrator</a>
"
0




"

Why I see ‘0’?

  • 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-15T16:44:38+00:00Added an answer on June 15, 2026 at 4:44 pm

    You should use a - in front of your if statement, probably:

    - if current_user.has_role? :admin
      = link_to current_user.name, '#' 
    

    When you use an = there, it’s going to display the result of that expression, which is not what you want.

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

Sidebar

Related Questions

I have a View set to grab the latest forum posts. That's working fine,
With default view set to agendaWeek . If I load fullCalendar at 11:59PM the
I have a UISplitViewController with the master view set up like this: UITabBarController Tab1:
If ViewController 's view is set to MyView And ViewController maintains a pointer to
I'm trying to use coffeekup as my default template app.set 'view engine', 'coffee' app.register
My configuration: app.configure(function(){ app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.bodyParser()); app.use(express.cookieParser()); app.use(express.session({ secret:
I am trying to set accessory view of cell which is UIButton . But
I'm using a ListView control in the details view with VirtualMode set to true
I set the content view for the following window and now i want to
I can set the relationship between View Model and view through following DataContext syntax:

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.