Rails : acting weird : why layout is rendered when format.js

I don’t know why I am getting this issue. I have set remote: true in link_to helper method in view. and the controller is supposed to look like

class ProfilesController < ApplicationController
  def index
  end

  def profile_setting
    respond_to do |format|
      format.js
    end
  end
end

I have the file views/profiles/profile_setting.js.erb. I can even pry into the .js template using binding.pry [using pry-rails gem]. It renders the template but also renders layout i.e. layouts/application.html.erbContinue reading

jQuery DataTables: Update a row / cell after any event without table or page reload

Updating a cell or a whole without reloading the page of the table itself using AJAX is not that hard. However, in lack of proper documentation or tutorials or examples users find difficult to implement this. Continue reading