hi all, On my page i am displaying business url entered by user it stored in database (code is in haml) = link_to @user.website,@user.website if url stored in database is "www.abc.com" then on click of that link it goes to http://sarasaves/at/www.abc.com and shows Routing Error No route matches "/at/www.moblie.com" with {:method=>:get} I want user to go to only "http://abc.com" -- Posted via http://www.ruby-forum.com/.
You may try link_to "www.abc.com", "http://www.abc.com".
Tim Teng wrote:> You may try link_to "www.abc.com", "http://www.abc.com".but, i am taking different values of business_url from database depending on user -- Posted via http://www.ruby-forum.com/.
On Tue, Aug 25, 2009 at 11:52 PM, Nik Cool<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> On my page i am displaying business url entered by user it stored in > database > (code is in haml) > > = link_to @user.website,@user.website > > if url stored in database is "www.abc.com"> I want user to go to only "http://abc.com"Those don''t match -- do you want the URL to be ''http://www.abc.com'' or do you want to strip the ''www'' out? If you just want the ''http://'' added, - link_to @user.website, "http://#{@user.website}" should work. And just for clarity -- "www.abc.com" is a hostname, not a URL, which requires a protocol (http, https, ftp, etc.). You might want to (re)consider which is most appropriate to store for your app''s current and future use. FWIW, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan
> > You might want to (re)consider which is most appropriate to store for > your app''s current and future use. > > FWIW, > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassanit''s working Thnaks....... -- Posted via http://www.ruby-forum.com/.