Search code examples
cssruby-on-railslink-to

rails view link_to


Thanks for your time!

I had a code :

<link href="/stylesheets/show.css" media="screen" rel="stylesheet" type="text/css">

<div id="body-container">
        <div id="left-column">
                <ul id="report-list">
                        <% for report in @reports %>
                            <li><%= link_to( report, {:controller => 'loadreport',
                                                      :action => 'get_report_content',
                                                      :test_name => report} )%></li>
                        <% end %>
                </ul>
        </div>
        <div id="right-column">

    </div>
</div>

The link_to method will generate html tags like this :

<a href="/loadreport/get_report_content?name=Test1">Test1</a>

I want to make some decoration on tag a. So in CSS file, I got this codes :

a:link { text-decoration: none;}

a:hover {text-decoration-color: #adff2f;}

It failed to add these decorations to tag a. I think it because tag a is generated by rails link_to method. We don't have tag a ahead of time. Am I right? Then how can I achieve this?


Solution

  • Can you try this:

    a { text-decoration: none; }
    a:hover { color: #adff2f; }