Displaying 3 results from an estimated 3 matches for "imagescontrol".
2007 Aug 23
6
controller spec with model that validates_uniqueness
...t :update, :id => @image.id, :category_id =>
@category.id, :image => {:name => ''test'', :image_number => 13554}
#model
validates_presence_of :name
validates_uniqueness_of :name, :allow_nil => true
# rspec output
ActiveRecord::RecordInvalid in ''ImagesController should update a
database record when it receives a PUT''
Validation failed: Name has already been taken, Image number has
already been taken
It seems AR is not detecting that this is an edit/update that will
not cause a uniqueness conflict. I believe the code in the model
needs...
2006 Feb 28
1
ArgumentError (string contains null byte) -- file upload problem
...byte):
.//vendor/rails/actionpack/lib/action_controller/streaming.rb:55:in `file?''
.//vendor/rails/actionpack/lib/action_controller/streaming.rb:55:in
`send_file''
.//app/controllers/images_controller.rb:5:in `show''
Here''s the image controller:
class ImagesController < ApplicationController
def show
image = Image.find params[:id]
send_file image.blob, :type => ''image/jpeg'', :disposition => ''inline''
end
end
Any ideas?
Joe
2007 Apr 19
2
invalid geometry string in change_geometry
I get the following error at the browser:
ArgumentError in ImagesController#upload
invalid geometry string `110×''
... for the call to change_geometry with an explicit size (''110x'') as
the geometry string:
def make_thumb (the_img)
require ''RMagick''
size = "110x"
debugger if ENV[''RAILS_ENV'...