Forum: Ruby on Rails Why is the path displayed instead of just the filename?

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.
Szymon N. (Guest)
on 2006-03-21 14:49
Hi!

I'm trying to create a link to the file uploaded by file_column. In my
'news' table i have 'attachment' column that stores filenames of
attachments.

But if i try to display the filename <%= @news.attachment %> i get
something like this:

../config/../public/news/attachment/7/filename.ext

In 'attachment' column i have only string 'filename.ext'.

Any ideas?
This topic is locked and can not be replied to.