Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
activeadmin-poro-decorator
Advanced tools
Alternative for draper, if you need decorators at ActiveAdmin (and Rails). Active Admin uses the Draper gem for decorators, but sometimes you don't need that. For reasons you could read this article: http://thepugautomatic.com/2014/03/draper.
See discussion of PORO with Active Admin authors here.
Add this line to your application's Gemfile:
gem 'activeadmin-poro-decorator'
And then execute:
$ bundle
Or install it yourself as:
$ gem install activeadmin-poro-decorator
Then run rake-task to copy config file:
$ rake config:copy
Finally, rename activeadmin-poro-decorator.yml.sample to activeadmin-poro-decorator.yml:
$ mv config/activeadmin-poro-decorator.yml.example config/activeadmin-poro-decorator.yml
# app/admin/post.rb
ActiveAdmin.register Post do
decorate_with PostDecorator
permit_params :title
index do
column :id
column :title
column :hello #delegated
column :link_title #delegated
end
end
# app/presenters/post_decorator.rb
class PostDecorator < DelegateClass(Post)
include ActiveadminPoroDecorator
class << self
delegate :all, :arel_table, :find_by_sql, :columns, :connection,\
:unscoped, :table_name, :primary_key, to: Post
def model_name
ActiveModel::Name.new Post
end
end
def hello
"Hello, #{title}"
end
def link_title
helpers.link_to(id, url_helpers.admin_post_path(self))
end
end
For more examples have a look to sample app
Activeadmin-poro-decorator is created with support of Legelisten.no
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that activeadmin-poro-decorator 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.