Coder Social home page Coder Social logo

blog's Introduction

Blog

Create posts and categories, nothing more.

Installation

  1. Include gem to the Gemfile
gem 'blog', git: '[email protected]:werein/blog.git'
  1. Mount it like Rails engine
mount Blog::Engine => '/blog'
  1. Install engine
rails g blog:install

Configuration

You need to specify User class with has_role? method. It determinate if user have access to given action.

Create config/initializers/blog.rb file with following:

Blog.user_class = 'User'

or dummy user class

Blog.user_class = 'Tuberack::DummyUser'

Abilities

Blog has some default abilities

Unauthorized user, user

  • show posts, post, category
  • nothing else

Admin

  • everything

Attributes

On every model can be set different attributes.

Post

  • active - if post isn't active, than can't be accessed by user
  • image - post ilustration
  • categories - can be sorted into multiple categories
  • translations - have multiple translations
    • title - post title
    • locale - post language
    • slug - text in url
    • content type - determinate if is used HTML or Markdown file / Remote md file
    • file - uploader for markdown file, which will be parsed into html
    • remote - link to remote makrdown file, wich will be parsed into html
    • html - input HTML directly, ckeditor is used as default WYSIWYG

Category

  • parent - tree structure of category
  • translations - have multiple translation
    • title - name of translation
    • locale - language of category
    • description - category description

Front-end

Engine provide bootstrap styled view and javascript functions for blog. Just load them in your application.css.sass and application.js.coffee. Plese check requirements.sass/coffee for libraries used in blog engine.

@import blog/app
#= require blog/app

Components

Are parts of application. They can be rendered whatever you want. On each component can specified view. There are list of components and views.

Example
render_cell 'blog/category', :show

Category

  • show - find roots categories
  • by_name - find category by friendly name (slug)

** Views **

  • tree - Show tree of categories, can be used for show

Posts

  • show - show latest posts, take :limit as argument
  • related - show related categories by given :post

blog's People

Contributors

jirikolarik avatar

Watchers

 avatar  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.