title: Hashtags linking to identical hashtags using rails
body: <p>I'm working on a sample website for an internship. It's like twitter and I'm trying to add something like hashtags. </p>
  
  <p>I have a working regex and I know how to handle a match to it but I can't figure out how to link tags to identical tags in other posts. </p>
  
  <p>This code may be irrelevant but here it is anyway:</p>
  
  <pre><code>@tag = /\B\#\w+/.match(@micropost.content).to_s
  
  if @micropost.content =~ /\B\#\w+/
    @micropost.gsub(/\B\#\w+/, )
  end
  </code></pre>
  
  <p>I don't even know if this would work because I have no way to test it, but I would like to replace a match to the regex with a link to all posts containing identical regex matches. The code for a link should probably go after the comma in the body of the if statement, but if anyone knows a better solution I would love to hear it.</p>