Socket
Book a DemoInstallSign in
Socket

ufujs-rails

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ufujs-rails

0.0.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

Unobtrusive File Upload adapter for jQuery UJS and Rails

This gem takes care about file uploads for remote form. It is a simple alternative for remotipart gem for rails. But instead of using iframe for file uploads this gem uses the base64 encoding to send the file to the server.

Installing

Add it to your Gemfile:

gem 'ufujs-rails'
gem 'carrierwave-base64'

Then run bundle install to update your application's bundle.

And in application.js under the jquery_ujs:

//= require jquery_ufujs

Usage

This gem encode the base64 string on the client side. Use carrierwave-base64 to handle the decoding on the server side.

Active Record

Mount the uploader: mount_base64_uploader :image, ImageUploader

Filter Parameters

To keep your logs clean you can add the filter with name of you attribute to config/initializers/filter_paremeter_logging.rb:

config.filter_parameters += [:image]

Browser Compatibility

ie10 chrome firefox opera safari

If you care about IE9 and lower, don't worry I am sure that you will have the white line in your life soon.

For IE9 and lower form will be submited as HTML. You just have to add the authenticity_token option to your form

= form_for @record, remote: true, authenticity_token: true do

Copyright© Alex Galushka

FAQs

Package last updated on 09 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.