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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:15:44+00:00 2026-05-27T12:15:44+00:00

In several places in a rather complex Rails app there are references to a

  • 0

In several places in a rather complex Rails app there are references to a particular kind of object; let’s call them “apples”. I’d like to change all of these user-facing references from “apples” to “oranges”. This would be simple enough, except that I’d like to retain Apple as class, so I don’t want to touch the myriad methods, variables, symbols, etc. that use the word “apple”.

There are several orders of magnitude more instances of apple in the code proper than there are user-facing instances of “apple”. My question is: How can I zero in on the relatively few displayed instances? Is there a way to perform a search on all and only what is displayed by a browser?

  • 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-27T12:15:45+00:00Added an answer on May 27, 2026 at 12:15 pm

    Unless you’ve taken a disciplined approach to separate your language from your code, such as using localization files, then no, there’s no easy way to find instances of displayed text. How is a search supposed to differentiate between 'apple' used as a type column and 'apple' inserted into a page?

    This is why you might want to take an approach where you don’t embed language in your controllers and models. Instead you could create a helper method to describe them for you:

    You have <%= pluralize_model(@apple, 10) %> left.
    

    That method, if constructed properly, would render '10 apples' or whatever term you’d like to use for that type of object.

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

Sidebar

Related Questions

I run a rather complex project with several independent applications. These use however a
I've read in several places that the rectangle functions in emacs are very useful.
I have read in several places that it's possible to share the objects directory
It seems like Sql Reporting Services Server logs information in several places including web
I'm working on an application that will gather data through HTTP from several places,
I am currently working on an application that uses a TableViewer in several places
I have an application that uses AJAX liberally. I have several places where a
Several years back, I innocently tried to write a little app to save my
I have several places where I need to display an alert and handle the
For an app that I am writing I need to display several views (in

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.