shrine

ActionView::Template::Error (undefined method `image_url' for #<ActionView::Helpers::FormBuilder:0x00007f921c2ac9b0>)

安稳与你 提交于 2021-02-11 15:45:06
问题 I'm using the shrine gem in form object, I want to clip images, so, I followed https://github.com/shrinerb/shrine/wiki/Image-Cropping, but, happed above error, I think that it seems to be don't recognize photos models views <%= form_with model: @blog_form , url: user_blogs_path ,local: true do |f| %> <div class="field"> <% f.label :title %> <%= f.text_field :title %> </div> <div class="field"> <% f.label :content %> <%= f.text_area :content %> </div> <div class="field"> <% f.label :user_id %>

Module not found: Error: Can't resolve 'cropbox' 2

走远了吗. 提交于 2021-01-29 16:27:49
问题 I asked question Module not found: Error: Can't resolve 'cropbox' But I didn't get an answer, so I have to focus on more specific issues and searching in StackOverflow, So that I get three problem 1 rails doesn't load cropbox.js 2 clopbox.js couldn't export cropbox function 3 fileUplod.js couldn't import cropbox function this is the result what the as one of the above problem part of application.html.erb: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %

Module not found: Error: Can't resolve 'cropbox'

你说的曾经没有我的故事 提交于 2021-01-29 16:16:04
问题 Environment: Rails 6.0.2 Ruby 2.5.3 I installed cropperjs with yarn, Then I wanted to use cropper.js, but I got this error, It seems to be couldn't import cropbox module in fileUpload.js so, I changed the path, Sadly I couldn't import cropbox, would you like to help me? app/javascript/packs/fileUpload.js: import cropbox from 'cropbox' **#Here is problem ** uppy.on('upload-success', (file, response) => { // retrieve uploaded file data const uploadedFileData = response.body['data'] // set

Flash CS4拒绝放手

孤街醉人 提交于 2020-08-09 02:35:41
问题: I have a Flash project, and it has many source files. 我有一个Flash项目,它有很多源文件。 I have a fairly heavily-used class, call it Jenine. 我有一个相当频繁使用的课程,称之为Jenine。 I recently (and, perhaps, callously) relocated Jenine from one namespace to another. 我最近(也许,无情地)将Jenine从一个名称空间重新定位到另一个名称空间。 I thought we were ready - I thought it was time. 我以为我们已经准备好了 - 我以为是时候了。 The new Jenine was better in every way - she had lost some code bloat, she had decoupled herself from a few vestigial class relationships, and she had finally come home to the namespace that she had always secretly known in her heart was the one

Video isn't of allowed type (allowed types: video/mp4), Shrine, Rails

拟墨画扇 提交于 2019-12-24 09:58:51
问题 I'm trying to validate my videos to only allow .mp4 videos to be uploaded. I'm using Shrine to do this. Videos upload no problem without validations, but if I add the validation code the error displays: Video isn't of allowed type (allowed types: video/mp4) Here is my code: video_uploader.rb require "streamio-ffmpeg" class VideoUploader < Shrine plugin :processing plugin :versions plugin :determine_mime_type plugin :cached_attachment_data plugin :remove_attachment plugin :add_metadata add

Heroku, Shrine and Amazon S3: Blog post Images disappear after some time

我是研究僧i 提交于 2019-12-24 07:16:05
问题 I have a blog page I developed using rails 5.1. Everything works just fine, except that after I create a post in production and attach an image, the image stops showing after a while (say 30 minutes). I scouted around the internet looking for solutions and saw this which suggest the problem has to do with Heroku wiping the directory after every app restart. One solution offered is to host your images on a service like Amazon S3. I have however set S3 up and the images are being sent to the

Ruby/Rails - Shrine::Error (storage :cache isn't registered on PdfUploader)

僤鯓⒐⒋嵵緔 提交于 2019-12-12 12:23:34
问题 I've been struggling to figure out why I'm receiving this error on Heroku. Shrine::Error (storage :cache isn't registered on PdfUploader) initializer.rb require "shrine" require "shrine/storage/s3" s3_options = { access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'), secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'), region: ENV.fetch('AWS_REGION'), bucket: ENV.fetch('AWS_BUCKET') } Shrine.storages = { cache: Shrine::Storage::S3.new(prefix: "cache", upload_options: {acl: "public-read"}, **s3

Ruby Shrine - crop & direct upload Safari issue

China☆狼群 提交于 2019-12-12 05:49:03
问题 I am implementing direct upload with Shrine, jquery.fileupload and cropper.js in the add portion I am loading the image from the file upload to modal, define the cropper and show the modal if (data.files && data.files[0]) { var reader = new FileReader(); var $preview = $('#preview_avatar'); reader.onload = function(e) { $preview.attr('src', e.target.result); // insert preview image $preview.cropper({ dragMode: 'move', aspectRatio: 1.0 / 1.0, autoCropArea: 0.65, data: {width: 270, height: 270}