Forum: Ruby on Rails "./blah/blah" vs. "/blah/blah"

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Surendra S. (Guest)
on 2006-03-13 22:04
(Received via mailing list)
Hello,
  Earlier in my rails application, I was using the convention of writing
the
following to refer to templates and/or views in the view folder.
"./blah/blah"

But in the Edge rail, it doesn't work and the page doesn't shows any
output
there is no error in the development log as well. But changing the above
to
"/blah/blah" seems to fix things.

Was I wrong in using the earlier convention or is something else amiss?

Thanks.

--

Surendra S.
http://ssinghi.kreeti.com, http://www.kreeti.com
Read my blog at: http://cuttingtheredtape.blogspot.com/
,----
| "All animals are equal, but some animals are more equal than others."
|     -- Orwell, Animal Farm, 1945
`----
Matthew I. (Guest)
on 2006-03-14 01:04
Surendra S. wrote:
> Hello,
>   Earlier in my rails application, I was using the convention of writing
> the
> following to refer to templates and/or views in the view folder.
> "./blah/blah"
>
> But in the Edge rail, it doesn't work and the page doesn't shows any
> output
> there is no error in the development log as well. But changing the above
> to
> "/blah/blah" seems to fix things.
>
> Was I wrong in using the earlier convention or is something else amiss?


I thought the convention was to leave out the beginning slash and just
write 'blah/blah'.

-matthew
Surendra S. (Guest)
on 2006-03-14 10:01
(Received via mailing list)
Matthew I. <removed_email_address@domain.invalid> writes:

>> to
>> "/blah/blah" seems to fix things.
>>
>> Was I wrong in using the earlier convention or is something else amiss?
>
> I thought the convention was to leave out the beginning slash and just
> write 'blah/blah'.
>
Nope, not when one is giving an absolute path, starting from the views
folder.

So, if your view is in a folder 'home' then Rails, will assume that
'blah/blah' points to home/blah/blah


--
Surendra S.
http://ssinghi.kreeti.com, http://www.kreeti.com

,----
| "All animals are equal, but some animals are more equal than others."
|     -- Orwell, Animal Farm, 1945
`----
Surendra S. (Guest)
on 2006-03-14 10:08
(Received via mailing list)
Matthew I. <removed_email_address@domain.invalid> writes:

>> to
>> "/blah/blah" seems to fix things.
>>
>> Was I wrong in using the earlier convention or is something else amiss?
>
> I thought the convention was to leave out the beginning slash and just
> write 'blah/blah'.
>
My bad, thanks for pointing this out.
--
Surendra S.
http://ssinghi.kreeti.com, http://www.kreeti.com
Read the latest news at: http://news.kreeti.com
,----
| "War is Peace! Freedom is Slavery! Ignorance is Strength!"
|     -- Orwell, 1984, 1948
`----
This topic is locked and can not be replied to.