redmine_glossary/app/controllers/glossary_terms_controller.rb

20 lines
365 B
Ruby
Raw Normal View History

class GlossaryTermsController < ApplicationController
2018-05-04 02:40:20 +02:00
before_action :find_term_from_id, only: [:show]
def index
2018-05-01 17:42:01 +02:00
@glossary_terms = GlossaryTerm.all
end
2018-05-04 02:40:20 +02:00
# def show
# end
# Find the term whose id is the :id parameter
def find_term_from_id
@term = GlossaryTerm.find(params[:id])
2018-05-04 03:08:14 +02:00
rescue ActiveRecord::RecordNotFound
render_404
2018-05-04 02:40:20 +02:00
end
end