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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:03:09+00:00 2026-06-16T00:03:09+00:00

I need some advice: I am developing an rails application where multiple users click

  • 0

I need some advice:

I am developing an rails application where multiple users click a button. I need to know how many times the button has been clicked and disable the button when the click amount reaches a certain number.

What is better?

  1. Including in the button table, a column called “clicks” and updating the number by 1 each time the button is clicked?
  2. Create a clicks table and insert a row every time the button is clicked then check the number of rows?
  3. Other suggestions would be great as well.

Edit

The button can be clicked an infinite number of times per user, and I need to know which user caused the button to disable.

My original thought was a table with 4 Columns:title goal user_id current_number
and just increment current_number by 1 each time and store the user id of the user that makes the number reach the goal.

  • 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-16T00:03:10+00:00Added an answer on June 16, 2026 at 12:03 am

    Your first solution seems appropriate, the only downside I see is that once the clicked goal is reached your current_number field becomes redundant but I don’t really see any way of getting around that without over-complicating your application.

    The only thing that I think you might be able to expand on is possibly incorporating some sort of background queuing system with a redis back-end such as Resque or Sidekiq. I would only look down this path if performance is a concern, however.

    You can check out the recommendable repository on github for a similar implementation using background processing & redis.

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

Sidebar

Related Questions

i need some advice. I am developing an iPhone application (later for Android also)
I need some advice. I’m building an app that has a sequence of 4
I need some advice for a design which I have to implement in application.
I need some advice, what is the rule of the thumb when creating Rails
I'm developing an Asp.Net 3.5 application and I need to print some application generated
I am looking for some advice. I have been developing for about 11 years
I need some advice in building a Java server that handles multiple clients at
I need some advice for the best approach to use in developing embeddable widgets
Hi I'm developing a WPF application. I need to display some HTML content from
I'm not a die hard coder and I need some advice. I'm developing a

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.