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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:48:17+00:00 2026-06-06T14:48:17+00:00

Sorry the title may not be very clear. Basically I have a wrapper for

  • 0

Sorry the title may not be very clear. Basically I have a wrapper for the Split gem called ABFeature in lib/ab_feature/ab_feature.rb

In my view I want to be able to call my helpers like this:

ABFeature.current_settings

But this is not working, here is the error I have:

undefined local variable or method `session' for ABFeature:Module

session is a method from ActionController and is seems I can’t access it…

Here is my code:

require 'split'

module ABFeature
  class << self
    include Split::Helper

    def current_settings
      ...
    end
  end
end


class ActionController::Base
  ActionController::Base.send :extend, ABFeature
end

Any idea?,
Greg

  • 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-06T14:48:18+00:00Added an answer on June 6, 2026 at 2:48 pm

    I’m not sure what the result should be but if you want the current_settings method available in the controller I think you can do

    module ABFeature
      include Split::Helper
    
      def current_settings
      end
    end
    

    and then

    class ApplicationController < ActionController::Base
      include ABFeature
    end
    

    I think you usually call helpers as instance methods. Then they should share the context with the controller.

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

Sidebar

Related Questions

Sorry the title is not very clear. This is a follow up to my
Firstly, sorry about the question title, it may not be very descriptive for my
Sorry the title is very vague. Basically, I'm stuck with something. I have an
sorry if the title is not very clear. I will try to explain now:
Sorry if the title doesn't make sense. Basically I have a series of strings
Sorry if the title isn't very clear, I couldn't think of anything better... I'm
Sorry the title is not very descriptive but it is a tricky problem to
Sorry for the title may seem confusing. i have 2 element. with no relation
Sorry if title is not too clear but I think it's about right. NEhow,
Okay the question title may not have made sense... mostly because I don't know

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.