I have several forms in the same view, and it seems that they are conflicting with each other. I have a form that is supposed to call the reveal action in the users controller but instead it is calling the logins action in the user controller.
Here is my config/routes.rb:
get "logins" => 'users#logins', :as => 'logins'
delete "logins" => 'users#deletelogin', :as => 'logins'
post 'logins' => 'users#addlogin', :as => 'add_login'
get "logins" => 'users#search', :as => 'search'
get "logins" => 'users#reveal', :as => 'reveal'
Here is the button that is linking to the wrong action:
<td><%= button_to "Reveal", { :controller => :users, :action => 'reveal', :id => login.id }, method: :get, :class => 'btn' %></td>
This is the html that is rendering:
<td><form action="/logins?id=24" class="button_to" method="post"><div><input class="btn" type="submit" value="Reveal" /><input name="authenticity_token" type="hidden" value="POKdWunwvaKQHb+Mzj/3UrG0xIbKPqELy4n3VGqGrxU=" /></div></form></td>