Class: ProxiesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/proxies_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



15
16
17
18
19
20
21
22
# File 'app/controllers/proxies_controller.rb', line 15

def create
  @proxy = Proxy.new(params[:proxy])
  if @proxy.save
    redirect_to(proxies_url, :notice => 'Proxy was successfully created.')
  else
    render :action => "new"
  end
end

#destroyObject



33
34
35
36
37
38
# File 'app/controllers/proxies_controller.rb', line 33

def destroy
  @proxy = Proxy.find(params[:id])
  @proxy.destroy

  redirect_to(proxies_url)
end

#editObject



11
12
13
# File 'app/controllers/proxies_controller.rb', line 11

def edit
  @proxy = Proxy.find(params[:id])
end

#indexObject



3
4
5
# File 'app/controllers/proxies_controller.rb', line 3

def index
  @proxies = Proxy.all
end

#newObject



7
8
9
# File 'app/controllers/proxies_controller.rb', line 7

def new
  @proxy = Proxy.new
end

#updateObject



24
25
26
27
28
29
30
31
# File 'app/controllers/proxies_controller.rb', line 24

def update
  @proxy = Proxy.find(params[:id])
  if @proxy.update_attributes(params[:proxy])
    redirect_to(proxies_url, :notice => 'Proxy was successfully updated.')
  else
    render :action => "edit"
  end
end