editables 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.textile CHANGED
@@ -12,6 +12,10 @@ h1. Installation
12
12
  class ApplicationController < ActionController::Base
13
13
  helper Editables::Engine.helpers
14
14
  end
15
+
16
+ add this to routes routes.rb
17
+
18
+ mount Editables::Engine, at: "/editables"
15
19
 
16
20
  <!-- add this to the top of your layout file right after the body tag
17
21
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -84,7 +84,7 @@ module Editables
84
84
  end
85
85
  if can_edit?
86
86
  html += [
87
- "<form action='/editables/image' method='post' enctype='multipart/form-data' id='#{form_id}' style='width:90px; margin:-50px 10px 0 10px; overflow:hidden; position:relative; z-index:10' >",
87
+ "<form action='/editables/image' method='post' enctype='multipart/form-data' id='#{form_id}' style='width:90px; height:35px; margin:-35px 10px 0 10px; overflow:hidden; position:relative; z-index:10' >",
88
88
  "<input type='file' name='editable_image[image]' onchange='$(\"##{form_id}\").submit()' style='border:none;padding0' />",
89
89
  "<input type='hidden' name='editable_image[name]' value='#{name}'/>",
90
90
  "<input type='hidden' name='authenticity_token' value='#{form_authenticity_token}'/>",
@@ -2,14 +2,29 @@ module Editables
2
2
  class EditableImage < ActiveRecord::Base
3
3
  set_table_name "editable_images"
4
4
 
5
- has_attached_file :image,
6
- :styles => {
7
- :large => "1200x1200>",
8
- :medium => "600X600>",
9
- :small => "300X300>"
10
- },
11
- :path => ":rails_root/public/editable_images/:id/:style/:basename.:extension",
12
- :url => "/editable_images/:id/:style/:filename"
5
+ if FileTest.exists?(Rails.root.join('config', 's3.yml'))
6
+ config = YAML.load(File.read('config/s3.yml'))[Rails.env]
7
+ has_attached_file :image,
8
+ :styles => {
9
+ :large => "1200x1200>",
10
+ :medium => "600X600>",
11
+ :small => "300X300>"
12
+ },
13
+ :storage => :s3,
14
+ :s3_credentials => "#{Rails.root}/config/s3.yml",
15
+ :s3_host_alias => config["s3_host_alias"],
16
+ :url => ":s3_alias_url",
17
+ :path => "/paperclip/:class/:id/:style/:filename"
18
+ else
19
+ has_attached_file :image,
20
+ :styles => {
21
+ :large => "1200x1200>",
22
+ :medium => "600X600>",
23
+ :small => "300X300>"
24
+ },
25
+ :path => ":rails_root/public/editable_images/:id/:style/:basename.:extension",
26
+ :url => "/editable_images/:id/:style/:filename"
27
+ end
13
28
 
14
29
  end
15
30
  end
data/editables.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "editables"
8
- s.version = "0.0.5"
8
+ s.version = "0.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gabe Coyne"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: editables
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -143,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
143
143
  version: '0'
144
144
  segments:
145
145
  - 0
146
- hash: 3448543127757088296
146
+ hash: 201992576492553629
147
147
  required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  none: false
149
149
  requirements: