I want to add a class to the (:i) tag inside the Rails code:
<td><%= link_to content_tag(:i), item %></td>
I want the final code to look like:
<td><a href="/items/2"><i class="#"></i></a></td>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
@Dogbert is correct, except that you need to pass
nilas the second parameter, sincecontent_tagis defined asThe second parameter is only considered content if you pass block. To expand on it, any extra options passed in at that point will become HTML attributes, so the same form applies to things like IDs, data-*, etc.
will become