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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:18:34+00:00 2026-05-29T04:18:34+00:00

I have a discussion board, and users can post comments on the board. But

  • 0

I have a discussion board, and users can post comments on the board. But to cut down on spam, I am looking for a way to replace any URLs or Email addresses the users put in the text area with something like ‘forbidden’. or even just removing them entirely.

I don’t really have a clue where to start, so even something as a direction would help greatly. I was thinking of using Regex somehow, or I thought I recalled there’s something in Rails already that .restricted or .constrained different things in a text area.

Thanks..

  • 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-29T04:18:35+00:00Added an answer on May 29, 2026 at 4:18 am

    You should use ActiveRecord callbacks to check the comments before they’re saved in the DB. Look here for examples (like before_validation or before_save to replace), and use Regex to replace the forbidden content.

    Do not try to remove fordidden words in the JavaScript of your page, that’s not a good solution: it can be easily bypassed by the user.

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

Sidebar

Related Questions

In my discussion board I have a Post class. There are two special functions,
How we can implement reply to reply features in Sharepoint discussion Board. I have
I have a discussion forum/blog engine working with web forms. Each post contains html
This discussion started over here but I thought it would be nice to have
I am writing a discussion board software that will have avatar images for the
I have a Discussion Board in a SharePoint site which has an additional column
I'm building a discussion board in Rails 3, but I'm having difficulty formatting the
[I have this discussion at http://groups.google.com/group/django-users/browse_thread/thread/989c569d5118980d] Is 'django.template.loaders.app_directories.load_template_source' required in the TEMPLATE_LOADERS setting for
I have a large dataset with the lifespan of threads on an discussion board.
Let's suppose I have a Discussion model, and that a discussion can be tagged.

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.