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.
A blog implementation with WYSIWYG content editing, post scheduling, pagination and optional top level routes for each post category.
This is the 2.0 series of effective_posts.
This requires Twitter Bootstrap 4 and Rails 6+
Please check out Effective Posts 0.x for more information using this gem with Bootstrap 3.
Please first install the effective_datatables gem.
Please download and install Twitter Bootstrap4
Add to your Gemfile:
gem 'effective_posts'
Run the bundle command to install it:
bundle install
Then run the generator:
rails generate effective_posts:install
The generator will install an initializer which describes all configuration options and creates a database migration.
If you want to tweak the table name (to use something other than the default 'posts'), manually adjust both the configuration file and the migration now.
Then migrate the database:
rake db:migrate
Add the following helper to your application layout in the <head>..</head>
section. This works alongside effective_pages to include some publisher meta tags.
= effective_posts_header_tags
There are no required javascript or stylesheet includes.
To create your first post, visit /admin/posts
and click New Post
.
If you've defined more than one category in the /app/config/initializers/effective_posts.rb
initializer, you will be asked to assign this post a category. Otherwise the default category posts
will be assigned.
You can schedule a post to appear at a later date by setting the published_at value to a future date.
As well, if you're using the effective_roles gem, you will be able to configure permissions so that only permitted users may view this post.
If config.use_category_routes
is enabled in the /app/config/initializers/effective_posts.rb
initializer, each category you specify will automatically have a top level route. So posts created in the :blog
category will be available at /blog
and any posts made in that category will be available at /blog/1-my-post-title
.
If disabled, all posts will be available at /posts
, with posts for a specific category available at /posts?category=blog
and the show routes will be /posts/1-my-post-title
regardless of category.
Use link_to_post_category(:blog)
to display a link to the Blog page. The helper considers config.use_category_routes
and puts in the correct url.
The effective_bootstrap gem is used for pagination on all posts#index type screens.
The per_page for posts may be configured via the /app/config/initializers/effective_posts.rb
initializer.
All authorization checks are handled via the effective_resources gem found in the config/initializers/effective_resources.rb
file.
The permissions you actually want to define are as follows (using CanCan):
can [:index, :show], Effective::Post
if user.admin?
can :manage, Effective::Post
can :admin, :effective_posts
end
If you use pg_search
then Effective::Posts
will be also included on its multisearch
by default, allowing you to search across all posts.
There are some obvious additional features that have yet to be implemented:
MIT License. Copyright Code and Effect Inc.
Run tests by:
guard
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that effective_posts demonstrated a healthy version release cadence and project activity because the last version was released less than 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.