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

The Archive Base Latest Questions

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

Is it possible to pull a user object from any controller? For me it

  • 0

Is it possible to pull a user object from any controller? For me it seems to only work in my users controller.

I’m trying to render a form that a user can use to update the details they signed up to the website with e.g. names, email, password etc. The problem is the page won’t load (it is called using .load jquery function). It won’t load when the form is added to the page but will load when it isn’t there. I’m thinking it’s something to do with it not being able to access the database.

In my pages controller I have this:

def edit_account

    @user  = User.find(params[:id])
    case params[:view]
      when 'basic_info'
        render 'pages/settings/basic_info'
      when 'relatives'
        render 'pages/settings/relatives'
    end

    @title = "My Account"
  end

It doesn’t seem to work. Am I missing something?
@user object works fine in user_controller and it’s associated views but not in pages controller. Is there a way to give pages controller access?

Thanks

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

    If you are using proper REST methods, the id will be the id of the page not the id of the user.

    What you can do is

    @page = Page.find(params[:id]) 
    

    And if pages and users are related (ie a page belongs to a user), you can do:

    @user = @page.user
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to pull a bunch of .jpg pictures form a local file
Is it possible to pull photos from the Flickr API based on a search
Is it even possible? Basically, there's a remote repository from which I pull using
Possible Duplicate: PHP Twitter API - How to pull in multiple users tweets? Is
I'm working on a script currently that needs to pull information down from a
I have a form that a user would fill out while creating a ticket
We have a website that we would like to extrapolate user controls from and
Q: Is it possible to pull out the value for one of my ModelForm's
Is it possible to get Mercurial to show progress of long-running push or pull
I want to programattically pull a movie file down into a NSData object and

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.