marcosinger / attachment_magick Goto Github PK
View Code? Open in Web Editor NEWUpload images and videos(vimeo, youtube) and cache using Swfupload and Dragonfly
License: MIT License
Upload images and videos(vimeo, youtube) and cache using Swfupload and Dragonfly
License: MIT License
When I try to upload, I get a dialog box which appears and says "500". Upon inspecting the log I see this error:
Completed 500 Internal Server Error in 61ms
NoMethodError (undefined method style_publisher' for #<Class:0x007f86ed76fb80>): activerecord (3.2.2) lib/active_record/dynamic_matchers.rb:50:in
method_missing'
attachment_magick (0.3.3) app/controllers/attachment_magick/images_controller.rb:13:in `create'
My attachment_magick initializer looks like this:
AttachmentMagick.setup do |config|
config.default_add_partial = '/media/add_image' # default
config.parse_stylesheet('960_24_col.css')
config.orms = ["ActiveRecord"]
config.custom_styles do
publisher "52x"
largest "512x"
large "256x"
medium "128x"
small "64x"
smallest "32x"
end
end
Any ideas what I did wrong?
Thanks in advance for any assistance!
Display some message if object is not new record in helpers, for inform users that the upload is just possible if doc is saved.
Um método que gere todos os tamanhos (width) dos grids baseado no 960 Grid System. Ex.: http://www.spry-soft.com/grids/
dependencia com mongoid 2.0.0.rc.6
Dentro da faixa de grid que pode ser criado com o método privado "generate_grids" podemos atribuir quais tamanhos de image cada modelo precisa.
Com o generate_grids padrão, temos 19 colunas, com 54px de largura e sem espaçamento entre elas. Com isso podemos ter uma classe assim:
class Robocop
attachment_magick do
grid_1
grid_7 :height => 320
grid_8 :width => 210
grid_9 "420x110"
end
end
O exemplo acima atribui a class Robocop 4 tamanhos de imagem, sendo eles:
grid_9 :width => 420, :height => 110
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.