I have my posts generating a :key_code when created. I want a user to be able to use that code in a form field to destroy the post they made, without being signed in. My difficulty is with form_tag… how could I make a form_tag view to check the :key_code entered with the one stored in the database? I’m having a hard time understanding form_tag.
My route looks like this:
get 'posts/:id/code' => 'posts#code', :as => :code
Any help is much appreciated
If I understand correctly then your route is wrong as you need a dynamic param
code, so you should use:codeinstead of simplycode:To generate a url to that route in
form_tagyou use: