リビジョン 5d61bef8
| app/controllers/glossary_terms_controller.rb | ||
|---|---|---|
|
def create
|
||
|
term = GlossaryTerm.new(glossary_term_params)
|
||
|
if term.save
|
||
|
flash[:notice] = l(:notice_successful_create)
|
||
|
redirect_to term
|
||
|
redirect_to term, notice: l(:notice_successful_create)
|
||
|
end
|
||
|
end
|
||
|
|
||
| ... | ... | |
|
def update
|
||
|
@term.attributes = glossary_term_params
|
||
|
if @term.save
|
||
|
flash[:notice] = l(:notice_successful_update)
|
||
|
redirect_to @term
|
||
|
redirect_to @term, notice: l(:notice_successful_update)
|
||
|
end
|
||
|
rescue ActiveRecord::StaleObjectError
|
||
|
flash.now[:error] = l(:notice_locking_conflict)
|
||
[phase-5]refactored redirect and flash message to oneline