Knut
2007-Nov-26 12:19 UTC
Images and CSS are not used correctly; both are stored in public folder
Hi, maybe someone of you had the same error in the past and can help me. I use "InstantRails" for learning Ruby on Rails. I have done some tests, but always images which are stored under public/images/ rails.png didn''t work. Also direct access to the folder via http://localhost:3000/admin/images/rails.png didn''t work. Always a load error is displayed. Only when I insert hardlinks, like c:\path \rails.png the image is displayed correctly. What would be the right place to store such an image? Where should I store them on a local host? I have the same issue also with the CSS. They are also not loaded correctly (stored in CSS in public/stylesheet). The CSS is implemented in the source via <%= stylesheet_link_tag ''scaffold'', ''depot'' %> but not used complete. The CSS are stored under C:\ror\rails_apps\depot\public\stylesheets . Is this the right place? Normally it should be, or is their for each project an own folder? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Trent Black
2007-Nov-26 20:45 UTC
Re: Images and CSS are not used correctly; both are stored i
Knut wrote:> Hi, > maybe someone of you had the same error in the past and can help me. > I use "InstantRails" for learning Ruby on Rails. I have done some > tests, but always images which are stored under public/images/ > rails.png didn''t work. Also direct access to the folder via > http://localhost:3000/admin/images/rails.png didn''t work. Always a > load error is displayed. Only when I insert hardlinks, like c:\path > \rails.png the image is displayed correctly. > > What would be the right place to store such an image? Where should I > store them on a local host? > > I have the same issue also with the CSS. They are also not loaded > correctly (stored in CSS in public/stylesheet). The CSS is implemented > in the source via <%= stylesheet_link_tag ''scaffold'', ''depot'' %> but > not used complete. > The CSS are stored under C:\ror\rails_apps\depot\public\stylesheets . > Is this the right place? Normally it should be, or is their for each > project an own folder?hi, from my experience, on the localhost:3000, the stylesheet goes in the (rails_apps:) application''s public folder. the same with the images. make sure you are starting your SERVER from *checked* application from the menu MANAGE RAILS APPLICATIONS. when you place them on some of the unix hosting servers, it is a bit different, and a link is required from the mail public_html folder (like the www folder in instant rails.) -- 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 -~----------~----~----~----~------~----~------~--~---
nas
2007-Nov-27 12:29 UTC
Re: Images and CSS are not used correctly; both are stored in public folder
if your image is within your public/images/ directory then you dont have to anything like http://localhost:3000/admin/images/rails.png you can simply access it by http://localhost:3000/images/rails.png and similarly for stylesheet and javascript files like http://localhost:3000/stylesheets/style.css and http://localhost:3000/javascripts/controls.js You dont have to include public or controller name for anything in public directory, Yes public/stylesheets is the right place to store your CSS unless you dont want to follow the rails conventions Hope that helps. On Nov 26, 12:19 pm, Knut <knutli...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Hi, > maybe someone of you had the same error in the past and can help me. > I use "InstantRails" for learning Ruby on Rails. I have done some > tests, but always images which are stored under public/images/ > rails.png didn''t work. Also direct access to the folder viahttp://localhost:3000/admin/images/rails.pngdidn''t work. Always a > load error is displayed. Only when I insert hardlinks, like c:\path > \rails.png the image is displayed correctly. > > What would be the right place to store such an image? Where should I > store them on a local host? > > I have the same issue also with the CSS. They are also not loaded > correctly (stored in CSS in public/stylesheet). The CSS is implemented > in the source via <%= stylesheet_link_tag ''scaffold'', ''depot'' %> but > not used complete. > The CSS are stored under C:\ror\rails_apps\depot\public\stylesheets . > Is this the right place? Normally it should be, or is their for each > project an own folder?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---