def create
@news = News.new(:project => @project, :author => User.current)
@news.attributes = params[:news]
+ @news.save_attachments(params[:attachments])
if @news.save
attachments = Attachment.attach_files(@news, params[:attachments])
render_attachment_warning_if_needed(@news)
end
def update
+ @news.save_attachments(params[:attachments])
if @news.update_attributes(params[:news])
attachments = Attachment.attach_files(@news, params[:attachments])
render_attachment_warning_if_needed(@news)
<p><%= f.text_field :title, :required => true, :size => 60 %></p>
<p><%= f.text_area :summary, :cols => 60, :rows => 2 %></p>
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 15, :class => 'wiki-edit' %></p>
-<p id="attachments_form"><%= label_tag('attachments[1][file]', l(:label_attachment_plural))%><%= render :partial => 'attachments/form' %></p>
+<p id="attachments_form"><%= label_tag('attachments[1][file]', l(:label_attachment_plural))%><%= render :partial => 'attachments/form', :locals => {:container => @news} %></p>
</div>
<%= wikitoolbar_for 'news_description' %>