Class: Handcart::IpAddressesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Handcart::IpAddressesController
- Defined in:
- app/controllers/handcart/ip_addresses_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/handcart/ip_addresses_controller.rb', line 21 def create @ip_address = IpAddress.new(safe_params) if @ip_address.save redirect_to @ip_address, notice: 'IP Address was successfully created.' else render :new end end |
#destroy ⇒ Object
39 40 41 42 |
# File 'app/controllers/handcart/ip_addresses_controller.rb', line 39 def destroy @ip_address.destroy redirect_to ip_addresses_url, notice: 'IP Address was successfully removed.' end |
#edit ⇒ Object
18 19 |
# File 'app/controllers/handcart/ip_addresses_controller.rb', line 18 def edit end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/handcart/ip_addresses_controller.rb', line 7 def index @ip_addresses = IpAddress.ordered.page(params[:page]) end |
#new ⇒ Object
14 15 16 |
# File 'app/controllers/handcart/ip_addresses_controller.rb', line 14 def new @ip_address = IpAddress.new end |
#show ⇒ Object
11 12 |
# File 'app/controllers/handcart/ip_addresses_controller.rb', line 11 def show end |
#update ⇒ Object
31 32 33 34 35 36 37 |
# File 'app/controllers/handcart/ip_addresses_controller.rb', line 31 def update if @ip_address.update(safe_params) redirect_to @ip_address, notice: 'IP Address was successfully updated.' else render :edit end end |