Sinatra param filter
<p>I am about to finnish my Sinatra Haml School project but I need a couple of things to get solved (I tried really hard but cannot solve the issues). I have a Software portfolio CMS where I can create new software entries (Title, Description, Language and Github link), being language a dropdown list filled from the database. Thing is I want to let the user select a filter from the list and filter by categories in the software list, but when I press the filter button it only shows the first entry. Here's the code in app.rb</p>

<pre><code>get '/softwares/:filter' do
    halt(404,'Forbidden') unless session[:admin]
    @sware = Software.all
    @categ = Category.all
    haml :sware
end


post '/softwares/:filter' do
    @sware = Software.find(category: params[:category])
    haml :sware
end
</code></pre>

<p>And here is the HAML code that shows the list of softwares</p>

<pre><code>%form{:action =&gt; "/softwares/:filter", :method =&gt; "post", :role =&gt; 'form'}
 %select{:name =&gt; "category"}
  - @categ.to_a.each do |category|
   %option= category.name
 %input{:type =&gt; "submit", :value =&gt; "Filter", :class =&gt; "btn"}
 %ul.list
 - @sware.each do |software|
  %li(class="glyphicon glyphicon-search" aria-hidden="true")
   %a{:href =&gt;"/software/edit/#{software.id}", :class =&gt;"btn btn-lg btn-primary"}= software.title
   %a.pull-right(href="/software/delete/#{software.id}" class="btn btn-lg btn-danger")  Delete
   %li(role="separator" class="divider") ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
</code></pre>

<p>Thanks a lot for your answers. I really appreciate every information you can provide about what am I doing wrong. </p>