This gem aims to provide a simple and basic blogging engine in Rails 4. Fully customizable.
Add this line to your application's Gemfile:
gem 'rails_blog'
And then execute:
$ bundle install
Add this line to your application's Gemfile and execute bundle install:
gem 'devise', github: 'plataformatec/devise', branch: 'rails4'
Run this generator:
rails generate rails_blog:install
Copy engine migrations:
rake rails_blog:install:migrations
Run them:
rake db:migrate
Start solr server:
rake sunspot:solr:start
And in your routes.rb file add this line:
mount RailsBlog::Engine => '/blog'
Create an admin user in your console:
RailsBlog::Admin.create(name: "name", email: "email", password: "password")
Enjoy it!
Run this generator and implement post comments in that file:
rails generate rails_blog:comments:views
Note: That view will be rendered in the post show view.
Run this generator and add social sharing implementation in that file:
rails generate rails_blog:sharing:views
Note: That view will be rendered in the post show view.
Run this generator and edit the files:
rails generate rails_blog:sidebar:views
The sidebar views should be in your app/views/rails_blog/sidebar
folder and they should be configured in the rails_blog.rb
initializer file.
Create _example.html.erb
partial view in your app/views/rails_blog/sidebar
folder.
<h1>This is a sidebar view example</h1>
Configure the sidebar view in the rails_blog.rb
initializer file:
config.siderbar_widgets.add :example, order: 4 # <= Add your new sidebar view.
Note: The order option refers to the order that the sidebar views will be displayed.
Restart the server and it's done.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request