title: How can I remove a filename extension from a string in Rails 4?
body: <p>I'm trying to remove the extension from a string with the following structure:</p>
  
  <pre><code>name.stl
  </code></pre>
  
  <p>I found that I can use the <code>basename</code> method to get the string. The problem is that I am not using the file path, and I already have the string with the name. I just need to delete the extension from the string.</p>
  
  <p>It seems to me that a regular expression would be a great option to detect the dot and delete everything from it to the end.</p>
  
  <p>How can I use a regex to do this on Ruby on Rails 4?</p>