Forum: Rails-ES atributo rel en helper link_to

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E082daed703e23ebbe7f04a500101eed?d=identicon&s=25 Fernando Seves (Guest)
on 2007-07-20 12:28
(Received via mailing list)
Buenas,

Alguien sabría decirme como implementar el atributo rel en un helper
link_to?

<li><%= link_to "Concerts", { :controller => "partners", :action =>
"external", :rel => "tab2" } %></li>

(esto no funciona)

muchas gracias y un saludo
E91518f050cb6081186ff461950099e0?d=identicon&s=25 Luis Villegas (Guest)
on 2007-07-20 13:46
(Received via mailing list)
Creo que era así:

<%=link_to "Concerts", {:controller => "partners", :action =>
"external"},
{:rel => "tab2"} %>

Si miras el método,

def link_to(name, options = {}, html_options = nil)

Se le manda el nombre que te va a salir entre las etiquetas <a>, un hash
con
la url que se va a crear y las opciones de html.

Ahí es donde puedes meter {:rel => "tab2", :class => "tu_clase", :style
=>
"tu_estilo"}, etc.
This topic is locked and can not be replied to.