Class: Webhooker::SubscribersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Webhooker::SubscribersController
- Defined in:
- app/controllers/webhooker/subscribers_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /subscribers.
-
#destroy ⇒ Object
DELETE /subscribers/1.
-
#index ⇒ Object
GET /subscribers.
Instance Method Details
#create ⇒ Object
POST /subscribers
13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/webhooker/subscribers_controller.rb', line 13 def create @subscriber = Subscriber.new(subscriber_params) if @subscriber.save redirect_to subscribers_url, notice: 'Successed to create.' else redirect_to subscribers_url, alert: 'Failed to create.' end end |
#destroy ⇒ Object
DELETE /subscribers/1
24 25 26 27 |
# File 'app/controllers/webhooker/subscribers_controller.rb', line 24 def destroy @subscriber.destroy redirect_to subscribers_url, notice: 'Successed to destroy.' end |
#index ⇒ Object
GET /subscribers
8 9 10 |
# File 'app/controllers/webhooker/subscribers_controller.rb', line 8 def index @subscribers = Subscriber.page(params[:page]) end |