Displaying 4 results from an estimated 4 matches for "image_content_typ".
Did you mean:
image_content_type
2007 Feb 07
2
Image Downloads in IE
Hi,
This may not be a rails issue, if not apologies.
I have an application which allows image downloads.
The image is downloaded with the code:
send_data(@wallpaper.image,
:filename => @wallpaper.path,
:type => @wallpaper.image_content_type,
:disposition => "downloaded")
However, Internet Explorer doesn''t download the image, it just displays it.
I know can do the
whole ''Right click and choose save as'' thing but I was wondering is there a
method of
avoiding this with rails.
Thanks...
2011 Aug 04
3
#create tests fail when I add FriendlyId to my model
...scii => true
Here''s the test (using mocha):
def test_create_valid
Brand.any_instance.stubs(:valid?).returns(true)
post :create
assert_redirected_to brand_url(assigns(:brand))
end
Here''s the fixture:
one:
name: MyString
image_file_name: MyString
image_content_type: MyString
image_file_size: 1
image_updated_at: 2011-08-03 10:49:03
tease: MyText
description: MyText
All other tests pass, and if I comment out has_friendly_id, the create
tests pass as well. Does this ring any bells for anyone?
Thanks in advance,
Walter
--
You received this mes...
2009 Jul 07
2
paperclip unit testing
Hi,
Rails 2.3.2, paperclip 2.2.9.2
How can I unit test my model that has a paperclip attachment?
I add to my model:
--- CODE START ---
has_attached_file :image, :default_url => ''''
attr_protected :image_file_name, :image_content_type, :image_image_size
--- CODE END ---
Than I type a UNIT test:
--- CODE START ---
foo=FooModel.new({:image => File.new(''test/fixtures/img/an_image.gif'')})
--- CODE END ---
This works fine until... in that model I have a validator that accesses
the "image" attribute:...
2009 Apr 01
1
Paperclip - how to display images that were not uploaded?
I''m using Paperclip plugin to store images in my application.
In the database I have columns like: image_file_name,
image_content_type, image_file_size.
When I upload an image via form, everything works well. But when I put
filename directly into the database and place properly named image in
the place expected, the image doesn''t appear on the webpage. Even if I
just rename uploaded file and accordingly change the name...