Class: Workarea::Admin::ReleasesController
Instance Method Summary
collapse
#storefront
#current_user, #find_sort, #wrap_in_view_model, wrap_in_view_model
Methods included from Publishing
#allow_publishing!, #allow_publishing?, #set_publishing_options
Methods included from Visiting
#most_visited
Instance Method Details
#calendar ⇒ Object
31
32
|
# File 'app/controllers/workarea/admin/releases_controller.rb', line 31
def calendar
end
|
#calendar_feed ⇒ Object
71
72
73
74
75
|
# File 'app/controllers/workarea/admin/releases_controller.rb', line 71
def calendar_feed
send_data ReleasesFeedViewModel.wrap(nil).to_ical,
filename: params[:filename],
type: 'text/calendar'
end
|
#create ⇒ Object
25
26
27
28
29
|
# File 'app/controllers/workarea/admin/releases_controller.rb', line 25
def create
@release.attributes = params[:release]
@release.save
render json: { release: @release.model }
end
|
#destroy ⇒ Object
63
64
65
66
67
68
69
|
# File 'app/controllers/workarea/admin/releases_controller.rb', line 63
def destroy
self.current_release = nil
@release.destroy
flash[:success] = t('workarea.admin.releases.flash_messages.removed')
redirect_to releases_path
end
|
#edit ⇒ Object
22
23
|
# File 'app/controllers/workarea/admin/releases_controller.rb', line 22
def edit
end
|
#index ⇒ Object
14
15
16
17
|
# File 'app/controllers/workarea/admin/releases_controller.rb', line 14
def index
search = Search::AdminReleases.new(params)
@search = Admin::ReleaseSearchViewModel.new(search, view_model_options)
end
|
#new ⇒ Object
34
35
|
# File 'app/controllers/workarea/admin/releases_controller.rb', line 34
def new
end
|
#publish ⇒ Object
47
48
49
50
51
52
53
|
# File 'app/controllers/workarea/admin/releases_controller.rb', line 47
def publish
self.current_release = nil
@release.publish!
flash[:success] = t('workarea.admin.releases.flash_messages.published')
redirect_to return_to || release_path(@release)
end
|
#show ⇒ Object
19
20
|
# File 'app/controllers/workarea/admin/releases_controller.rb', line 19
def show
end
|
#undo ⇒ Object
55
56
57
58
59
60
61
|
# File 'app/controllers/workarea/admin/releases_controller.rb', line 55
def undo
self.current_release = nil
@release.undo!
flash[:success] = t('workarea.admin.releases.flash_messages.reverted')
redirect_to return_to || release_path(@release)
end
|
#update ⇒ Object
37
38
39
40
41
42
43
44
45
|
# File 'app/controllers/workarea/admin/releases_controller.rb', line 37
def update
if @release.update_attributes(params[:release])
flash[:success] = t('workarea.admin.releases.flash_messages.saved')
redirect_to release_path(@release)
else
flash[:error] = t('workarea.admin.releases.flash_messages.saved_error')
render :edit
end
end
|