What is the reason behind every single request being treated as an ajax request?

Recently, I embarked on a new application development journey using rails 4.0. However, I've encountered an unexpected situation where every request is being processed as an ajax request. For instance, consider this link:

 =link_to  "View detail", product_detail_path(:seo_name => vp.product.seo_name, :vp_id => vp.id), :class => "btn btn-default"

When I click on the above link to navigate to the product detail path and inspect the controller code for the same link:

def show
  @product = Product.find_by_seo_name(params[:id]) #here in params[:id] you will get seo_name of product        
  @other_variants = @product.variant_products.where("variant_products.id NOT IN (?)", @variant.id)

The issue arises when I visit the product show page by clicking the link mentioned earlier, as it seems to be processed as an ajax request. Upon examining the browser console, I notice the following line:

GET http://localhost:3000/products/product-1-tb002?vp_id=71         

This behavior is consistent across other links in my application, both those that are intended to be ajax requests and those that should result in html responses. It's puzzling and I can't seem to pinpoint the root cause!

In the image below, I demonstrate clicking on the "view detail" button which leads me to the product show page. Notably, the link does not include "remote => true" attribute, yet it still triggers an ajax request.

https://i.sstatic.net/yBQpy.jpg

Answer №1

The problem lies within turbolinks. To resolve this issue, simply deactivate or uninstall the turbolinks feature and you will notice the desired behavior.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Fetching row data from Datatables, followed by executing fn.dataTable.ext.search.push

My alert function is operational, however I am having difficulty utilizing the rowData to filter my other instances of datatables. Here's the link to my codepen: http://codepen.io/smuglovsky/pen/YpNjXm?editors=1010 I picked up the technique of "click ...

Utilizing AngularJS to dynamically inject HTML content into $scope

In my possession are the following files: index.html //includes instructions for passing arguments to the btnClick function in app.js <div ng-bind-html="currentDisplay"></div> app.js app.factory('oneFac', function ($http){ var htm ...

Eslint in Gulp can't locate my .eslintrc configuration file

My gulp-eslint is unable to locate my .eslintrc file. I've set up a lint task as follows: gulp.task('lint', function () { gulp.src(['src/**/*.js', 'src/**/*.jsx']) .pipe(eslint()) .pipe(eslint.format()); }) The t ...

Issues with EventListeners in Internet Explorer

Similar Inquiry: Issue with MSIE and addEventListener in JavaScript? I am currently attempting to detect a close event on a popup window created by the parent page. The objective is for users to fill out a form and then, via a popup window, grant perm ...

Is there a way to create a nested object literal that will return the length of

I am working with JSON data that includes different locations (sucursales) and cars for each location. How can I write a function to calculate the total number of cars across all locations? [{"sucursal": "Quilmes", "direccion&q ...

Tips for returning to an ajax request after navigating away from the webpage

Is it possible to resume an ongoing Ajax request after exiting and returning to the webpage? For example, if I start an Ajax request and see a progress bar moving forward, then leave the page and come back later, how can I go back to the active request wit ...

Ways to extract metadata from a given URL

Recently, I've delved into the world of JavaScript and I'm looking to extract metadata from a given URL. Whenever a URL is entered into an input field, I want to retrieve its meta data - a simple task in HTML using JavaScript. However, every time ...

Select an option within a for loop nested in an each function

How To Fetch JSON Data and Create a Shopping Cart $.ajax({ url: "myurl", type: 'POST', dataType: "json" }).done(function(response){ $.each(response,function(k,v){ //UL this products info list ...

Having difficulties creating an array due to identical id tags causing HTML to break in JavaScript

I've been grappling with this issue all day. Before delving into dynamic solutions, I'd like to create multiple divs with unique id tags or classnames rather than repeating ids. Whichever option proves simpler would be greatly appreciated. Curren ...

Error: The use of import statement is not allowed outside a module in JavaScript due to a Syntax

I'm just beginning my journey with React, starting from scratch without setting up all the necessary dependencies. Initially, I used CDNs in my html file but now I want to learn how to import React and ReactDOM into my local setup and also link CSS fi ...

What causes the q[num] error to occur when stopping a jQuery queue process?

When I use $.manageAjax to create and execute an ajax request queue, I encounter an issue when trying to abort the entire queue using ajaxManager.abort();. An error message pops up saying: q[num] has no properties (jquery.ajaxmanager.js line 75) Here is t ...

Angular reactive forms can be customized to include a patched version of the matTime

I have an angular mattimepicker in my project. When trying to use it in a reactive form, I am encountering issues with patching the value to the edit form <h1>Reactive Form</h1> <form [formGroup]="form"> <mat-form-fie ...

A method to apply a class to the third <li> element using javascript

Can someone help me figure out how to add a class to the third element using Javascript? Here is the structure I am working with: <ul class="products-grid row four-columns first"> <li class="item"></li> <li class="item"></li&g ...

Angular2 Service Failing to Return Expected Value

It's frustrating that my services are not functioning properly. Despite spending the last two days scouring Stack Overflow for solutions, I haven't been able to find a solution that matches my specific issue. Here is a snippet of my Service.ts c ...

Storing user information in Angular after login and implementing JWT authentication

Is it advisable to save any user information other than JWT in local storage or cookies after a successful login? (The user profile object is already saved and encrypted in the JWT payload sub-part.) I need the user profile object ready before initializing ...

Expanding the use of tagged template literals for passing additional arguments

Currently, I am utilizing styled-components and creating components through their tagged template literal syntax like this: const Button = styled.button` background-color: papayawhip; border-radius: 3px; color: palevioletred; ` In a specific scenar ...

How can I send various maximum values to the Backbone template?

Although in theory, it may seem simple, I am unsure about the exact code to use. In a view, if I define a variable max that retrieves an attribute called points from a collection, I can pass this variable as an object into my template using maxPoints.toJS ...

Halting execution: Trying to use the keyword 'import' which is not allowed here

0. April 2023: error cannot be reproduced anymore see here The error is no longer replicable due to bug fixes in react-scripts 5.0.1. 1 Even though the error is gone, the question and my self-answer still seem relevant to Angular users and others as we ...

The functionality of Jquery radio:checked is not behaving as desired

Currently, I am in the process of learning jquery. I have created a basic html file with some jquery validations, however, they are not functioning as expected. The main problem is: If I input my name first and then check the checkbox, everything works co ...

When the program is executed, immediately use .trigger('click')

There is a spelling game that features a grid filled with hidden words. The objective of the game is to spell out these words by clicking on the letters of the alphabet, aided by hints such as images and sounds. Players are given the word they need to spe ...