【发布时间】:2011-07-28 11:31:04
【问题描述】:
我正在尝试让 Paperclip 接受 mp3 文件。我能够让它在 Rails 2 应用程序中工作,但在 Rails 3 中遇到困难。我可以让文件显示在我的资产目录中,但我继续列出 missing.png 而不是适当的文件在表演动作中。
这是我的模型代码...
has_attached_file :讲道文件, :url => "/assets/:class/:id/:style/:basename.:extension", :path => ":rails_root/public/assets/:class/:style/:id/:basename.:extension" attr_accessor :sermonfile_file_name attr_accessor :sermonfile_content_type
attr_accessor :sermonfile_file_size
attr_accessor :sermonfile_updated_at
这是表单视图...
{:multipart => true} 做 |f| %>
禁止这个布道 从被保存:
<ul> <% @sermon.errors.full_messages.each do|消息| %>
"mceEditor" %>
这是我用来在显示视图中呈现文件的内容...
非常感谢任何帮助!
【问题讨论】:
-
你能正确格式化吗?特别是粗体部分