Link_to, image_submit_tag, "changes only with POST" and "usa


I want to have the following features in my rails application:

  1. the program should have AJAX if Javascript available
  2. I want to protect my application described in
    URIs, Addressability, and the use of HTTP GET and POST - means GET should be
  3. if Javascript is disabled the application should work too (without

If I use “GET should be safe” option (verify) and link_to with :method
=> ‘post’ option these links do not work anymore with Javascript
disabled. My idea was now to use image_submit_tag to do e.g. a
‘delete’ action on list page. For this option I have to encode the
action (delete) and the id of the entity within the value option of
the generated HTML “input” tag. Is there a plugin for this
avalailable? The downside of this is that I have one form action which
has to decode the “value” content and delegate to the right action.
Did I miss something?

Ok. I solved it. I make a form_tag with a image_submit_tag for each
action which modifies something (POST). all others can use link_to