Forum: Ruby on Rails attachment_fu

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jose vicente R. (Guest)
on 2009-03-05 17:44
First at all sorry if my english is not the best

I have a problem with this plugin. It has been installed because we need
to upload images in our web. We need 3 kinds of images with different

this is our code:

Image model:

class Image < ActiveRecord::Base

has_attachment  :content_type => ['image/jpeg', 'image/pjpeg',
'image/gif', 'image/jpg', 'image/png'],
                              :storage => :file_system,
                              :path_prefix => 'public/images',
                              :size => 1.kilobyte..300.kilobytes,
                              :resize_to => '700>',
                              :thumbnails => { :titular1 => '220>',
:titular2 => '150>', :foro => '440>'  },
                              :processor => :MiniMagick


the name of the controller is titulares. The code is like that :

class TitularesController < ApplicationController
def edit
    @titulo = "Editar titular"
    @titular = Contenido.find(params[:id])
def create[:contenido])

    # Actualizo el usuario, incrementando sus puntos y su nº de posts de
    autor = Usuario.find(@titular.usuario_id)
    estadisticas_up(, Subtipo::TITULARES)
    autor.update_attribute("puntos", autor.puntos + @titular.puntos_msg)
    autor.update_attribute("puntos_anual", autor.puntos_anual +
/*this is the part of code for the images*/
    respond_to do |format|
        #guardo las imagenes
        unless (image = params[:image]).nil?
          img ={:usuario_id =>
session[:usuario_id], :contenido_id =>, :orden =>1}))

        format.html { redirect_to(portada_titulares_path) }
        format.xml  { render :xml => @titular, :status => :created,
:location => @titular }
        format.html { render :action => "new" }
        format.xml  { render :xml => @titular.errors, :status =>
:unprocessable_entity }

OK, when I edit a titular there's no problem. I can add or edit a photo
perfectly and in my BBDD there are the 3 images with the respective
size. the problem exits whe i want to create a titular, I can add an
image but my BBDD only stores the original image with the original size.
There is not the copies with another sizes.

I don´t know because the anothers sizes  there aren´t written in the
BBDD...any help please???
Jose vicente R. (Guest)
on 2009-03-05 18:07
I replace with! and the result is the same.
Jose vicente R. (Guest)
on 2009-03-05 18:23
solved, it doesn´t work fine in localhost but in the server there's no
This topic is locked and can not be replied to.