# Link\_to, image\_submit\_tag, "changes only with POST" and "usa

**URL:** <https://www.ruby-forum.com/t/link-to-image-submit-tag-changes-only-with-post-and-usa/87901>\
**Category:** Rails\
**Created:** [March 6, 2007, 6:52pm UTC](https://www.ruby-forum.com/t/link-to-image-submit-tag-changes-only-with-post-and-usa/87901 "2007-03-06T18:52:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliver-peng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/b3f665/32.png) [@oliver-peng](https://www.ruby-forum.com/u/oliver-peng)\
**Post date:** [March 6, 2007, 6:52pm UTC](https://www.ruby-forum.com/t/link-to-image-submit-tag-changes-only-with-post-and-usa/87901/1 "2007-03-06T18:52:02Z")

</div>

Hello,

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](http://www.w3.org/2001/tag/doc/whenToUseGet.html) - means GET should be  
safe
3. if Javascript is disabled the application should work too (without  
AJAX)

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?

---

<div class="post-metadata">

**Author:** ![oliver-peng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/b3f665/32.png) [@oliver-peng](https://www.ruby-forum.com/u/oliver-peng)\
**Post date:** [March 7, 2007, 11:53am UTC](https://www.ruby-forum.com/t/link-to-image-submit-tag-changes-only-with-post-and-usa/87901/2 "2007-03-07T11:53:58Z")

</div>

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  
(GET).
