Skip to content
Snippets Groups Projects
Commit 927457f6 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

fix

parent 71e5ac40
No related branches found
No related tags found
No related merge requests found
class Server::BlocksController < Server::ApplicationController
before_action :load_template, except: [:index]
def index
@templates = Communication::Block.template_kinds.keys
breadcrumb
end
def show
@template = params[:id]
@blocks = Communication::Block.send(@template)
breadcrumb
add_breadcrumb t("enums.communication.block.template_kind.#{@template}")
end
def resave
@template = params[:id]
@blocks = Communication::Block.send(@template)
@blocks.find_each &:save
redirect_to server_block_path(@template), notice: "#{@blocks.count} blocks saved"
end
protected
def load_template
@template = params[:id]
@blocks = Communication::Block.where(template_kind: @template)
end
def breadcrumb
super
add_breadcrumb Communication::Block.model_name.human(count: 2), server_blocks_path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment