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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:28:52+00:00 2026-06-16T12:28:52+00:00

I have the following code in my home.html.erb file; <!– if seeker is logged

  • 0

I have the following code in my home.html.erb file;

<!-- if seeker is logged in show button "Grab it" -->
<% if user_signed_in? %>
<div class="grabit alignright">
<small>want to work on this?</small>
<!-- if seeker is not logged in, show him the output text of "Sign in to work on this job" -->
<% else %>
<small>are you a guru? want to work on this? Sign up.</small>
<% end %>
</div>

Now as you can see I’m trying to have Seeker as a user role. Depending if that type of user with that type of role is signed in or not, different content is shown.

I have Devise + CanCan installed. Now very new to this and I’ve looked all over to see how to do this. I will have “Users” with normal roles of users and “Seekers” with seeker role. Using the above code only shows when a user is signed in, but not a seeker.

Is it as simple as seekers_signed_in? that I should be using? compare to user_signed_in? I’ve generated the Devise views for both Users and Seekers and Admins. Admins will be able to delete, update, etc. for users and seekers. Users post items and Seekers grab them.

Can anyone help?

  • 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-16T12:28:53+00:00Added an answer on June 16, 2026 at 12:28 pm

    You don’t have to create Users& Seekers (two devise models), instead you can create only one model as common and call it User, then add as many roles as you need.

    I recommend using this gem for easy roles configuration,

    Then in your home.html.erb you simply do the following:

    <!-- if seeker is logged in show button "Grab it" -->
    <% if user_signed_in? && current_user.is_seeker? %>
    <div class="grabit alignright">
    <small>want to work on this?</small>
    <!-- if seeker is not logged in, show him the output text of "Sign in to work on this job" -->
    <% else if !user_signed_in?%>
    <small>are you a guru? want to work on this? Sign up.</small>
    <% else%>
    <small>You are not a seeker, you need to be a seeker!</small>
    <% end %>
    </div>
    

    CanCan is used at Controller level, so the above approach is easy and direct for your case.

    I hope this will help.

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

Sidebar

Related Questions

I have a html code which I saved in home.txt file and placed it
I have the following HTML code: <select name=forma> <option value=Home>Home</option> <option value=Contact>Contact</option> <option value=Sitemap>Sitemap</option>
I have following code <div id=main> <div id=one> </div> <div id=two> </div> <div id=three>
I have following code: <div id=mainMenuInternalMyProfile class=mainMenuInternalTab data-pagename=myprofile> <div class=mainMenuInternalTabClickable>&nbsp;</div> <h4 class=mainMenuInternalTitle>MY PROFILE</h4> <img
In the master page I have the following code: <!DOCTYPE html> <html> <head> <meta
I have the following html code <!DOCTYPE html> <html lang=en> <head> <meta name=viewport content=width=device-width;
Have the following code: $(#blogs).mouseover( function () { $(this).addClass(hover); $(#home).removeClass(hover); $(#homepages).removeClass(hover); $(#apps).removeClass(hover); $(#facebook).removeClass(hover); $(#kontakt).removeClass(hover);
I have a following code: <div id=mws-navigation> <ul> <li><p:commandLink value=#{contentMB.msg.welcome_title.value} actionListener=#{cleanUpMB.alChangeArea} styleClass=mws-i-24 i-home action=#{welcomeMB.aLoadDashboard}
I have the following code where I am selecting a file. But no matter
Hi have the following content within an html page that stretches multiple lines <div

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.