How to pass `current_user.id` to a controller?

CSS might be a better tool for the job if you just need to show/hide elements. Something like:

<head>
  …
  <style>
    [data-visible-to]:not([data-visible-to="<%= current_user.id %>"]) {
      display: none;
    }
  </style>
</head>
<body>
  …
  <div data-visible-to="<%= record.creator.id %>">
    …
  </div>
</body>
5 Likes