Rails newbe here: Using link_to_unless_current and on my website it displays the the menu item and its entire path in () ... example: home (/) about (/welcome/about) register (/users/register) ... and so on. In my application_helper: # Methods added to this helper will be available to all templates in the application. module ApplicationHelper end def nav_link(text, controller, action = "index") link_to_unless_current text , {:controller => controller, :action => action} end in my views/layout/application.html.erb <table id="menu"> <tr> <td> <%= nav_link "Home", "welcome" %> </td> </tr> <tr> <td> <%= nav_link "About", "welcome", "about" %></td> </tr> <tr> <td> <%= nav_link "Profile", "welcome", "profile" %> </td> </tr> <tr> <td> <%= nav_link "Contact", "welcome", "contact" %> </td> </tr> </table> routes file has: # You can have the root of your site routed with map.root -- just remember to delete public/index.html. map.root :controller => "welcome" ... standard stuff ... right? so why the path in in the link? any help would be great. 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sat, Apr 3, 2010 at 3:51 PM, Don Kowalski <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Rails newbe here: > > Using link_to_unless_current and on my website it displays the the menu > item and its entire path in () ... > > example: > home (/) > about (/welcome/about) > register (/users/register) ... and so on. > > > In my application_helper: > > # Methods added to this helper will be available to all templates in the > application. > module ApplicationHelper > > end > > def nav_link(text, controller, action = "index") > link_to_unless_current text , {:controller => controller, :action => > action} > end > > > in my views/layout/application.html.erb > <table id="menu"> > <tr> <td> <%= nav_link "Home", "welcome" %> </td> </tr> > <tr> <td> <%= nav_link "About", "welcome", "about" %></td> > </tr> > <tr> <td> <%= nav_link "Profile", "welcome", "profile" %> > </td> </tr> > <tr> <td> <%= nav_link "Contact", "welcome", "contact" %> > </td> </tr> > </table> > > routes file has: > # You can have the root of your site routed with map.root -- just > remember to delete public/index.html. > map.root :controller => "welcome" ... standard stuff ... right? > > so why the path in in the link? > > any help would be great. thanks >Hi, couldn''t use the helper, link_to_unless_current, directly within the application layout? -Conrad> -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 3 April 2010 23:51, Don Kowalski <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Rails newbe here: > > Using link_to_unless_current and on my website it displays the the menu > item and its entire path in () ... > > example: > home (/) > about (/welcome/about) > register (/users/register) ... and so on.Are you sure you have not got some sort of debug or plugin enabled that is adding this? I seem to remember a similar issue a little time ago that turned out to be such an issue. Colin> > > In my application_helper: > > # Methods added to this helper will be available to all templates in the > application. > module ApplicationHelper > > end > > def nav_link(text, controller, action = "index") > link_to_unless_current text , {:controller => controller, :action => > action} > end > > > in my views/layout/application.html.erb > <table id="menu"> > <tr> <td> <%= nav_link "Home", "welcome" %> </td> </tr> > <tr> <td> <%= nav_link "About", "welcome", "about" %></td> > </tr> > <tr> <td> <%= nav_link "Profile", "welcome", "profile" %> > </td> </tr> > <tr> <td> <%= nav_link "Contact", "welcome", "contact" %> > </td> </tr> > </table> > > routes file has: > # You can have the root of your site routed with map.root -- just > remember to delete public/index.html. > map.root :controller => "welcome" ... standard stuff ... right? > > so why the path in in the link? > > any help would be great. 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Colin Law wrote:> On 3 April 2010 23:51, Don Kowalski <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> Rails newbe here: >> >> Using link_to_unless_current and on my website it displays the the menu >> item and its entire path in () ... >> >> example: >> home (/) >> about (/welcome/about) >> register (/users/register) ... and so on. > > Are you sure you have not got some sort of debug or plugin enabled > that is adding this? I seem to remember a similar issue a little time > ago that turned out to be such an issue. >Colin I''ve tried running in production mode ...also with different browsers to insure I wasn''t running some sort of debug mode Ive also looked through the IDE to see if there is some type of settings ... Im using netbeans 6.8 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sun, Apr 4, 2010 at 12:22 PM, Don Kowalski <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote: > > On 3 April 2010 23:51, Don Kowalski <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > >> Rails newbe here: > >> > >> Using link_to_unless_current and on my website it displays the the menu > >> item and its entire path in () ... > >> > >> example: > >> home (/) > >> about (/welcome/about) > >> register (/users/register) ... and so on. > > > > Are you sure you have not got some sort of debug or plugin enabled > > that is adding this? I seem to remember a similar issue a little time > > ago that turned out to be such an issue. > > > Colin > > I''ve tried running in production mode ...also with different browsers to > insure I wasn''t running some sort of debug mode Ive also looked through > the IDE to see if there is some type of settings ... Im using netbeans > 6.8 > >Can you tried things without an IDE? -Conrad> -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> Can you tried things without an IDE?one of the first things I tried I''m using the bluebprint css plugin which I''ve used before without issue. I''ve looked through the css''s and actually don''t find any reference to the <a href ......> tag. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Don Kowalski wrote:>> Can you tried things without an IDE? > > one of the first things I tried > > I''m using the bluebprint css plugin which I''ve used before without > issue. I''ve looked through the css''s and actually don''t find any > reference to the <a href ......> tag.I spoke to soon ... blueprint css has three style sheets printing, screen and windows explorer (because MS is special or something...) anyway... in the print css I found: *** a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;} *** I commented out the print css and Im golden now. Thanks for your help. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.