Class: Jail::CdnjsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/jail/cdnjs_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
# File 'app/controllers/jail/cdnjs_controller.rb', line 5

def index
  @cdnjs = Cdnjs.libs.map(&:name)
end

#installObject



13
14
15
16
17
18
# File 'app/controllers/jail/cdnjs_controller.rb', line 13

def install
  @cdnjs = Cdnjs.find(params[:name])
  @cdnjs.install(params["files"])

  redirect_to( "/jail/cdnjs/#{params[:name]}", :notice => "Installed!" )
end

#showObject



9
10
11
# File 'app/controllers/jail/cdnjs_controller.rb', line 9

def show
  @cdnjs = Cdnjs.find(params[:name])
end