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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:21:17+00:00 2026-06-01T15:21:17+00:00

i was wondering how to use ajax for messaging between 2 users. im not

  • 0

i was wondering how to use ajax for messaging between 2 users. im not really sure how to go about doing it. i essentially want a /messages URL, and in it will have a ‘sent messages’ button and also a ‘received messages’ button. when a user clicks on ‘sent messages’, it’ll show all the sent messages asynchronously, and likewise for ‘received messages’.

i created two partials for showing each of them separately, but im kinda lost on what to put inside Message#index (where /messages gets displayed). what kind of form should i be putting in there? i read that since its my index function being called, i should have a responds_to for a .js inside the function and then create a file titled index.js?

sorry but this ajax is still new to me.
thanks a lot for your help = )

  • 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-01T15:21:19+00:00Added an answer on June 1, 2026 at 3:21 pm

    It will be to complex to answer you how to build views, partials and controllers code, but I can show you the general concept about solving your problem.
    This can be devided with next steps:
    1. You have to provide a way for users to be registered in your system.
    2. Each user should have access to controller (say, Messages).
    3. Messages controller should have several actions to provide user create and send messages. Also you should have some index-like action (and it’s .js representation) to show messages delivered to this user. To achieve this you can use polling for changes method well shown here: Polling for changes. To create new message you don’t actually need to use AJAX. It can be simple form for sending some text to action in your MessagesController. Message can be saved in database and then rendered on the index view by ‘polling for changes’ technique.

    I hope I gave you some clue to solve ypur problem.

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

Sidebar

Related Questions

Greetings all i want to use ajax with spring framework and i was wondering
I was wondering how to use cin so that if the user does not
I'm trying to use AJAX via jquery with ASP.NET MVC, but I'm not able
I was wondering if it would be possible to use jQuery's ajax function to
I was just wondering how to use the function :not in my situation. This
I don't like Jackson. I want to use ajax but with Google Gson. So
I keep wondering why did facebook use like submit from button and not just
I am wondering about how people go about using CodeIgniter and jQuery for AJAX.
It's not that I'm not familiar with the concept but I'm wondering about what
When doing ajax requests using jQuery's ajax() function I never use any parameters other

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.