title: Splitting a symbol
body: <p>I'm very new to coding and am working on my first rails app. I'm using the Wordnik api to return synonyms of words. So far so good. The code below works, so long as I only use one word. </p>
  
  <p><strong>Code below is in index.html.erb</strong></p>
  
  <pre><code>&lt;%= form_tag "/search", method: "GET" do %&gt;
          Start Smithing:
  &lt;%= text_field_tag :search_word %&gt;
  &lt;%= submit_tag "get those synonyms" %&gt;
  </code></pre>
  
  <p><strong>Code below is in the Wordnik controller</strong></p>
  
  <pre><code>class WordnikController &lt; ApplicationController
    def search
      query = params[:search_word] 
      @words = Wordnik.word.get_related(query, :type =&gt; 'synonym').first["words"]
    end
  end
  </code></pre>
  
  <p>I'm trying to figure out how to input an entire phrase or sentence in the search and have the API return synonyms for each individual word in the sentence. This would require splitting the symbol and then passing each word individually into </p>
  
  <pre><code>Wordnik.word.get_related(query, :type =&gt; 'synonym').first["words"]
  </code></pre>
  
  <p>Problem is, I have zero idea how to do this. I was trying to do</p>
  
  <pre><code>query = params[:search_word].to_s.split
  </code></pre>
  
  <p>but that obviously didn't work.</p>
  
  <p>I couldn't find anything in <a href="http://ruby-doc.org/core-2.0/Symbol.html" rel="nofollow noreferrer">the Symbol documentation</a> and I also found <a href="https://stackoverflow.com/questions/16437931/splitting-a-symbol-in-the-same-manner-as-one-would-split-a-string">this question</a> here on Stack Overflow. </p>
  
  <p>Anyone have any thoughts that would point me in the right direction? </p>
  
  <p><img src="https://imgur.com/5JHLRhQ.png" alt="Screenshot of code with the above."></p>