Skip to content

Commit 5ffedc9

Browse files
committed
Fixed typo and ignored dragonfly generated images
1 parent 7f7028a commit 5ffedc9

File tree

4 files changed

+31
-19
lines changed

4 files changed

+31
-19
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515
/log
1616
/log/*.log
1717
/tmp
18+
19+
#Ignore dragonfly generated images locally
20+
/public/system

app/models/product_picture.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class ProductPicture < ActiveRecord::Base
44

55
image_accessor :picture
66

7-
attr_accessible :descripiton, :picture_name, :picture_uid, :title, :picture
7+
attr_accessible :description, :picture_name, :picture_uid, :title, :picture
88

99
#one convenient method to pass jq_upload the necessary information
1010
def to_jq_upload

app/views/product_pictures/index.html.erb

+18-18
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<div class="progressbar fileupload-progressbar nofade"><div style="width:0%;"></div></div>
66
<span class="btn success fileinput-button">
77
<span><%= t('pictures.add_files') %>...</span>
8+
<%= f.text_field :title %>
9+
<%= f.text_area :description %>
810
<%= f.file_field :picture %>
911
</span>
1012
<button type="submit" class="btn primary start"><%= t('pictures.start_upload') %></button>
@@ -77,7 +79,6 @@
7779
{% } %}
7880
</script>
7981

80-
8182
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
8283
<%= javascript_include_tag 'jquery.ui.widget.js' %>
8384
<!-- The Templates and Load Image plugins are included for the FileUpload user interface -->
@@ -90,23 +91,22 @@
9091
<!-- add include_tag js files to config.assets.precompile in ...environments/production.rb if you have it in vendor/ assets -->
9192

9293
<script type="text/javascript" charset="utf-8">
93-
$(function () {
94-
// Initialize the jQuery File Upload widget:
95-
$('#fileupload').fileupload();
96-
//
97-
// Load existing files:
98-
$.getJSON($('#fileupload').prop('action'), function (files) {
99-
var fu = $('#fileupload').data('fileupload'),
100-
template;
101-
fu._adjustMaxNumberOfFiles(-files.length);
102-
template = fu._renderDownload(files)
103-
.appendTo($('#fileupload .files'));
104-
// Force reflow:
105-
fu._reflow = fu._transition && template.length &&
106-
template[0].offsetWidth;
107-
template.addClass('in');
108-
$('#loading').remove();
109-
});
94+
$(function () {
95+
// Initialize the jQuery File Upload widget:
96+
$('#fileupload').fileupload();
11097

98+
// Load existing files:
99+
$.getJSON($('#fileupload').prop('action'), function (files) {
100+
var fu = $('#fileupload').data('fileupload'),
101+
template;
102+
fu._adjustMaxNumberOfFiles(-files.length);
103+
template = fu._renderDownload(files)
104+
.appendTo($('#fileupload .files'));
105+
// Force reflow:
106+
fu._reflow = fu._transition && template.length &&
107+
template[0].offsetWidth;
108+
template.addClass('in');
109+
$('#loading').remove();
111110
});
111+
});
112112
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class ChangeColumnDescription < ActiveRecord::Migration
2+
def up
3+
rename_column :product_pictures, :descripiton, :description
4+
end
5+
6+
def down
7+
rename_column :product_pictures, :description, :descripiton
8+
end
9+
end

0 commit comments

Comments
 (0)