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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:02:15+00:00 2026-05-29T10:02:15+00:00

Once a user logs into their account, they are presented with a list of

  • 0

Once a user logs into their account, they are presented with a list of ‘Employees’.

As of right now, when you click an employee, it takes the user to the ‘show’ page of that specific employee, however I want to add a ‘pin-protected’ aspect to that list before it renders the show page.

I want to add a simple layer of authentication that would go like this:

  1. When a user clicks their name on a list, a text-field appears that asks for the selected employee’s pin.

  2. The user types in the pin. On submit, it compares the inputted pin against the ‘pin’ column for that employees’ record. If it’s correct it grants access to the selected employee’s show page.

Is this something that is easily done in RoR? This is the first real app I have worked on, so I am having trouble wrapping my mind around a couple concepts like these.

Thanks so much!

  • 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-29T10:02:15+00:00Added an answer on May 29, 2026 at 10:02 am

    Take a look at devise, it’s most definitely your best bet for Ruby on Rails 3 authentication layer.


    You’re best bet if you just want to add a little functionality to your existing model class would be to add a method along the lines of:

    def validate_pin(pin_to_check)
        self.pin == pin_to_check
    end
    

    And then you just need to modify your employee controller so that show method checks to see if the pin has been provided (ideally via a session variable), otherwise redirect and request the pin with an additional method and route Employee#request_pin in the controller which asks the user to enter the pin, on success redirecting to the Employee#show route.

    Session handling in the controller

    To write the session variable, you’d need an Employee#check_pin method (as a POST route) and you’d just use the code:

    session[:pin_valid] = true
    

    Then you’d check session[:pin_valid] in your Employee#show method

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

Sidebar

Related Questions

I have a pop-up window a user logs into, once they are logged in
i need to get (somehow) the longitude/latitude of a user once they click on
I have an order table in my database and once a user logs into
The issue here is that when my user logs into my app, they always
I've added the following code to my masterpage (Page_Load) so once a user logs
Once a user starts a session (or logs in, for a registered user, to
This is driving me crazy. A user logs into my Facebook app, does some
Once a user has selected a file with the open file dialog, how can
Once the user is authenticated, I fetch the User information from the Database and
How do I make this so once the user inputs a number and presses

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.