Class: CurrenciesController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /currencies



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

def create
  @currency = Currency.new(currency_params)

  if @currency.save
    redirect_to @currency, notice: 'Currency was successfully created.'
  else
    render :new
  end
end

#destroyObject

DELETE /currencies/1



43
44
45
46
# File 'app/controllers/currencies_controller.rb', line 43

def destroy
  @currency.destroy
  redirect_to currencies_url, notice: 'Currency was successfully destroyed.'
end

#editObject

GET /currencies/1/edit



19
20
# File 'app/controllers/currencies_controller.rb', line 19

def edit
end

#indexObject

GET /currencies



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

def index
  @currencies = Currency.all
end

#newObject

GET /currencies/new



14
15
16
# File 'app/controllers/currencies_controller.rb', line 14

def new
  @currency = Currency.new
end

#showObject

GET /currencies/1



10
11
# File 'app/controllers/currencies_controller.rb', line 10

def show
end

#updateObject

PATCH/PUT /currencies/1



34
35
36
37
38
39
40
# File 'app/controllers/currencies_controller.rb', line 34

def update
  if @currency.update(currency_params)
    redirect_to @currency, notice: 'Currency was successfully updated.'
  else
    render :edit
  end
end