From alex.m.weisberger at gmail.com Tue Dec 18 20:37:56 2012 From: alex.m.weisberger at gmail.com (Alex Weisberger) Date: Tue, 18 Dec 2012 15:37:56 -0500 Subject: New to camping-list, and a problem mounting files to a server Message-ID: Hi to everybody, My name is Alex and I'm new to the Camping mailing list, as well as Camping itself. I have to say, I think this is an awesome project and it is exactly what I'm looking for right now. Something fun to experiment with. Getting a server up and running was very easy, but of course I've hit a road block: Any file that I'm referring to in the layout does not mount on the server. For example, I have a very simple app to illustrate this, which has one controller that simply renders a function named pageFunc: def pageFunc img :src => 'labelnegate.jpg' end labelnegate.jpg is in the same directory as the app, but the image does not show. The terminal that I launched the camping server in shows: 127.0.0.1 - - [18/Dec/2012 16:19:19] "GET /labelnegate.jpg HTTP/1.1" 404 60 0.0146 which is obviously showing a 404 error. Strange indeed. Now I'm not looking for a flat out answer to this problem per se, I'd actually prefer someone to just give me a nudge in the right direction. I've been browsing the camping-unabridged.rb source, but I can't seem to find where or how local files are mounted to the server. Or is that actually Rack's responsibility? Also, I didn't include the full source of the app because I don't know if you guys have code formatting guidelines, so I thought one small function would be acceptable in this case. If you could tell me what (if any) formatting guidelines you have, I will surely respect those in the future. I appreciate any replies. Thanks a lot, -Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From matma.rex at gmail.com Tue Dec 18 20:53:33 2012 From: matma.rex at gmail.com (Matma Rex) Date: Tue, 18 Dec 2012 21:53:33 +0100 Subject: New to camping-list, and a problem mounting files to a server In-Reply-To: References: Message-ID: They aren't as far as I know. I usually use something like this to mount an entire directory: Camping.goes :App module App use Rack::Static, :urls => ['/static'] end This will make e.g. static/foo.png available at /static/foo.png on your server. -- Matma Rex From alex.m.weisberger at gmail.com Tue Dec 18 21:18:13 2012 From: alex.m.weisberger at gmail.com (Alex Weisberger) Date: Tue, 18 Dec 2012 16:18:13 -0500 Subject: New to camping-list, and a problem mounting files to a server In-Reply-To: References: Message-ID: That's perfect! Thanks a lot for the quick reply. It worked for me. -Alex On Tue, Dec 18, 2012 at 3:53 PM, Matma Rex wrote: > They aren't as far as I know. I usually use something like this to mount > an entire directory: > > > Camping.goes :App > module App > use Rack::Static, :urls => ['/static'] > end > > This will make e.g. static/foo.png available at /static/foo.png on your > server. > > -- > Matma Rex > ______________________________**_________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/**listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: