Class: Workarea::Admin::ContentAssetsController
Instance Method Summary
collapse
#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
#create ⇒ Object
30
31
32
33
34
35
36
37
|
# File 'app/controllers/workarea/admin/content_assets_controller.rb', line 30
def create
if @asset.save
flash[:success] = t('workarea.admin.content_assets.flash_messages.created')
redirect_to content_asset_path(@asset)
else
render :new, status: :unprocessable_entity
end
end
|
#destroy ⇒ Object
50
51
52
53
54
|
# File 'app/controllers/workarea/admin/content_assets_controller.rb', line 50
def destroy
@asset.destroy
flash[:success] = t('workarea.admin.content_assets.flash_messages.removed')
redirect_to content_assets_path
end
|
#edit ⇒ Object
39
|
# File 'app/controllers/workarea/admin/content_assets_controller.rb', line 39
def edit; end
|
#index ⇒ Object
Also known as:
insert
9
10
11
12
13
14
|
# File 'app/controllers/workarea/admin/content_assets_controller.rb', line 9
def index
DirectUpload.ensure_cors!(request.url) if Configuration::S3.configured?
search = Search::AdminAssets.new(params)
@search = Admin::SearchViewModel.new(search, view_model_options)
end
|
#new ⇒ Object
28
|
# File 'app/controllers/workarea/admin/content_assets_controller.rb', line 28
def new; end
|
#show ⇒ Object
25
26
|
# File 'app/controllers/workarea/admin/content_assets_controller.rb', line 25
def show
end
|
17
18
19
20
21
22
23
|
# File 'app/controllers/workarea/admin/content_assets_controller.rb', line 17
def tags
@tags = if Content::Asset.empty?
[]
else
Content::Asset.all_tags(type: params[:type])
end
end
|
#update ⇒ Object
41
42
43
44
45
46
47
48
|
# File 'app/controllers/workarea/admin/content_assets_controller.rb', line 41
def update
if @asset.update_attributes(params[:asset])
flash[:success] = t('workarea.admin.content_assets.flash_messages.saved')
redirect_to content_asset_path(@asset)
else
render :edit, status: :unprocessable_entity
end
end
|