Hoping to get some help with the proper way to pass controller data to the view when using ajax calls in Rails.

I have a page where there's a list of profiles. The user on the page can click on any profile and bring up a wish list from that specific profile. The call is made via remote: true in rails so it's an ajax call

```
class ProfilesController < ApplicationController

  def show
    @list = Profile.find(params[:id]).get_wishlist

      respond_to do |format|
        format.html
        format.js
      end
  end
end

```

The page will then update a partial on the page that displays the items in the wishlist. Can't figure out the proper way to get the @list data from the controller into the show.js.erb view template. So far, I've tried things along these lines to retrieve the data into the .js.erb view template

```
var list_data = "<%= j( @list ) %>";

```

I'm specifically trying to get the result loaded into a JSON object within the js.erb template so I can loop through the results and do some other things. Any help much appreciated or pointing me to where I can find the answer.