Class: Ishapi::LeadsetsController
Instance Method Summary
collapse
#exception, #home, #long_term_token, #vote
Instance Method Details
#destroy ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
|
# File 'app/controllers/ishapi/leadsets_controller.rb', line 8
def destroy
authorize! :leadsets_destroy, ::Ishapi
leadsets = Leadset.find( params[:leadset_ids] )
@results = []
leadsets.each do |leadset|
@results.push leadset.discard
end
flash[:notice] = "Discard outcome: #{@results.inspect}."
redirect_to action: 'index'
end
|
#index ⇒ Object
20
21
22
23
24
25
26
|
# File 'app/controllers/ishapi/leadsets_controller.rb', line 20
def index
authorize! :leadsets_index, ::Ishapi
out = Leadset.all
render json: {
items: out,
}
end
|