I am trying to get the link_to to be able to create a link with both options and html options. I need to be able to add the so I went with the method with the do.
My question is: How do I get this to work with the :confirmation. As it is written, it is appending confirm to the url. I would like to pass it in as a html option so it will pull up the dialog box.
Any ideas what I need to do to be able to get it to behave like that?
<li>
<%= link_to :controller => "services", :action => "delete_results", :build => @id, :suite => @cookie_value, :confirm => "Are you sure?" do %>
<i class="icon-trash"></i>
Delete Results
<% end %>
</li>
Thanks
url_options and html_options are separate attributes for link_to. You need to tell ruby that they are different parameters in your list
link_to({:controller => "services", :action => "delete_results", :build => @id, :suite => @cookie_value}, {:confirm => "Are you sure?"})Wrapping of second hash in {} is optional, but simplifies reading