redactor-rails 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controller/redactor_rails/pictures_controller.rb +0 -1
- data/config/routes.rb +1 -1
- data/lib/redactor-rails/version.rb +1 -1
- metadata +2 -4
- data/lib/generators/redactor/templates/active_record/carrierwave/redactor/attachment_file.rb +0 -7
- data/lib/generators/redactor/templates/base/carrierwave/uploaders/redactor_rails_attachment_file_uploader.rb +0 -42
@@ -1,6 +1,5 @@
|
|
1
1
|
class RedactorRails::PicturesController < ApplicationController
|
2
2
|
def index
|
3
|
-
#@pictures = RedactorRails.picture_model.find_all.map {|picture| {"thumb" => picture.url_thumb, "image" => picture.url} }
|
4
3
|
@pictures = RedactorRails.picture_model.find_all
|
5
4
|
render :json => @pictures.to_json
|
6
5
|
|
data/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redactor-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mime-types
|
@@ -60,9 +60,7 @@ files:
|
|
60
60
|
- lib/generators/redactor/install_generator.rb
|
61
61
|
- lib/generators/redactor/templates/active_record/carrierwave/migration.rb
|
62
62
|
- lib/generators/redactor/templates/active_record/carrierwave/redactor/asset.rb
|
63
|
-
- lib/generators/redactor/templates/active_record/carrierwave/redactor/attachment_file.rb
|
64
63
|
- lib/generators/redactor/templates/active_record/carrierwave/redactor/picture.rb
|
65
|
-
- lib/generators/redactor/templates/base/carrierwave/uploaders/redactor_rails_attachment_file_uploader.rb
|
66
64
|
- lib/generators/redactor/templates/base/carrierwave/uploaders/redactor_rails_picture_uploader.rb
|
67
65
|
- lib/redactor-rails.rb
|
68
66
|
- lib/redactor-rails/backend/carrierwave.rb
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
class RedactorRailsAttachmentFileUploader < CarrierWave::Uploader::Base
|
3
|
-
include RedactorRails::Backend::CarrierWave
|
4
|
-
|
5
|
-
# Include RMagick or ImageScience support:
|
6
|
-
# include CarrierWave::RMagick
|
7
|
-
# include CarrierWave::MiniMagick
|
8
|
-
# include CarrierWave::ImageScience
|
9
|
-
|
10
|
-
# Choose what kind of storage to use for this uploader:
|
11
|
-
storage :file
|
12
|
-
|
13
|
-
# Override the directory where uploaded files will be stored.
|
14
|
-
# This is a sensible default for uploaders that are meant to be mounted:
|
15
|
-
def store_dir
|
16
|
-
"system/redactor_assets/attachments/#{model.id}"
|
17
|
-
end
|
18
|
-
|
19
|
-
# Provide a default URL as a default if there hasn't been a file uploaded:
|
20
|
-
# def default_url
|
21
|
-
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
22
|
-
# end
|
23
|
-
|
24
|
-
# Process files as they are uploaded:
|
25
|
-
# process :scale => [200, 300]
|
26
|
-
#
|
27
|
-
# def scale(width, height)
|
28
|
-
# # do something
|
29
|
-
# end
|
30
|
-
|
31
|
-
# Add a white list of extensions which are allowed to be uploaded.
|
32
|
-
# For images you might use something like this:
|
33
|
-
def extension_white_list
|
34
|
-
RedactorRails.attachment_file_types
|
35
|
-
end
|
36
|
-
|
37
|
-
# Override the filename of the uploaded files:
|
38
|
-
# Avoid using model.id or version_name here, see uploader/store.rb for details.
|
39
|
-
# def filename
|
40
|
-
# "something.jpg" if original_filename
|
41
|
-
# end
|
42
|
-
end
|