Searching an external API through a rails form and displaying the results in the view
<p>I need to search data (tutorials) from an external API with 2 params (tag and device) provided by a form in my rails app.</p>

<p>In my routes I have:</p>

<pre><code>resources :search_lists, only: [:index] do
  collection do
    post :search
  end
end
</code></pre>

<p>Here's what I think I should put in my <code>SearchListsController</code>:</p>

<pre><code>def index
  @search_parameter = params[:tags]
end

def search
end
</code></pre>

<p>I'm not sure how I would organize my code and where I should pass the API calls.</p>

<p>Here's my view, rails doesn't recognize the <code>search_lists_url</code>:</p>

<pre><code>&lt;form action="&lt;%= search_lists_url %&gt;"&gt;
  &lt;input type="text" name="" value="" placeholder="Search by tag"&gt;
  &lt;label &gt;Filters:&lt;/label&gt;
  &lt;input type="checkbox" value="first_checkbox"&gt;Smarthpone
  &lt;input type="checkbox" value="second_checkbox"&gt;Tablet
  &lt;input type="checkbox" value="third_checkbox"&gt;Mac
  &lt;br&gt;
  &lt;input type="submit" value="Search"&gt;
&lt;/form&gt;
</code></pre>

<p>Can anyone help me please ? :)</p>