我为消息系统创建了一个 Redmine 插件。除了消息,用户还可以附加文件。为此,我正在尝试使用现有的 AttachmentsHelper。
这是我的示例代码
在 index.html.erb 中
<% if not @members.blank? %>
<% form_for :note, @note, :url => {:action => 'create', :project_id => @project.id}, :html => {:multipart => true, :id => 'note-form'} do |f| %>
<%= f.hidden_field :p_id, :value => @project.id %>
<p><%= f.text_area :content, :cols => 40, :rows => 6, :class => 'wiki-edit', :id => 'message_content' %></p>
<p> <%= render :partial => 'attachments/form' %></p>
<%= submit_tag l(:button_create) %>
<% end %>
<% end %>
在我的控制器.rb
class CommunicationsController < ApplicationController
unloadable
include AttachmentsHelper
def create
#code for saving message
end
end
上面的代码不起作用,我也没有收到任何错误。我错过了什么?
谁能帮我解决这个问题?