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

Advertisements