Pergunta

I am trying to create a link with two classes.

Code in my view looks like this:

<%= link_to "back", controller: "welcome", :class => "btn test" %>

And am expecting to have:

<a href="/welcome/index" class="btn primary">back</a>

But am getting:

<a href="/welcome/index?class=btn+test">back</a>

What is that am doing wrong?

Foi útil?

Solução

See documentation:

<%= link_to "back", { controller: "welcome" }, :class => "btn test" %>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top