I am a rails beginner and I am having trouble displaying external urls on view. This is what i have in DB for ex: www.rubyonrails.com, if i try to construct the url on the page using link_to the url formed is - http://localhost:3000/www.rubyonrails.com. Can someone help me in fixing this issue. Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
<%= link_to @from_DB.name_url, "http://www.rubyonrails.com", {:target => "_blank" } %> is it your solution? Rgd, Reinhart http://teapoci.blogspot.com -- 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 tried that, but still doesn''t work , the url formed is http://localhost:3000/www.rubyonrails.com This is what i have in the view <% @url_list.each do |u| %> <%= link_to u.url, "www.rubyonrails.com", {:target=>''_blank''} %> <% end %> On Apr 19, 2:05 am, Visit Indonesia 2008 <rails-mailing-l...@andreas- s.net> wrote:> <%= link_to @from_DB.name_url, "http://www.rubyonrails.com", {:target => > "_blank" } %> > > is it your solution? > > Rgd, > > Reinharthttp://teapoci.blogspot.com > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
What do you want your url like ?> http://localhost:3000/www.rubyonrails.comIF YES, flow to here : {RAILS_ROOT}/config/route.rb Add it : map.web_url '':url_name'', :controller => ''my_controller'', :action => ''my_action'' in your view : <% @url_list.each do |u| %> <%= link_to u.url, :action=>''my_action'', :url_name => u.url %> <% end %> It will make your url in address bar to be http://localhost:3000/www.rubyonrails.com BUT THE SCRIPT BELOW, for accessing external url with new windows.> <% @url_list.each do |u| %> > <%= link_to u.url, u.url, {:target=>''_blank''} %> > <% end %>Reinhart http://teapoci.blogspot.com -- 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 -~----------~----~----~----~------~----~------~--~---
Hi there, Try putting the http:// before the URL MD On Apr 19, 11:27 am, Railsnewbie <rrajes...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I tried that, but still doesn''t work , the url formed ishttp://localhost:3000/www.rubyonrails.com > This is what i have in the view > > <% @url_list.each do |u| %> > <%= link_to u.url, "www.rubyonrails.com", {:target=>''_blank''} %> > <% end %> > > On Apr 19, 2:05 am, Visit Indonesia 2008 <rails-mailing-l...@andreas- > > s.net> wrote: > > <%= link_to @from_DB.name_url, "http://www.rubyonrails.com", {:target => > > "_blank" } %> > > > is it your solution? > > > Rgd, > > > Reinharthttp://teapoci.blogspot.com > > -- > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---