2022-11-24 15:44:31 +02:00
|
|
|
module Cms
|
|
|
|
|
2022-11-25 14:46:49 +02:00
|
|
|
class ImagesController < CmsController
|
2022-11-24 15:44:31 +02:00
|
|
|
|
|
|
|
def index
|
2022-11-28 00:12:20 +02:00
|
|
|
@images = Image.all
|
2022-11-24 15:44:31 +02:00
|
|
|
end
|
|
|
|
|
2022-11-24 22:28:56 +02:00
|
|
|
def create
|
2022-11-28 12:37:40 +02:00
|
|
|
new_image = Image.create_new(params['filename'] , params['image_file'])
|
|
|
|
redirect = :cms_images
|
|
|
|
if(params[:redirect])
|
|
|
|
redirect = params[:redirect].gsub("NEW" ,new_image.name)
|
|
|
|
puts "image redirect #{redirect}"
|
|
|
|
end
|
|
|
|
redirect_to redirect
|
2022-11-24 22:28:56 +02:00
|
|
|
end
|
|
|
|
|
2022-11-24 15:44:31 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|