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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:18:22+00:00 2026-06-02T03:18:22+00:00

Using Cells and Devise, when trying to access a Devise :current_#{mapping} (like current_user) I’m

  • 0

Using Cells and Devise, when trying to access a Devise :current_#{mapping} (like current_user) I’m getting request as undefined errors:

ActionView::Template::Error (undefined local variable or method `request’ for #)

I’ve included the Devise Helpers methods, but they access the web context request which isn’t present in Cell::Base. My Cell controller looks something like this:

class ActivityCell < Cell::Base
  include Devise::Controllers::Helpers
  helper_method :current_user

  def display
    puts current_user.id # <-- Error starts here
    ...
  end
end

I’m using RubyMine, when I debug the situation, inside a non-Cells normal Controller, self has request. Inside a Cells::Base Controller, request isn’t around.

I found this snippet here which is supposed to show how to access request and other important bits from a Cells Controller, but it’s a bit unclear how to simply get Devise to work as intended in a Cells Controller. e.g. Cells::Base makes request and whatever else Devise needs available

I think something might be wrong with my Cells version, but I’m using 3.8.3. (the latest) The reason I think this is because I also don’t have “session” available as demonstrated here under item #4 “Controllers should be slim”. I can’t access session from a Cell::Base Controller. I don’t know if this was only possible with Ruby 2.x previously and now with 3.x it’s not possible. (article doesn’t mention versions, but I see the comments were posted late 2010)

class CartCell < Cell::Base
  def display
    @user = session[:user]

    render
end

Other than this issue, I’m super digging Cells. I’m using it for isolated widgets, which use jQuery AJAX to yank JSON from them for graphing purposes.

Any help would be appreciated. I need to know details about the current Devise user that’s logged in!

  • 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-02T03:18:23+00:00Added an answer on June 2, 2026 at 3:18 am

    As you already pointed out yourself 😉 just derive the cell from Cell::Rails and everything will work just fine.

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

Sidebar

Related Questions

using the gems cells and declarative_authorization (along with Devise) and I'm trying to figure
I'm using rails 3 and Devise and i'm trying to restrict some actions to
using jquery I need to retrieve an array from table cells, format the data
Using storyboard, static cells, in cellForRowAtIndexPath: the line UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; always
I'm using a UITableView to display custom cells created with Interface Builder. The table
I have locked cells in a spreadsheet using this lines of code. Range(A1:D23).Select Selection.Locked
I want to merge two cells in excel using pyExcelerator , ws.write_merge(r1=0,r2=1,c1=0, c2=0, label='test1',
I have just Extracted the cells from the excel sheet using Apache POI, everything
Using AppleScript, how can I change the background color of cells ranging from A3
I am using the JQuery UI selectable plugin to select table cells, here is

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.