Only show file templates which are available for the selected file type

This commit is contained in:
Maximilian Grundke
2016-06-10 17:48:04 +02:00
parent c10b07690a
commit 4d2676fea7
7 changed files with 42 additions and 1 deletions

View File

@ -6,6 +6,14 @@ class FileTemplatesController < ApplicationController
end
private :authorize!
def by_file_type
@file_templates = FileTemplate.where(:file_type_id => params[:file_type_id])
authorize!
respond_to do |format|
format.json { render :show, status: :ok, json: @file_templates.to_json }
end
end
# GET /file_templates
# GET /file_templates.json
def index