live and let live.与民争利的政府必亡
Sunday, 23 October 2016
Blogit - A Rails blogging solution
Blogit lets you add a blog to your Ruby on Rails application in just a few seconds.
Add these to your Gemfile
gem"blogit"# Blogit depends on ActsAsTaggableOngem"acts-as-taggable-on"
...and run bundle install to install the gem.
# add an initializer to config/initializers with all of the configuration options
$ rails g blogit:install
# This will add the necessary migrations to your app's db/migrate directory
# You don't need to run this again if you've already done so
# This will run any pending migrations
then add the following to your routes.rb file:
mount Blogit::Engine =>"/blog"
Finally, declare which of your models acts as blogger in your app (probably User or Admin).
classUser < ActiveRecord::Base
Go to http://localhost:3000/blog and see your marvelous new blog.
Blogit provides you with the following features
An XML Sitemap located at /blog/posts.xml
An RSS feed located at /blog/posts.rss
Internationalization (see the locales file for configurable options)