spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories

Rails4 | Paperclip: image is uploaded but it doesn't displays well (strange url is returned)


That is what Paperclip uses for cache-busting. If you want to remove it, just call @user.avatar.url(:original, timestamp: false)

You can also disable this globally by putting the following in the config/initializers/paperclip.rb file.

Paperclip::Attachment.default_options[:use_timestamp]
= false

This answer explains why you may want cache-busting in place though.


Categories : Ruby On Rails

Related to : Rails4 | Paperclip: image is uploaded but it doesn't displays well (strange url is returned)
image_tag not showing paperclip uploaded image
Looks like your issue is related to a recent commit which doesn't properly escape the timestamp. A temporary workaround is to disable the timestamp while a fix is worked-out. For individual calls @company.avatar.url(:thumb, timestamp:false) Or you can disable this globally but putting the following line within your config/initializers/paperclip.rb file. Paperclip::Attachment.default_options[:

Categories : Ruby On Rails
Rails Paperclip doesn't understand the same convert options as ImageMagick
Two issues here: Paperclip w/ Rails will often require you to add \ in front of < or > characters, as in 1280x\> Also, Paperclip always needs those x's, even when just doing width (1280x\> and not 1280\>). Here's my full solution for setting max width to 1280 when above 600Kb and not a .gif: has_attached_file :main_image, :styles => {:original => "" }, :convert_opti

Categories : Ruby On Rails
How do I correct my script, that it doesn't matter what file name has the .xml that is uploaded?
When uploading a file, you don't need to save it to disk on the server - simply read the upload IO (see here): view.erb: <%= form_tag({action: :upload}, multipart: true) do %> <%= file_field_tag 'xml' %> <% end %> <%= form_for @upload do |f| %> <%= f.file_field :xml %> <% end %> controller: uploaded_io = params[:upload][:xml] string_complete = uploaded

Categories : Ruby
Javascript: Mouseover Thumbnail, Bigger Image Displays..trying to use 'this'
var image = document.getElementsByClassName('image'); var mainImage = document.getElementById('main-image'); [].forEach.call(image,function(img){ img.onmouseover = function(){ mainImage.src = img.parentNode.href; }; }); getElementsByClassName returns a set of elements, so you have to iterate over them..

Categories : Javascript
Copy uploaded image to another folder
Instead of copy($key, "image_thumbnail/" . $_FILES['images']['name'][$i]); use this copy("image/" . $_FILES['images']['name'][$i], "image_thumbnail/" . $_FILES['images']['name'][$i]);

Categories : PHP
Recently Add
Groups and Users has many oder has many through?
Rails format specifier differences
Capistrano can not create symlinks: file exist
Admin can't delete users. Ruby on Rails 3 - Michael Hartl
Don't show user name who create post
Using Wicked with Devise (2 step signup process)
RubyOnRails Rake test failures
Rails session start event handler
Why ActiveModel::ForbiddenAttributesError error?
How can i track the issue in production RAILS
Cannot install spree gem - ERROR: invalid gem: package is corrupt
Why are the nested resources for Devise authentication not working?
Rails Devise - how to open access to the site root
Rails: respond_with the same template for two methods
rails with postgresl database "role postgres does not exist"
Instance variable in Rails helper not set
Monkey patch rails 3.2 rake task
Rails_admin: Should I have admin_user or user with admin role to manage users and admin panel
undefined method `attachments' for nil:NilClass
Memory usage increase with Ruby 2.1 versus Ruby 2.0 or 1.9
Can a Rails app be deployed without using Heroku Toolbelt? If so, how?
Enable random access to collection with MongoDB
libmysqlclient-dev installation fails
undefined method `name' for nil:NilClass. Can't find @followed.name but @followed is set
Allowing an arbitrary domain and subdomain in session_store.rb
Pushmeup Gem - Can't send push notifications in Active Admin model
Rails console does not start
GitHub Import: Could not locate Gemfile
AWS::S3::PermanentRedirect in SongsController#index "The bucket you are attempting to access must be addressed using the specified endpoint"
automatically create ActiveRecord parent for association
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.