Search code examples
ruby-on-railsrubyhttp-verbs

Patch link turning into get when opened in new tab?


I have a PATCH link that works normally when people click on it... but for some reason, when a user clicks on the link to open in a new tab, I get a routing error saying this path does not exist for GET.

<%= link_to "Create Note", member_create_tnote_path, method: :patch, class: 'btn btn-default' %>

I've confirmed its happening on more than one machine... I'm baffled...


Solution

  • Found the answer.

    The problem is that link_to is intended for get... button_to is intended for patch.

    Updated links to button_to... and everything is working properly.