Is there a way to grab / fetch a variable inside `js` between two different views? Say I have an index view with does:

```
<% foo.each do |foo| %>
  <%= link_to 'bar', bar_path %> 
<% end %>

```

Then in `bar` I want to add some jQuery to a specific element with `foo.id` selector: 

```
$('div#<%= foo.id %>').fadeOut(); // I know the interpolation wouldn't work here

```

I know I can pass `foo.id` to `bar` with my path or send it via the `locals` hash, but how would I "grab" it with jQuery?