Windows --> Linux = KaBoom :-|

Hello guys,

We developed in windows and deployed on Linux server. Most of our partials started behaving indecently. Our coding <%= render :partial => './shared/footer' %> Deployment works with <%= render :partial => '/shared/footer' %>

We have images in folders public/images/flags and public/images/ twitter which we used to access image_tag("./twitter/twitter.png" Now in deployment image_tag("./twitter/twitter.png" of course does not work but also image_tag("/twitter/twitter.png" doesnt work.

Does any one know about this?

Quoting Ritvvij <ritvij.j@gmail.com>:

Hello guys,

We developed in windows and deployed on Linux server. Most of our partials started behaving indecently. Our coding <%= render :partial => './shared/footer' %> Deployment works with <%= render :partial => '/shared/footer' %>

How about <%= render :partial => 'shared/footer' %>

Jeffrey

If the images are in public/images/twitter them image_tag("twitter/twitter.png") should work. If not have a look at the html source in the browser and see where it is pointing.

Colin

ain’t the problem the . you’re using in the path? In Linux the . points to the root directory of he user, and not nescecarly to the root of the tree you’re in.

I could be mistaken though.

Uh, well, since you mentioned it, yes, you are :slight_smile:

In any case, it's trivial to test what the image_tag does with these various references:

<code> <%= image_tag("images/rails.png") %>

<%= image_tag("/images/rails.png") %>

<%= image_tag("./images/rails.png") %> </code>

<source view> <img alt="Rails" src="/images/images/rails.png">

<img alt="Rails" src="/images/rails.png?1250195549">

<img alt="Rails" src="/images/./images/rails.png"> </source view>

I know which one I'll pick :slight_smile:

Quoting Hassan Schroeder <hassan.schroeder@gmail.com>:

> In Linux the . points to the root directory of he user, and not nescecarly > to the root of the tree you're in. > > I could be mistaken though.

Uh, well, since you mentioned it, yes, you are :slight_smile:

In any case, it's trivial to test what the image_tag does with these various references:

<code> <%= image_tag("images/rails.png") %>

<%= image_tag("/images/rails.png") %>

<%= image_tag("./images/rails.png") %> </code>

<source view> <img alt="Rails" src="/images/images/rails.png">

<img alt="Rails" src="/images/rails.png?1250195549">

<img alt="Rails" src="/images/./images/rails.png"> </source view>

I know which one I'll pick :slight_smile:

  <%= image_tag('rails.png')

:wink: Jeffrey

True, that works with resources in RAILS_ROOT/public/images, but it's important to understand how the image_tag references paths, to e.g. an alternate location like RAILS_ROOT/public/photos.

Which would be problematic with the OP's confusion... :slight_smile:

worked. THANKS A LOT :slight_smile: