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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:54:43+00:00 2026-06-09T11:54:43+00:00

In the application I’m creating I use a gem. This gem has a Module

  • 0

In the application I’m creating I use a gem. This gem has a Module with a method that is called by the gem when something changes. What I need to do is extend the functionality of this method. I cannot change the name of this method and I am not able to call a different method instead.

I’m talking about the rebuild method defined here:

https://github.com/the-teacher/the_sortable_tree/blob/master/app/controllers/the_sortable_tree_controller.rb

How can I add functionality to this method without touching the source?

  • 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-09T11:54:44+00:00Added an answer on June 9, 2026 at 11:54 am

    You need to include the module with the function name which you want to override in the controller and then you can write the function with the same name and call super when you are done with your work.

    class A
      include TheSortableTreeController::Rebuild
      def rebuild
         # do something here
         super
      end
    

    This way you will be able to perform yours as well as the operation of the gem as well. If you want to completely remove the dependency on the rebuild function remove super from the code.

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

Sidebar

Related Questions

Application : HTA (therefore IE) This is an application that uses SendKeys to populate
my application use 10 threads that to read a lot of html file.similar the
Application use NHibernate. I Have object A that contains set of objects B. I
My application has to detect that the device connected to the Wi-Fi network is
My application has a complex schema for the domain entity. It is required use
Application has an auxiliary thread. This thread is not meant to run all the
Application has many extension assemblies and they contain mappings for their classes. I need
Application configuration: Web application using java first method of creating JAX-WS 2.0 Web Services
Application names on Google Play don't need to be unique, and it's possible to
My application has one activity which starts two services but does not bind them.

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.