Class: Helpdesk::Admin::SubscribersController
Instance Method Summary
collapse
#default_url_options, #ensure_user
Instance Method Details
#create ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'app/controllers/helpdesk/admin/subscribers_controller.rb', line 11
def create
@subscriber = Helpdesk::Subscriber.new(subscriber_params)
if @subscriber.save
redirect_to admin_subscribers_path, notice: t('subscribers.created')
else
render action: "index"
end
end
|
#destroy ⇒ Object
DELETE /subscribers/1 DELETE /subscribers/1.json
38
39
40
41
42
|
# File 'app/controllers/helpdesk/admin/subscribers_controller.rb', line 38
def destroy
@subscriber = Helpdesk::Subscriber.find_by_hashcode(params[:hashcode])
@subscriber.destroy
redirect_to root_path
end
|
#edit ⇒ Object
20
21
22
|
# File 'app/controllers/helpdesk/admin/subscribers_controller.rb', line 20
def edit
@subscriber = Helpdesk::Subscriber.find(params[:id])
end
|
#index ⇒ Object
3
4
5
|
# File 'app/controllers/helpdesk/admin/subscribers_controller.rb', line 3
def index
@subscribers = Helpdesk::Subscriber.page(params[:page])
end
|
#new ⇒ Object
7
8
9
|
# File 'app/controllers/helpdesk/admin/subscribers_controller.rb', line 7
def new
@subscriber = Helpdesk::Subscriber.new()
end
|
#update ⇒ Object
PUT /subscribers/1 PUT /subscribers/1.json
26
27
28
29
30
31
32
33
34
|
# File 'app/controllers/helpdesk/admin/subscribers_controller.rb', line 26
def update
@subscriber = Helpdesk::Subscriber.find(params[:id])
if @subscriber.update_attributes(subscriber_params)
redirect_to admin_subscribers_path, notice: 'Subscriber was successfully updated.'
else
render action: "edit"
end
end
|