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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:37:52+00:00 2026-06-08T10:37:52+00:00

here is my problem, i get a variable from a request and store it

  • 0

here is my problem, i get a variable from a request and store it in @response.

then i debug response, debug(@response), and get this output:

--- !ruby/hash:Hashie::Mash
results:
- !ruby/hash:Hashie::Mash
  id: '33098557'
  firstName: john
  lastName: star
  relationship: self
  photo: https://foursquare.com/img/blank_boy.png
  tips: !ruby/hash:Hashie::Mash
    count: 0
  lists: !ruby/hash:Hashie::Mash
    groups:
    - !ruby/hash:Hashie::Mash
      type: created
      count: 1
      items: []
  gender: male
  homeCity: mexico
  bio: ''
  contact: !ruby/hash:Hashie::Mash
    email: jhon@hotmail.com
unmatched: !ruby/hash:Hashie::Mash
  email: []

i can get the results by typing @response.results, and get debuged this:

---
- !ruby/hash:Hashie::Mash
  id: '33098557'
  firstName: john
  lastName: star
  relationship: self
  photo: https://foursquare.com/img/blank_boy.png
  tips: !ruby/hash:Hashie::Mash
    count: 0
  lists: !ruby/hash:Hashie::Mash
    groups:
    - !ruby/hash:Hashie::Mash
      type: created
      count: 1
      items: []
  gender: male
  homeCity: mexico
  bio: ''
  contact: !ruby/hash:Hashie::Mash
    email: jhon@hotmail.com

but i cant get the inner attributes like the email or firstname, how can i access those attributes???

  • 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-08T10:37:54+00:00Added an answer on June 8, 2026 at 10:37 am

    @response is an instance of Hashie::Mash, while @response.results is an instance of Array, so you need to access the index of the array you wish to receive a result for.

    @response.results[0].firstName
    @response.results[0].contact.email
    

    will return the values for firstName and email of the first result respectively. You can loop through the responses (to get all results if there happens to be more than one) with

    @response.results.each do |result|
      result.firstName
      result.contact.email
    end
    

    If there’s always only one result you can also access this with Ruby’s .first method

    @response.results.first.email
    # ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my problem step by step, 1- I do ajax get request from
Problem: to get the command working here. My domain is http://cs.edu.com/user/share_dir , but I
Here is my problem. I'd like to get the last inserted Id with a
So Here is the Problem, I am trying to get that circle to align
So here is my problem, I'm trying to get the content of a text
I've stuck into some weird problem. Here is the code AccountsController.cs // GET /api/accounts
Maddening problem here. When my page loads: <body onload=getClientDateTime();> It runs this function: document.getElementById('ClientDateTime').value=hello
Is this even possible? Here's the problem: I have a keyword search with this
Problem: From jQuery i send a post request to server, the url i call
The problem here is how to add an NSPopUpButton in Xcode 4's Interface Builder

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.