On 5 May 2010 07:23, Rahul Mehta <[email protected]> wrote: > <%if File::exists?("../data/aritcal/#[email protected]}")%> > > <%= image_tag "../data/artical/#[email protected]}" %>
The typos probably won't help - you spell the directory "aritcal" in the check, and "artical" in the image tag. The method I've seen for checking files is "File.exists?..." not "File::exists?" (not sure if your way would work anyway) And as others have said, even if the file does exist, the image tag won't see it because it's not in the public path. But let's come back to the problem you're trying to solve: how are you attaching files to your content object? Maybe using a plugin like paperclip would save you a lot of the hassle. -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

