[Rails] Rails 3: link_to with "data-confirm"
Hi,
has anyone experienced any problems with the new link_to and
data-confirm in Rails3? It seems when you create a link with instead of
link text, an image, the confirm message isn't shown.
<%=
link_to(
image_tag("delete.png", :alt =>
t("helpers.label.destroy")),
admin_category_path(:id => record, :format =>
:js),
"data-method" => "delete",
"data-confirm" => "#{t("categories.delete")}",
:remote => true
)
%>
The above example deletes the record without asking confirmation first.
<%= link_to("Delete", admin_category_path(:id => record, :format =>
:js), "data-method" => "delete", "data-confirm" =>
"#{t("categories.delete")}", :remote => true) %>
The above example here, where the only difference is instead of an
image, you have a text link, the confirmation message is show.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home