Sha256: dd55021e07caf330678e8b4789b200a43daa06a01932308cba759656cef847a2

Contents?: true

Size: 984 Bytes

Versions: 4

Compression:

Stored size: 984 Bytes

Contents

== Acts as published

Gives you a boolean reader/writer for a published_at (timestamp) column.

== Installation

Add it to your Gemfile:

  gem 'acts_as_published'
  
Install your bundle:

  > bundle install
  
== Usage

You need a published_at:timestamp column

In your model:

  class Post < ActiveRecord::Base
    # acts as published
    include ActsAsPublished::ActiveRecord
    acts_as_published
    
    # ...
  end  

== ActiveAdmin integration

  ActiveAdmin.register Post do
    form do |f|
      f.inputs do
        f.input :title
        # ...    
        f.input :published, :as => :boolean
        # ...    
      end
    end

    index do
      column :title
      # ...
      acts_as_published_columns
      # ...
    end

    show do
      attributes_table do
        row :title
        # ...
        acts_as_published_rows
        # ...
      end
    end  
  end if defined?(ActiveAdmin)
  
== Scopes

You get following scopes:

  Post.published
  Post.unpublished  

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
acts_as_published-1.1.0 README.rdoc
acts_as_published-1.0.3 README.rdoc
acts_as_published-1.0.2 README.rdoc
acts_as_published-1.0.1 README.rdoc