Git Product home page Git Product logo

attachment_magick's Issues

Getting an error on upload

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

You can set grid size manually:

config.columns_amount = 16

config.columns_width = 52

config.gutter = 8

Or with our magick :)

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!

Tamanhos individuais de imagens para cada modelo

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_1 : mantemos o tamanho padrão (sem altura, com de 54px largura);
  • grid_7 : adicionamos uma altura fixa e mantemos a largura padrão;
  • grid_8 : largura de 432px para 210px;
  • grid_9 : 420x110 cortados pelo centro da imagem. alias para
    grid_9 :width => 420, :height => 110

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.