
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Rails + RailsAdmin + Mongoid/PostgreSQL CMS
Very opinionated and tuned for my needs.
Add this line to your application's Gemfile:
gem 'hancock_cms_mongoid', '~> 2.0'
or:
gem 'hancock_cms_activerecord', '~> 2.0'
Only PostgreSQL is tested or supported for AR(from root repo). Others will probably work, but untested.
And then execute:
$ bundle
Or install it yourself as:
$ gem install hancock_cms -v 2.0
For activerecord, generate migrations and run them
rails g rails_admin_settings:migration
rails g hancock_cms:migration
rake db:migrate
Make sure you have rails 5.0 installed
rails -v
If not, uninstall rails and install again
gem uninstall rails
gem install rails -v 5.0
Then, for mongoid:
rails new my_app -B -T -O -m https://raw.githubusercontent.com/red-rocks/hancock_cms/rails5/template.rb
cd my_app
rails g hancock:cms:setup
for ActiveRecord:
rails new my_app -B -T --database=postgresql -m https://raw.githubusercontent.com/red-rocks/hancock_cms/rails5/template.rb
cd my_app
rails g hancock:cms:setup
generator creates a new RVM gemset, runs bundle install
and setup some files (assets, config/initializers/*, routes, etc).
All models included in the gem support localization via either hstore_translate or built-in Mongoid localize: true option.
You can get a nice admin UI for editing locales by adding rails_admin_hstore_translate or rails_admin_mongoid_localize_field
Enable localization in HancockCMS:
Hancock.configure do |hancock|
hancock.localize = true
...
end
Add rails_admin_hstore_translate
or hstore_translate
gem if using PostgreSQL:
gem 'rails_admin_hstore_translate'
or
gem 'hstore_translate'
Add rails_admin_mongoid_localize_field
gem if using MongoDB:
gem 'rails_admin_mongoid_localize_field'
It's basically Mongoid + Rails Admin + some of my common models and controllers, etc.
See their documentation for more info
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that hancock_cms 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
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.