On Sunday 16 Apr 2006 19:23, Belorion wrote:
My understanding was that using the :post=>true on a link_to() was supposed
to prevent search engine crawlers from triggering the link. However, this
does not seem to be working for me. Is there something else that I should
be/can be doing to accomplish this? Thanks.
Adding :post doesn’t do anything other than insert dynamically generated
such as web crawlers.
From the Rails API:
“And a third for making the link do a POST request (instead of the
GET) through a dynamically added form element that is instantly
on the GET. So its your responsibility to determine what the action
once it arrives at the controller. The POST form is turned on by
passing :post as true.”
So basically, you need to check if the request is a GET, and if so most
fall back to a second action which displays an actual form in order to
the first action again.
In your controller…
# do some destructive action
redirect_to :action => “confirm_destruct”
… where confirm_destruct will be another action that displays an
form which then goes on to call destructive_action again using the same
parameters but requiring an extra click of a form submission button.
Rent-A-Monkey Website Development
PGP Key: http://www.rentamonkey.com/pgpkey.asc