title: Converting splat attributes from Slim to ERB
body: <p>I'm new to Rails and was tasked to change a legacy code that's written in slim to ERB. Everything was going smoothly, but when I reached the splat attributes and found myself blocked.</p>
  
  <p>The slim I'm trying to convert is like this:</p>
  
  <pre><code>doctype html
  html lang="en" *data_turbolinks_messages
    head
  </code></pre>
  
  <p>The respective controller is:</p>
  
  <pre><code>DATA_TURBOLINKS_MESSAGES = {
      'data-turbolinks-messages' =&gt; ENV.fetch('TURBOLINKS_MESSAGES')
    }.freeze  
  
  def data_turbolinks_messages
      DATA_TURBOLINKS_MESSAGES
  end
  </code></pre>
  
  <p>And the final HTML I've expected is like this:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html data-turbolinks-messages="VariableValue" lang="en"&gt;
  &lt;head&gt;&lt;/head&gt;&lt;/html&gt;
  </code></pre>
  
  <p>I've tried using <code>slimrb --rails -e</code> but the outcome has many slim helper objects like <code>::Slim::Splat::Builder.new(_slim_splat_filter)</code> and I don't know how to write that in ERB. </p>
  
  <p>Other solutions I've tried (shooting in the dark here.. again, new to Rails)</p>
  
  <ul>
  <li><code>&lt;%= **data-turbolinks-messages -%&gt;</code> </li>
  <li><code>&lt;%= **data-turbolinks-messages.html_safe -%&gt;</code></li>
  <li><code>&lt;%= *data-turbolinks-messages %&gt;</code> </li>
  <li><code>&lt;%= data-turbolinks-messages.to_s %&gt;</code> </li>
  <li><code>&lt;% *data-turbolinks-messages.html_safe %&gt;</code></li>
  <li><code>&lt;%= tag.html lang:'en' data-turbolinks-messages %&gt;</code></li>
  <li><code>&lt;%= tag.html lang:'en' data: data-turbolinks-messages do %&gt;...&lt;% end %&gt;</code></li>
  <li><code>&lt;%= tag.html lang:'en' data:{data-turbolinks-messages} do %&gt;...&lt;% end %&gt;</code></li>
  </ul>
  
  <p>Is there a way to bring that hash as key-value tag parameters, hopefully without changing the controller, which has other dependencies?</p>
  
  <p>thanks!</p>