
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Pre-beta release. Public APIs may change.
Add a blog to any Rails 3.1 site using rails_blog_engine
. First, add the
following line to your Gemfile
:
gem 'rails_blog_engine'
...and run:
bundle install
rails generate rails_blog_engine:install
rake db:migrate
Check the configuration in the newly-generated
config/initializers/rails_blog_engine.rb
and tweak as necessary.
If you're using Devise, or another framework which defines current_user
on ActionController::Base
, then all you need to do is add a blog_admin?
method to your user model:
class User
# ...other stuff here...
# Return true if the user is allowed to post to the blog,
# moderate comments, etc.
def blog_admin?
# Your code here.
end
end
You should now be able to access your blog at http://0.0.0.0:3000/blog
and start posting!
rails_blog_engine
should...
CoffeeScript, SCSS and other standard Rails 3.1 features are fair game, as are RSpec, HAML and CanCan.
The following features are on my wishlist:
In other words, we want just enough features to make blogging pleasant, and nothing more.
ActionController::Base#current_user
?Add something like the following to
config/initializers/rails_blog_engine.rb
:
class RailsBlogEngine::ApplicationController
def current_user
# Check session, etc., here.
end
end
Please open an issue if you have any questions or problems.
To set up titles, add the two following yield
lines to the <head>
tag
in your app/views/layouts/application.html.erb
:
<head>
<title><%= yield(:title) %></title>
<%= yield(:head) %>
<!-- etc. -->
</head>
To enable the spam filter, create an Akismet account at http://akismet.com/
and set the environment variables RAKISMET_KEY
and RAKISMET_URL
. If
you're deploying to Heroku, you can do this using:
heroku config:add RAKISMET_KEY="mykey" RAKISMET_URL="http://example.com/"
On your development machine, you can create a file named .env
in the root
directory of your project, and specify the variables as follows:
RAKISMET_KEY=mykey
RAKISMET_URL=http://example.com/
Then launch your application using the foreman start
command. This will
require adding the foreman
gem to your Gemfile
, and creating a
Procfile
.
If you want to be able to display source code snippets with syntax
highlighting, you'll need to add the following line to your Gemfile
:
gem 'pygments', :git => 'https://github.com/nathany/pygments-gem.git'
Next, run bundle install
and restart your server. This will allow
you to include code snippets in your posts as follows:
<filter:code lang="ruby">
def hello
puts "Hello!"
end
</filter:code>
You can also add your own filters. Documentation and generators should be available soon.
FAQs
Unknown package
We found that rails_blog_engine 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.