Class: Bagboy::DataBagsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/bagboy/data_bags_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#initialize

Constructor Details

This class inherits a constructor from Bagboy::ApplicationController

Instance Method Details

#createObject



21
22
23
24
25
26
27
28
29
30
31
# File 'app/controllers/bagboy/data_bags_controller.rb', line 21

def create
  opts          = data_bag_params
  opts[:path]   = @bag_helper.data_bag_directory( opts[:name] )
  @bag          = Bagboy::Chef::DataBags::Bag.new( opts )

  if @bag.create
    redirect_to data_bags_path
  else
    render :new
  end
end

#indexObject



6
7
8
# File 'app/controllers/bagboy/data_bags_controller.rb', line 6

def index
  render :index
end

#newObject



16
17
18
19
# File 'app/controllers/bagboy/data_bags_controller.rb', line 16

def new
  @bag = Bagboy::Chef::DataBags::Bag.new
  render :new
end

#showObject



10
11
12
13
14
# File 'app/controllers/bagboy/data_bags_controller.rb', line 10

def show
  @bag    = @bag_helper.data_bag params[:bag]
  @items  = @bag.items
  render :show
end