title: rails form_tag and radio button that calls the destroy method
body: <p>I am creating an admin page for my app and it simply displays everything in my database. I want to have one of the table header's be delete, and the table data be a radio button that when clicked and hit enter, deletes that column from my table (and database).</p>
  
  <p>I have the DELETE route created from calling resources :urls in routes.rb:</p>
  
  <pre><code>resources :urls
  
  # DELETE /urls/:id(.:format)      urls#destroy
  </code></pre>
  
  <p>I have the Destroy Method in my url Controller:</p>
  
  <pre><code>def destroy
      id = params[:id]
      url = Url.find(id)
      url.destroy
  
  end
  </code></pre>
  
  <p>And in my admin.html.erb I have the following code:</p>
  
  <pre><code>&lt;div class="webpage-name"&gt; Admin Page &lt;/div&gt;
  
      &lt;table class="table table-hover table-striped"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt; id &lt;/th&gt;
                  &lt;th&gt; link &lt;/th&gt;
                  &lt;th&gt; random_string &lt;/th&gt;
                  &lt;th&gt; clicks &lt;/th&gt;
                  &lt;th&gt; delete &lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              &lt;% @urls.each do |url| %&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;%= url.id %&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;%= url.link %&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;%= url.random_string %&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;%= url.clicks %&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;%= form_tag(urls_path, method: "delete")%&gt;&lt;%= url.radio_button%&gt;&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;% end %&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>What I am trying to implement is the final <code>&lt;td&gt;</code>. I created a <code>form_tag</code> that sends the information to <code>urls_path</code> with the <code>method: "delete"</code>. But now how do I actually make a radio button, checkbox or anything that allows me to select many options and then hit enter and delete them? Also, I'm very new at this so I'm not sure if my <code>form_tag</code> syntax is correct and doing what I believe it to be doing.</p>
  
  <p>When I remove <code>&lt;%= url.radio_button%&gt;</code> from my code, I am able to view the admin page normally and just have an empty delete column.</p>