RailsGrunt

a noob working the ruby railroad.

uploading files to your rails application

February 23rd, 2007

For this task, the grunt is currently using acts_as_attachment. Information about the plugin can be found here . Follow the directions carefully and you can easily add file upload option to your rails application. Al the files are stored in the public folder in its own id directory. Also whats cool about it is that acts_as_attachment also creates thumbnails of each photo you upload. So in your view you can have something like this…assume that artices has one articlephoto

<% for articles in @toparticles%>

<= article.title>%>

<%if article.articlephoto != nil %>

<= image_tag article.articlephoto.thumbnails0.public_filename>

<% end %>

easy aint it?

Sorry, comments are closed for this article.