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

  • Home
  • SEARCH
  • 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 6357593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:11:45+00:00 2026-05-24T23:11:45+00:00

I have a couple of controllers with associated helper modules. I got some helper

  • 0

I have a couple of controllers with associated helper modules. I got some helper methods that should behave similarly across different modules, meaning:

module UserHelper
  ..
  def destroy(user)
    link_to t(:destroy_user), user ... 
  end
end

module PhotosHelper
  ..
  def destroy(photo)
    link_to t(:destroy_photo), photo ... 
  end
end

I didn’t know (realize) that all of these helper modules are included by default, (which is ok, I guess,) and it doesn’t matter what view you’re calling the helper method from.

What is the best way to separate the rest of the helpers from my current controller/view so that, when controller_name == 'photos', only Photos and Application helpers are used?

The concept of Helpers is not really clear to me. Why not just have a single ApplicationController if all helpers are already mixed in? Is it just for “logical separation”?

I mean, of course, there’s a number of workarounds. But is it just me, or it really feels like there’s no reason to include all of the helpers globally?

  • 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-24T23:11:46+00:00Added an answer on May 24, 2026 at 11:11 pm

    If you called clear_helpers at ApplicationController class, they won’t share among different helper classes

    clear_helpers()

    Clears up all existing helpers in this class, only keeping the helper with the same name as this class.

    ref: http://api.rubyonrails.org/classes/AbstractController/Helpers/ClassMethods.html#method-i-clear_helpers

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

Sidebar

Related Questions

We have couple different web-apps that share the same db link. The hibernate layer
I have a couple of UITableViewController classes and I just noticed that these methods
I have a couple of view controllers that I want all to share a
I have couple of helper methods added to the existing classes, and i want
I have a couple of views all managed by their own controllers, some of
I have a couple of variables that need to be called in all controllers.
I have couple of dozen pieces of data that I need to save and
I have couple questions regarding some C++ rules. Why am I able to call
I have couple resource DLLs that I currently load when application starts using following
ok I have couple of .NET classes that I want to use in VBA.

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.