Much to my chagrin, it didn’t work. I did a lot of searching and
experimenting, and finally figured out that you have to make two
changes to get it to work. First, you have to use a string literal
for the url. Second, you can’t specify the :html hash key:
<% form_tag ‘/my_controller/my_action’, {:id => ‘my_id’} do %>
Two questions:
Does anyone know why the form_tag helper is inconsistent with both
the form_remote_tag helper and the more Rails-traditional way of
specifying urls (:controller, :action)?
Does anyone know if this behavior has been changed in 2.0?
Sorry, forgot to answer #2. There has been talk on the rails-core list
about making this, along with link_to and others follow the single hash
convention, but it has not been changed yet.
That results in a compile error. The only way that I can get it to
work is to use a string literal (or variable, I suppose…haven’t
tried that) for the url.