Code Monkey home page Code Monkey logo

almanac's Introduction

Almanac

Almanac is the most elegant mountable blog engine that can be easily hooked up in the existing Rails application.

Main Features

  • Slick default design that can be easily customized.
  • Markdown for everything.
  • Drafts that make sense.
  • Easy Google Analytics support.
  • Akismet support for spam filtering in comments.
  • Built-in social sharing with Facebook and Twitter.
  • RSS support.
  • Tags for posts.
  • Photo uploading.
  • Complete integration with Devise and CanCan.
  • Tested with RSpec and FactoryGirl
  • Uses haml, scss, CoffeeScript and Bootstrap for views.

Installation

1. Add the gem to your Gemfile

gem "almanac"

And run bundle install.

2. Setup Routes

To hook up Almanac routes to your current Rails app simply put this code in your config/routes.rd file

mount Almanac::Engine, :at => '/blog'

You can obviously setup any route you want. E.g. /posts or /almanac.

3. Run Almanac Migrations

First off, install Almanac migrations:

rake almanac:install:migrations

Then migrate your database:

rake db:migrate

4. Devise and CanCan Setup

Almanac relies on Devise and CanCan properly configured in your app. In short, the current_user variable and CanCan ability.rb file has to exist. You can setup permissions for the following Almanac models:

can :manage, Almanac::Post
can :manage, Almanac::Blog
can :manage, Almanac::Comment
can :manage, Almanac::Image

These particular rules will allow the specified user to do anything with any Almanac record in the database.

5. Dragonfly Setup

Almanac relies on the Dragonfly gem for file uploads. Configure Dragonfly in your app by adding the following line to config/initializers/dragonfly.rb:

require 'dragonfly/rails/images'

6. Specify User Class Name

Lastly, you'll have to specify the name of your user model. Create a config/initializers/almanac.rb file and add the following line there:

Almanac.user_class = "User" # other possibilities: "Author", "Writer", etc.

Testing

Almanac's models and controllers are tested with RSpec and FactoryGirl. Rails engines, such as Almanac, are normally tested with a dummy app that is located inside the 'spec' folder. Migrate your test database from the spec/dummy directory:

rake db:migrate RAILS_ENV=test

Go back to the almanac directory and run rspec spec.

Contribute

Fork the repo, do work, test it, pull request.

almanac's People

Contributors

vasinov avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.