プロジェクト

全般

プロフィール

« | » 

リビジョン ac1db68f

高徹 高橋 徹 さんが約6年前に追加

[phase-12]can be download attached file, new term with attachment

差分を表示:

app/controllers/glossary_terms_controller.rb
def create
term = GlossaryTerm.new(glossary_term_params)
term.project = @project
term.save_attachments params[:attachments]
if term.save
render_attachment_warning_if_needed term
redirect_to [@project, term], notice: l(:notice_successful_create)
end
end
......
def update
@term.attributes = glossary_term_params
@term.save_attachments(params[:attachments])
render_attachment_warning_if_needed(@term)
@term.save_attachments params[:attachments]
if @term.save
render_attachment_warning_if_needed @term
redirect_to [@project, @term], notice: l(:notice_successful_update)
end
rescue ActiveRecord::StaleObjectError

他の形式にエクスポート: Unified diff