Here is the code for generate button, but I want it in a hyper text, how to modify this?
<% form_remote_tag (:url => { :action => :choose_category, :id => category }) do %>
<%= submit_tag category.name %>
<% end %>
I tried to use the link_to, but it can’t submit a post method, what can I do?
If I understand correctly, you want replace the submit button in your posted code with a regular hyperlink (
<a>tag). Check out link_to_remote. To understand the javascript code that generates, you may also want to check out the docs for Prototype’s Ajax.Updater.