title: Ruby send() with validation
body: <p>I've the following code in a .html.erb file which is called from show.html.erb.</p>
  <pre><code>&lt;%-
    platforms = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;]
  %&gt;
  
  &lt;%- platforms.each do |platform| -%&gt;
     &lt;%- if user.send(&quot;#{platform}_rate&quot;) -%&gt;
     &lt;%= render &quot;users/credentials/#{platform}&quot;, user: user %&gt;
  &lt;%- else -%&gt;
     Not Connected
  &lt;%- end -%&gt;
  </code></pre>
  <p>Unfortunately <code>b_rate</code> doesn't exist and is breaking with the following error:</p>
  <pre><code>undefined method `b_rate' for #&lt;User:0x00007hgh9b842ce0&gt;
  </code></pre>
  <p>How can I check if each <code>_rate</code> exists before using <code>send</code> method without getting messy with the code?</p>