jhshaw44 / TechDatabase

A web service used to search a database containing information about BCPSS schools and other information pertinent to the Office of Media and Instructional Technology.
0 stars 0 forks source link

Destroy function not operable #7

Closed eburch2 closed 7 years ago

eburch2 commented 7 years ago

Low priority. Doesn't actually delete records.

eburch2 commented 7 years ago

http://stackoverflow.com/questions/18154916/rails-4-link-to-destroy-not-working-in-getting-started-tutorial

destroy is bugged in our Rails version 4.1.4 as it creates a GET request using JavaScript when really it should be doing a POST request. button_to resolves this issue.

"I had the same issue, for rails 4.2.X. Checked all my javascript files but could not make it work. if u look closely at the server request u will be missing 'authenticity_token' in the params, so user gets logged out. In rails 4.1 and above u have to use button_to instead of link_to"