tor - What is the best way to do Rails 4 link_to :delete if JS may be disabled? -


here's standard bit of code (rails 4):

<%= link_to 'log out', logout_path, :method => :delete %>

however, here's nonstandard consideration: no javascript. without javascript, jquery_ujs doesn't hooks in, link creates plain get /logout, has no route.

why? because want support tor hidden site version of site, , have assume tor users (coming via tor browser bundle) have javascript disabled. (i deliberately not want enable js them, prevent various potential privacy leaks. don't want permit xsrf attacks e.g. allow log out users get, nor make ui ugly button.)

the hidden site lower functionality main site (e.g. no payments accepted via tor), basic things login/logout ought work correctly.

what's best way support this?

maybe can create form using form helper. allow specify method use. rails generate hidden field inside form specifies http method, on submitting used rails determine controller action call.

the thing left write css make submit button link, can find on webs.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -