Rails AutoGenerating Tag IDs
Our QA team uses watir to test our web app. They are requiring that every HTML tag have some kind of id for them to hook on to.
Consider this simple example:
<%= link_to "New Group", new_group_path %>
which generates
<a href="https://localhost/groups/new">New Group</a>
Is there a way for rails to simply to just generate an id for this tag?
In other words, I want the generated HTML to be
<a id="new_group_link" href="https://groups/new">New Group</a>
开发者_运维技巧
without having to manually provide :id => "new_workgroup_link"
as one of the html_options
to the link_to
method.
精彩评论