Tuesday, November 27, 2007

Uploading audio file and playing it on a web page using attachment_fu Ruby on Rails plugin

Basically used the information from "File Upload Fu" and "Demonstration of Different Ways to Play a Sound from a Web Page".

Uploaded audio file and stored it in file system just like image file using attachment_fu. Then in show.rhtml,
instead of:

<%= link_to @vocabulary.public_filename %>


<embed src="<%=@vocabulary.public_filename %>" autostart="false" loop="false" height="20" width="200"></embed>

Of course, if there is a better way, I would like to know.

No comments: