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

  • Home
  • SEARCH
  • 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 8841409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:42:37+00:00 2026-06-14T10:42:37+00:00

I use devise for authentication in my web application and my web application also

  • 0

I use devise for authentication in my web application and my web application also responds to iPhone applications. So far I have done only authentication and so when the iPhone app sends the username and password as

http://localhost:3000/login.json  -d "{'user' : { 'username' : 'sample@yahoo.co.in','password' : 'password'}}"

The response would be

{“user”:{“authentication_token”:”LayzZw3s3gsNMFRJp1JR”,”email”:”sample@yahoo.co.in”,”username”:”sample@yahoo.co.in”}}

But now I need to create friendships between user from iPhone application i.e., the user have to send friend request to another user through API and the another user should receive a request

After the user accepts the request the user should be added to the friend list of both users and the friends of the user should be displayed when the user needs by calling API

How can I do this?

  • 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-14T10:42:39+00:00Added an answer on June 14, 2026 at 10:42 am

    As m_x said this has nothing to do with authentication.

    What you should create is a self referential associon between users with an has many trhough relationship.

    An user has many friends trough friendship (and in the same time has many inverse_friends).

    This is very well explained in railscast #163 http://railscasts.com/episodes/163-self-referential-association

    In your scenario the inverse_friend should be considered as “friends request” and once a user has both a friend and an inverse friend relation with another user the “friendship” should be considered accepted.

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

Sidebar

Related Questions

I'm developing Rails application and I have to use authentication. I installed devise gem
I use devise for authentication and only an admin can create a user. I
I use Devise for authentication and I have an admin role who can manage
I am using Devise gem for web authentication in my Application. Now i am
I have a Rails application for which I use devise to authenticate my users
I use devise for authentication and i have created a user controller and specified
I currently use Devise 2.1 + Rails 3.2.x to authenticate users. I'm also going
I'm using rails_admin which use devise. Some words still displays in english. I have
I have two models User and Admin(with RailsAdmin) that use Devise. I sign in
Basically, I tried to use twitter-bootstrap-rails and devise gem in my app. However, when

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.