Class: Virgo::Admin::SlideshowsController
Instance Method Summary
collapse
#authorize_admin_user, #search, #set_is_admin_view
#render_content, #with_format
#action?, #admin?, #admin_access?, #admin_view?, #alerts, #base_errors, #category_timestamp, #column_timestamp, #compact_html, #controller?, #decode_html_entities, #expanded_post_url, #is_admin_view?, #page_url, #post_time_format, #post_timestamp, #production?, #redis_timestamp_key_for, #site, #site_key, #superuser?, #tabbed_param, #word_count
Instance Method Details
#create ⇒ Object
22
23
24
25
26
27
28
29
30
31
|
# File 'app/controllers/virgo/admin/slideshows_controller.rb', line 22
def create
@slideshow = Slideshow.new(slideshow_params)
if @slideshow.save
flash[:notice] = "Slideshow successfully created. You can add slides below."
redirect_to edit_admin_slideshow_path(@slideshow)
else
render :new
end
end
|
#destroy ⇒ Object
45
46
47
48
49
50
|
# File 'app/controllers/virgo/admin/slideshows_controller.rb', line 45
def destroy
authorize! :destroy, @slideshow
@slideshow.destroy
flash[:notice] = "Slideshow deleted"
redirect_to admin_slideshows_path
end
|
#edit ⇒ Object
33
34
|
# File 'app/controllers/virgo/admin/slideshows_controller.rb', line 33
def edit
end
|
#index ⇒ Object
9
10
11
12
13
14
15
16
|
# File 'app/controllers/virgo/admin/slideshows_controller.rb', line 9
def index
if params[:sort].blank?
flash.keep
redirect_to admin_slideshows_path(sort: '-created_at') and return
end
@slideshows = Slideshow.joins(:author).search(filter_params).order(sort_order).page(params[:page])
end
|
#new ⇒ Object
18
19
20
|
# File 'app/controllers/virgo/admin/slideshows_controller.rb', line 18
def new
@slideshow = Slideshow.new
end
|
#update ⇒ Object
36
37
38
39
40
41
42
43
|
# File 'app/controllers/virgo/admin/slideshows_controller.rb', line 36
def update
if @slideshow.update(slideshow_params)
flash[:notice] = "Slideshow settings saved"
redirect_to edit_admin_slideshow_path(@slideshow)
else
render :edit
end
end
|