Link_to

<%= link_to “Home”, :controller => ‘home’, :action => ‘index’ %>

I need to format “Home” like make it bold, chage it color, put it in div
element…i tried putting that line in div tag but its not working…

How do I do that…

Thanks you
Raj

Did you look at the generated html? All that your code does is create an
tag. So, this should work:

<%= link_to “Home”, :controller => ‘home’, :action => ‘index’ %>

to boldface.

mike-311 wrote:

Raj


Posted via http://www.ruby-forum.com/.


View this message in context:
http://www.nabble.com/link_to-tf3664599.html#a10239434
Sent from the RubyOnRails Users mailing list archive at Nabble.com.

How do I change the color?

Steve R. wrote:

Did you look at the generated html? All that your code does is create an
tag. So, this should work:

<%= link_to “Home”, :controller => ‘home’, :action => ‘index’ %>

to boldface.

Thank you,

Can some body tell me how to change the color, the div properties are
not getting applied.

thats the trouble :frowning:

Mohit S. wrote:

Raj wrote:

link_to will only generate the link - the rest is up to you:

  1. stick formatting around it
  2. make it of a particular style

Assuming you understand HTML, you should be able to extrapolate from
this example:
<%= link_to “Visit Other Site”, “http://www.rubyonrails.org/” -%>

Raj wrote:

link_to will only generate the link - the rest is up to you:

  1. stick formatting around it
  2. make it of a particular style

Assuming you understand HTML, you should be able to extrapolate from
this example:
<%= link_to “Visit Other Site”, “http://www.rubyonrails.org/” -%>

Put this in your code and see what it generates. Hope that helps you
get started.

See:
http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#M000485
for how link_to works, or do a search for more detail about the RoR URL
Helpers.

Cheers
Mohit.

I got it :slight_smile:
Raj wrote:

Thank you,

Can some body tell me how to change the color, the div properties are
not getting applied.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs