I have the following code in one of my views <div id="right" <%= link_to_remote( "#{l.name}", :update => "right", :url =>{ :action => :show_stats, :ladder_id => l.id }) %><br> </div> I want to change the default color of the link from blue to white. I have tried using html_options like so <%= link_to_remote( "#{l.name}", :update => "right", :url =>{ :action => :show_stats, :ladder_id => l.id }, :html_options => {:color => "white"}) %><br> I have also tried wrapping the link_to in separate div tags and changing the color there, but none of this has worked. The links are still the default blue. I am running rails 2.2.2 -- 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 -~----------~----~----~----~------~----~------~--~---
It looks like you have a broken div. Try this: <div id="right"> <%= link_to_remote( "#{l.name}", :update => "right", :url => { :action => :show_stats, :ladder_id => l.id }) %> </div> Then style it in the css with: div#right a {color: #fff} Matt On Jan 12, 10:55 pm, Maulin pa <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I have the following code in one of my views > > <div id="right" > <%= link_to_remote( "#{l.name}", :update => "right", :url =>{ :action => > :show_stats, :ladder_id => l.id }) %><br> > </div> > > I want to change the default color of the link from blue to white. I > have tried using html_options like so > > <%= link_to_remote( "#{l.name}", :update => "right", :url =>{ :action > => :show_stats, :ladder_id => l.id }, :html_options => {:color => > "white"}) %><br> > > I have also tried wrapping the link_to in separate div tags and changing > the color there, but none of this has worked. The links are still the > default blue. > > I am running rails 2.2.2 > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Jan 13, 2009 at 5:55 AM, Maulin pa <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I have the following code in one of my views > > <div id="right" > <%= link_to_remote( "#{l.name}", :update => "right", :url =>{ :action => > :show_stats, :ladder_id => l.id }) %><br> > </div> > > I want to change the default color of the link from blue to white. I > have tried using html_options like so > > <%= link_to_remote( "#{l.name}", :update => "right", :url =>{ :action > => :show_stats, :ladder_id => l.id }, :html_options => {:color => > "white"}) %><br> > > I have also tried wrapping the link_to in separate div tags and changing > the color there, but none of this has worked. The links are still the > default blue. > > I am running rails 2.2.2 > -- > Posted via http://www.ruby-forum.com/. > > > >Try: <%= link_to_remote( "#{l.name}", :update => "right", :url =>{ :action => :show_stats, :ladder_id => l.id }, :html_options => {:style => "color:white"}) %> This applies a style attribute to the link and the CSS then handles the color You can''t wrap the call in divs because they won''t override a link''s color, that can only be done directly to the link. -- Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
@Matthew, The div tag is not broken, that was a typo on my part, sorry about that. Styling the div in the css does not work. @Andrew I tried your syntax and that does not seem to change the link color either. I tried putting the link_to_remote both inside and outside div tags...no go. Anybody else have any suggestions? -- 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 -~----------~----~----~----~------~----~------~--~---
On Wed, Jan 14, 2009 at 3:47 AM, Maulin pa <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > @Matthew, > The div tag is not broken, that was a typo on my part, sorry about that. > Styling the div in the css does not work. > > @Andrew > I tried your syntax and that does not seem to change the link color > either. I tried putting the link_to_remote both inside and outside div > tags...no go. > > Anybody else have any suggestions? > > -- > Posted via http://www.ruby-forum.com/. > > > >Sorry, another tired answer, try: <%= link_to_remote( "#{l.name}", {:update => "right", :url =>{ :action => :show_stats, :ladder_id => l.id }}, {:style => "color:white"} ) %> The method signagure for link_to_remote is: link_to_remote(name, options = {}, html_options = nil) so you need to include the display text, a hash of options for the remote link and then a second hash for the html specific options so it''s best to use explicit hashes so you know which is which link_to_remote( name, {}, {} ) -- Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> so you need to include the display text, a hash of options for the > remote > link and then a second hash for the html specific options so it''s best > to > use explicit hashes so you know which is which > link_to_remote( name, {}, {} )Andrew, that worked perfectly. Woohoo! Thanks :) -- 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 -~----------~----~----~----~------~----~------~--~---