Class: BrickLayer::DataSetsController
Instance Method Summary
collapse
#authenticate, #current_administrator
Instance Method Details
#create ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'app/controllers/brick_layer/data_sets_controller.rb', line 24
def create
@data_set = @model_constant.new(params[:data_set])
if @data_set.save
respond_to do |format|
format.html { redirect_to data_set_path(params[:model], :id => @data_set.id), notice: "#{@modal_constant.class.to_s.titlecase} was successfully created." }
format.json { render json: @data_set, status: :created, location: @data_set }
end
else
respond_to do |format|
format.html { render action: "new" }
format.json { render json: @data_set.errors, status: :unprocessable_entity }
end
end
end
|
#destroy ⇒ Object
55
56
57
58
59
60
61
62
|
# File 'app/controllers/brick_layer/data_sets_controller.rb', line 55
def destroy
@data_set.destroy
respond_to do |format|
format.html { redirect_to data_sets_path(params[:model]) }
format.json { head :ok }
end
end
|
#edit ⇒ Object
21
22
|
# File 'app/controllers/brick_layer/data_sets_controller.rb', line 21
def edit
end
|
#index ⇒ Object
9
10
11
|
# File 'app/controllers/brick_layer/data_sets_controller.rb', line 9
def index
respond_with(@data_sets)
end
|
#new ⇒ Object
13
14
15
|
# File 'app/controllers/brick_layer/data_sets_controller.rb', line 13
def new
@data_set = @model_constant.new
end
|
#search ⇒ Object
65
66
67
68
69
70
71
72
|
# File 'app/controllers/brick_layer/data_sets_controller.rb', line 65
def search
@data_sets = BrickLayer::Search.perform_search(params)
respond_to do |format|
format.html
format.json { render json: @data_sets }
end
end
|
#show ⇒ Object
17
18
19
|
# File 'app/controllers/brick_layer/data_sets_controller.rb', line 17
def show
respond_with(@data_set)
end
|
#update ⇒ Object
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'app/controllers/brick_layer/data_sets_controller.rb', line 40
def update
if @data_set.update_attributes(params[:data_set])
respond_to do |format|
format.html { redirect_to data_set_path(:model => params[:model], :id => @data_set.id), notice: '#{@modal_constant.class.name} was successfully updated.' }
format.json { head :ok }
end
else
respond_to do |format|
format.html { render action: "edit" }
format.json { render json: @data_set.errors, status: :unprocessable_entity }
end
end
end
|