Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Allow Paperclip to pass attachments as data-uri on unsaved records. Useful when dealing with forms and validation errors.
Imagine you have two fields on a model - name
and attachment
. Let's say that name
has a validation. If you edit an object and change both name
and attachment
, but the new name doesn't meet the validation, then you lose the new attachment
.
With paperclip-staging, the attachment is preserved using a hidden field. It is also available with staged_url(style_name)
(instead of regular url(style_name)
) calls, using data-uri encoding - which is useful if you want to display current value for the attachment/image.
You can check the example project.
Add this line to your application's Gemfile:
gem 'paperclip-staging'
And then execute:
$ bundle
Or install it yourself as:
$ gem install paperclip-staging
Add a new hidden field in the form, named <attachment_name>_staging
.
f.hidden_field :file_staging
or
f.input :file_staging, as: :hidden
for simple_form
Add this field as a valid form param:
attr_accessible :file_staging
or
params.require(xxx).permit(xxx, :file_staging)
for Rails 4
That's it!
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that paperclip-staging demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.