mirror of https://github.com/docusealco/docuseal
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							24 lines
						
					
					
						
							635 B
						
					
					
				
			
		
		
	
	
							24 lines
						
					
					
						
							635 B
						
					
					
				# frozen_string_literal: true
 | 
						|
 | 
						|
class TemplatesFoldersController < ApplicationController
 | 
						|
  load_and_authorize_resource :template
 | 
						|
 | 
						|
  def edit; end
 | 
						|
 | 
						|
  def update
 | 
						|
    @template.folder = TemplateFolders.find_or_create_by_name(current_user, params[:name])
 | 
						|
 | 
						|
    if @template.save
 | 
						|
      redirect_back(fallback_location: template_path(@template), notice: I18n.t('document_template_has_been_moved'))
 | 
						|
    else
 | 
						|
      redirect_back(fallback_location: template_path(@template), notice: I18n.t('unable_to_move_template_into_folder'))
 | 
						|
    end
 | 
						|
  end
 | 
						|
 | 
						|
  private
 | 
						|
 | 
						|
  def template_folder_params
 | 
						|
    params.require(:template_folder).permit(:name)
 | 
						|
  end
 | 
						|
end
 |