リビジョン ac1db68f
| 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
|
||
[phase-12]can be download attached file, new term with attachment