プロジェクト

全般

プロフィール

« | » 

リビジョン be33f1f6

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

[phase-4]add delete operation

差分を表示:

app/controllers/glossary_terms_controller.rb
class GlossaryTermsController < ApplicationController
before_action :find_term_from_id, only: [:show, :edit, :update]
before_action :find_term_from_id, only: [:show, :edit, :update, :destroy]
def index
@glossary_terms = GlossaryTerm.all
......
rescue ActiveRecord::StaleObjectError
flash.now[:error] = l(:notice_locking_conflict)
end
def destroy
@term.destroy
redirect_to glossary_terms_path
end
# Find the term whose id is the :id parameter
def find_term_from_id

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