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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:32:59+00:00 2026-05-27T18:32:59+00:00

using the gems cells and declarative_authorization (along with Devise) and I’m trying to figure

  • 0

using the gems cells and declarative_authorization (along with Devise) and I’m trying to figure out how to include the permitted_to? into the cell templates. So far I’ve added this to my cells Cell (the Devise one works for it’s helpers):

class SidebarCell < Cell::Rails
    include Devise::Controllers::Helpers
    helper_method :current_user
    include Authorization::AuthorizationHelper
    helper_method :permitted_to?



  def display(args)
    @object = args[:object]
    @notice = args[:notice]
    @alert = args[:alert]
    render
  end

end

But it’s bombing at the fact that declarative_auth helper module uses the following code:

def permitted_to? (privilege, object_or_sym = nil, options = {}, &block)
      controller.permitted_to?(privilege, object_or_sym, options, &block)
    end

and obviously this gives

undefined local variable or method `controller' for ...

UPDATE:

After some more thinking, I’m not sure this would ever work with Cells. Declarative_auth needs the controller to base it’s rules on, but Cells has nothing to do with that controller. It would seem to me that the two are incompatible, unless I pass a reference to the controller into Cells? Starting to think that Cells isn’t the way to go.

  • 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-27T18:33:00+00:00Added an answer on May 27, 2026 at 6:33 pm

    This will work if you add

    helper_method :controller
    

    that just delegates:

    def controller
      parent_controller
    end
    

    Sorry for that inconvenience, but the entire helper architecture in Rails sucks: http://nicksda.apotomo.de/2011/10/rails-misapprehensions-helpers-are-shit/

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

Sidebar

Related Questions

Using Your Ruby Gem(s) You will need to add /home/username/ruby/gems to the include path.
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
We're using gems:unpack to ensure gem version consistency across environments. However, we're running into:
When trying to install gems using rvm i get this error $ rvm gem
Odd problem, trying to figure out what is going on here with my fresh
I'm using the GCal4Ruby gems plugin. I'm trying to get it render an embedded
Using Rails 3.0.3 in combination with gems like devise I don't get any flash
I am trying to install gems using the following: gem install bundler && bundle
I'm using the twitter gem located here... http://rubydoc.info/gems/twitter/2.0.2 I'm trying to use a method
So I've tried to install net::ssh::multi on mac using gems: gems install net-ssh-multi The

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.