リビジョン 7ebd27c7
| app/controllers/glossary_terms_controller.rb | ||
|---|---|---|
|
class GlossaryTermsController < ApplicationController
|
||
|
|
||
|
before_action :find_term_from_id, only: [:show, :edit, :update, :destroy]
|
||
|
before_action :find_project_from_id, :authorize
|
||
|
before_action :find_project_by_project_id, :authorize
|
||
|
|
||
|
def index
|
||
|
@glossary_terms = GlossaryTerm.where(project_id: @project.id)
|
||
| ... | ... | |
|
render_404
|
||
|
end
|
||
|
|
||
|
# Find the project whose id is the :project_id parameter
|
||
|
def find_project_from_id
|
||
|
@project = Project.find(params[:project_id])
|
||
|
rescue ActiveRecord::RecordNotFound
|
||
|
render_404
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def glossary_term_params
|
||
[refactoring]changed calling method to find project to use redmine's standard method.