gateway/app/controllers/cms/images_controller.rb

22 lines
417 B
Ruby
Raw Normal View History

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
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