Sha256: c070c30dec1ac81da0ab8ee7289942abfbad159111302bc0a21ce5ad735cd5c2

Contents?: true

Size: 719 Bytes

Versions: 1

Compression:

Stored size: 719 Bytes

Contents

require_dependency "bagboy/application_controller"

module Bagboy
  class DataBagTemplateItemsController < ApplicationController

    def create
      bag       = @bag_helper.data_bag params[:bag]
      template  = Template::find_or_create_by({data_bag_name: bag.name})

      template.item( params[:data_bag_template_item][:name], params[:data_bag_template_item][:type] )

      redirect_to data_bag_template_path( bag.name )
    end

    def delete
      bag       = @bag_helper.data_bag params[:bag]
      template  = Template::find_or_create_by({data_bag_name: bag.name})

      template.delete_item( params[:data_bag_template_item][:name] )

      redirect_to data_bag_template_path( bag.name )
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bagboy-0.0.1 app/controllers/bagboy/data_bag_template_items_controller.rb