Class: Spree::Transit::ServiceCalendarsController
- Inherits:
-
BaseController
- Object
- Admin::ResourceController
- BaseController
- Spree::Transit::ServiceCalendarsController
show all
- Defined in:
- app/controllers/spree/transit/service_calendars_controller.rb
Instance Method Summary
collapse
#current_vendor, #edit_object_url, #page, #per_page, #required_vendor_user!, #vendors
Instance Method Details
#location_after_save ⇒ Object
25
26
27
|
# File 'app/controllers/spree/transit/service_calendars_controller.rb', line 25
def location_after_save
transit_vendor_service_calendars_url
end
|
#update_status ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'app/controllers/spree/transit/service_calendars_controller.rb', line 12
def update_status
if @object.update(active: !@object.active)
flash[:success] = flash_message_for(@object, :successfully_updated)
else
flash[:error] = @object.errors.full_messages.to_sentence
end
redirect_to transit_vendor_service_calendars_url
rescue ActiveRecord::RecordInvalid => e
flash[:error] = e.message
redirect_to transit_vendor_service_calendars_url
end
|