Hi, Before I migrated over to the link_to tag, I had the following: <a href="myreports.html"><font color="#8C9BC9">view all reports</ font></a> I tried to do this: <font color="#8C9BC9"><%= link_to ''my reports'', :action => ''my_reports'', :id => session[:user_id]%> which doesn''t work, unfortunately. I already have CSS governing how links are display and I only wanted to change this particular one. Is there an easy way to accomplish this? Thanks, Scott --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ball, Donald A Jr \(Library\)
2007-Apr-12 22:28 UTC
Re: Changing the font around a link_to
> Before I migrated over to the link_to tag, I had the following: > > <a href="myreports.html"><font color="#8C9BC9">view all reports</ > font></a> > > I tried to do this: > > <font color="#8C9BC9"><%= link_to ''my reports'', :action => > ''my_reports'', :id => session[:user_id]%> > > which doesn''t work, unfortunately. > > I already have CSS governing how links are display and I only > wanted to change this particular one. Is there an easy way to > accomplish this?inline css would do ya: <%= link_to ''my reports'', {:action=>''my_reports'', :id=>session[:user_id]}, {:style=>''text=#8c9bc9''} %> note you''re encoding an id parameter in your URL that''s already present in the user''s session. That would seem to be redundant and possibly a security problem if you don''t check in the controller that the id in the URL matches the authenticated user''s id. - donald --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
or better than that, <%= link_to ''link here", :action =>''whateverrrr'', :id =>session[:user_id], :class=>''whateverrr-link'' %> now in your css(at the top) you might have a generic class for all anchors like a { text-decoration: none; color: black; } but you can also later in your css document you can also go a.whateverrr-link{ color: #ccc; } and this will only over ride the color of that anchor, the nice thing is that if you need to add more styles later you can just add them to that class in the css or if you need to add another link with the same style you can just give it the same class name. Cam On Apr 13, 8:28 am, "Ball, Donald A Jr \(Library\)" <donald.b...-GjtI+QwuxAR68HQyEA6aog@public.gmane.org> wrote:> > Before I migrated over to the link_to tag, I had the following: > > > <a href="myreports.html"><font color="#8C9BC9">view all reports</ > > font></a> > > > I tried to do this: > > > <font color="#8C9BC9"><%= link_to ''my reports'', :action => > > ''my_reports'', :id => session[:user_id]%> > > > which doesn''t work, unfortunately. > > > I already have CSS governing how links are display and I only > > wanted to change this particular one. Is there an easy way to > > accomplish this? > > inline css would do ya: > > <%= link_to ''my reports'', {:action=>''my_reports'', > :id=>session[:user_id]}, {:style=>''text=#8c9bc9''} %> > > note you''re encoding an id parameter in your URL that''s already present > in the user''s session. That would seem to be redundant and possibly a > security problem if you don''t check in the controller that the id in the > URL matches the authenticated user''s id. > > - donald--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Sorry but that didn''t work. Thanks for pointing out the id passing that didn''t need to be. Cheers, Scott On Apr 12, 3:28 pm, "Ball, Donald A Jr \(Library\)" <donald.b...-GjtI+QwuxAR68HQyEA6aog@public.gmane.org> wrote:> > Before I migrated over to the link_to tag, I had the following: > > > <a href="myreports.html"><font color="#8C9BC9">view all reports</ > > font></a> > > > I tried to do this: > > > <font color="#8C9BC9"><%= link_to ''my reports'', :action => > > ''my_reports'', :id => session[:user_id]%> > > > which doesn''t work, unfortunately. > > > I already have CSS governing how links are display and I only > > wanted to change this particular one. Is there an easy way to > > accomplish this? > > inline css would do ya: > > <%= link_to ''my reports'', {:action=>''my_reports'', > :id=>session[:user_id]}, {:style=>''text=#8c9bc9''} %> > > note you''re encoding an id parameter in your URL that''s already present > in the user''s session. That would seem to be redundant and possibly a > security problem if you don''t check in the controller that the id in the > URL matches the authenticated user''s id. > > - donald--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nope, that didn''t work, either. I added in just as you did to the end of my css file and altered the class and it didn''t help. Any ideas? Thanks, Scott On Apr 12, 4:10 pm, "cammo" <mvpaustra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> or better than that, > > <%= link_to ''link here", :action =>''whateverrrr'', :id > =>session[:user_id], :class=>''whateverrr-link'' %> > > now in your css(at the top) you might have a generic class for all > anchors like > > a { text-decoration: none; color: black; } > > but you can also later in your css document you can also go > > a.whateverrr-link{ color: #ccc; } > > and this will only over ride the color of that anchor, the nice thing > is that if you need to add more styles later you can just add them to > that class in the css or if you need to add another link with the > same style you can just give it the same class name. > > Cam > > On Apr 13, 8:28 am, "Ball, Donald A Jr \(Library\)" > > <donald.b...-GjtI+QwuxAR68HQyEA6aog@public.gmane.org> wrote: > > > Before I migrated over to the link_to tag, I had the following: > > > > <a href="myreports.html"><font color="#8C9BC9">view all reports</ > > > font></a> > > > > I tried to do this: > > > > <font color="#8C9BC9"><%= link_to ''my reports'', :action => > > > ''my_reports'', :id => session[:user_id]%> > > > > which doesn''t work, unfortunately. > > > > I already have CSS governing how links are display and I only > > > wanted to change this particular one. Is there an easy way to > > > accomplish this? > > > inline css would do ya: > > > <%= link_to ''my reports'', {:action=>''my_reports'', > > :id=>session[:user_id]}, {:style=>''text=#8c9bc9''} %> > > > note you''re encoding an id parameter in your URL that''s already present > > in the user''s session. That would seem to be redundant and possibly a > > security problem if you don''t check in the controller that the id in the > > URL matches the authenticated user''s id. > > > - donald--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Turned out there was some other CSS overriding an inner div that was causing the problem. Thanks to all of you for pointing me in the right direction. On Apr 13, 5:36 pm, "Scott" <tamosu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Nope, that didn''t work, either. I added in just as you did to the end > of my css file and altered the class and it didn''t help. > > Any ideas? > > Thanks, > > Scott > > On Apr 12, 4:10 pm, "cammo" <mvpaustra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > or better than that, > > > <%= link_to ''link here", :action =>''whateverrrr'', :id > > =>session[:user_id], :class=>''whateverrr-link'' %> > > > now in your css(at the top) you might have a generic class for all > > anchors like > > > a { text-decoration: none; color: black; } > > > but you can also later in your css document you can also go > > > a.whateverrr-link{ color: #ccc; } > > > and this will only over ride the color of that anchor, the nice thing > > is that if you need to add more styles later you can just add them to > > that class in the css or if you need to add another link with the > > same style you can just give it the same class name. > > > Cam > > > On Apr 13, 8:28 am, "Ball, Donald A Jr \(Library\)" > > > <donald.b...-GjtI+QwuxAR68HQyEA6aog@public.gmane.org> wrote: > > > > Before I migrated over to the link_to tag, I had the following: > > > > > <a href="myreports.html"><font color="#8C9BC9">view all reports</ > > > > font></a> > > > > > I tried to do this: > > > > > <font color="#8C9BC9"><%= link_to ''my reports'', :action => > > > > ''my_reports'', :id => session[:user_id]%> > > > > > which doesn''t work, unfortunately. > > > > > I already have CSS governing how links are display and I only > > > > wanted to change this particular one. Is there an easy way to > > > > accomplish this? > > > > inline css would do ya: > > > > <%= link_to ''my reports'', {:action=>''my_reports'', > > > :id=>session[:user_id]}, {:style=>''text=#8c9bc9''} %> > > > > note you''re encoding an id parameter in your URL that''s already present > > > in the user''s session. That would seem to be redundant and possibly a > > > security problem if you don''t check in the controller that the id in the > > > URL matches the authenticated user''s id. > > > > - donald--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---