1

I had the following line of code:

%li= link_to "Home", main_app.root_path

I now wish to include an ID for automation testing purposes to the minibar item but am unsure how to go about this, I have tried the following:

%li(id = "minibar_home")= link_to "Home", main_app.root_path

But the ID does not seem to be added when inspecting this through firebug or view source. Can you help?

4

2 に答える 2

2
%li{:id => "minibar_home"}= link_to "Home", main_app.root_path

Or

%li#minibar_home= link_to "Home", main_app.root_path
于 2012-05-31T10:11:39.973 に答える
1
%li#minibar_home= link_to "Home", main_app.root_path
于 2012-05-31T10:09:16.903 に答える