<%= 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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:> > > <%= 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 > > -- > 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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
How do I change the color? Steve Ross 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. > >-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Raj wrote:> How do I change the color? > > Steve Ross 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. >> >>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: <b><%= link_to "Visit Other Site", "http://www.rubyonrails.org/" -%></b> 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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you, Can some body tell me how to change the color, the div properties are not getting applied. thats the trouble :( Mohit Sindhwani 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: > <b><%= link_to "Visit Other Site", "http://www.rubyonrails.org/" -%></b> > >-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I got it :) Raj wrote:> Thank you, > > Can some body tell me how to change the color, the div properties are > not getting applied. >-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hiya! I am really new to RoR, and I have a little tiny question: I have a database column called url. I have a simple bookmarking app and I would like a button called "open" that will take the user to the url stored in the database. Sounds simple, and the code I used was this: <%= link_to ''Open'', bookmark["url"] %> But I keep getting errors. Anybody know what I would have to do to get it to work? Help is greatly appreciated! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, First, you need a model for your table. Then, before the rhtml page loads you need to find the proper row in that table (you do that in your controller) and save it in a variable like @bookmark. Then your code will look something like <%= link_to ''Open'', @bookmark.url %> I strongly suggest you get a copy of "Agile Web Development with Rails 2nd Ed" and read through the entire tutorial chapters before you go much further. There are also numerous free tutorials you find by googling. Good luck! Terry On 5/9/07, noooooo10. <iainwall-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hiya! > > I am really new to RoR, and I have a little tiny question: > > I have a database column called url. I have a simple bookmarking app > and I would like a button called "open" that will take the user to the > url stored in the database. Sounds simple, and the code I used was > this: > > <%= link_to ''Open'', bookmark["url"] %> > > But I keep getting errors. Anybody know what I would have to do to get > it to work? > > Help is greatly appreciated! > > > > >-- Terry (TAD) Donaghe http://tadspot.tumblr.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks very much for you help. Interestingly, I ordered the book last night anyway! Look forward to using RoR, and thanks once again for your help! On 10 May, 04:10, "Terry Donaghe" <terry.dona...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > First, you need a model for your table. Then, before the rhtml page loads > you need to find the proper row in that table (you do that in your > controller) and save it in a variable like @bookmark. Then your code will > look something like > > <%= link_to ''Open'', @bookmark.url %> > > I strongly suggest you get a copy of "Agile Web Development with Rails 2nd > Ed" and read through the entire tutorial chapters before you go much > further. There are also numerous free tutorials you find by googling. > > Good luck! > > Terry > > On 5/9/07, noooooo10. <iainw...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Hiya! > > > I am really new to RoR, and I have a little tiny question: > > > I have a database column called url. I have a simple bookmarking app > > and I would like a button called "open" that will take the user to the > > url stored in the database. Sounds simple, and the code I used was > > this: > > > <%= link_to ''Open'', bookmark["url"] %> > > > But I keep getting errors. Anybody know what I would have to do to get > > it to work? > > > Help is greatly appreciated! > > -- > Terry (TAD) Donaghehttp://tadspot.tumblr.com--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---