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 "abc.com"
> I want user to go to only "abc.com"
Those don''t match -- do you want the URL to be
''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 -- "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