@news.save_attachments(params[:attachments] || (params[:news] && params[:news][:uploads]))
if @news.save
respond_to do |format|
- format.html {
+ format.html do
render_attachment_warning_if_needed(@news)
flash[:notice] = l(:notice_successful_create)
redirect_to project_news_index_path(@project)
- }
+ end
format.api { render_api_ok }
end
else
@news.save_attachments(params[:attachments] || (params[:news] && params[:news][:uploads]))
if @news.save
respond_to do |format|
- format.html {
+ format.html do
render_attachment_warning_if_needed(@news)
flash[:notice] = l(:notice_successful_update)
redirect_to news_path(@news)
- }
+ end
format.api { render_api_ok }
end
else
def destroy
@news.destroy
respond_to do |format|
- format.html {
+ format.html do
flash[:notice] = l(:notice_successful_delete)
redirect_to project_news_index_path(@project)
- }
+ end
format.api { render_api_ok }
end
end