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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:53:46+00:00 2026-05-17T00:53:46+00:00

I need helping understanding the end to end flow in Rails. I could use

  • 0

I need helping understanding the end to end flow in Rails.

I could use help with the following example.. Lets take Facebook.

When you’re on Facebook.com, and click MESSAGES, the URL changes to (facebook.com/?sk=messages) and then AJAX is used to download the HTML/ JS content which is injected with JavaScript into the content pannel… No browser refresh which is what I’m after.

My specific questions are:

  1. For the content that is download via AJAX, is that content comingfrom a rails partial?… like(app>views>messages>_messagestable.html.erb
  2. Where should the JavaScript reside that knows to fetch the messagescontent and then inject the content into the content panel? (is thatthe application.js?
  3. Once the messages content (_messagestable.html.erb) is injectedinto the content panel, it will require new JavaScript functionsspecific to that content… Where should that live?
  • 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-17T00:53:47+00:00Added an answer on May 17, 2026 at 12:53 am

    Presumably Rails works just like any other major framework out there. Typically, you want your AJAX and GET requests to work nicely together. So imagine you have this url:

    http://www.example.com/messages

    Going here will load up the messages section of your site without having to make an AJAX call. However, if you go to:

    http://www.example.com/#/messages

    You will land on http://www.example.com and you can use AJAX to send the “/messages” part off to your server where it can interpret it as a request to that controller to get that messages view (or however you’ve got it set up). This is a technique that I’ve seen referred to as hijax because you can pepper your page with actual anchor elements that link correctly to

    http://www.example.com/messages

    or

    http://www.example.com/maps

    But in your javascript, you can cancel the operation of the link and redirect the browser to:

    http://www.example.com/#/messages

    or

    http://www.example.com/#maps

    Now since you have that other javascript function listening for changes in the hash tag, it does the same thing as if you had simply gone to that link directly…that is sending “/maps” off to the server, have the server interpret it, and kick back the required content HTML that you want to fill the page with. This way search engines can crawl your site and you can have a user experience that works great for people with and without javascript.

    Now for loading additional Javascript functionality after a page has already loaded, you could, I believe, simply use Javascript to insert a new tag, and add the source to wherever your new script resides. You can do this easily using jQuery’s .getScript() method:

    http://api.jquery.com/jQuery.getScript/

    As to where all this script resides…I guess that’s up to you or Rails. The ability to parse the URL hash is something you definitely need to make it all come together. For this, you have the option of a number of jQuery libraries:

    Detecting Back Button/Hash Change in URL

    Hope this helps..

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

Sidebar

Related Questions

Need your help guys in forming a query. Example. Company - Car Rental Table
I'm helping someone with a Wordpress blog which at one time was at http://example.com/example/
I need a helping hand in order to understand the following assembly instruction. It
I need to edit format for JFormatedTextField in a Java program. NetBeans are helping
Need to locate the following pattern: The letter I followed by a space then
need ask you about some help. I have web app running in Net 2.0.
I need your help to resolve a conflict between Tapestry and JaxB. The error
Can you guys help me understand a concept real quick, I'm having trouble understanding
I'm really need help with parsing XML by TBXML. I created a demo project
I need it help with shell script, python script or anything that can do

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.