Class: Buttafly::LegendsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/buttafly/legends_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



16
17
18
19
20
21
22
23
# File 'app/controllers/buttafly/legends_controller.rb', line 16

def create
  @legend = Buttafly::Legend.new(data: legend_params)
  if @legend.save
    redirect_to contents_path, notice: "legend created"
  else
    redirect_to :back, notice: "not good"
  end
end

#editObject



28
29
# File 'app/controllers/buttafly/legends_controller.rb', line 28

def edit
end

#indexObject



31
32
# File 'app/controllers/buttafly/legends_controller.rb', line 31

def index
end

#newObject



8
9
10
11
12
13
14
# File 'app/controllers/buttafly/legends_controller.rb', line 8

def new
  @mapping = Buttafly::Mapping.find(params[:mapping_id])
  @legend = @mapping.build_legend
  # binding.pry
  @headers = @mapping.get_origin_headers
  @new_record = @mapping.targetable_model.constantize.new
end

#showObject



25
26
# File 'app/controllers/buttafly/legends_controller.rb', line 25

def show
end