Project

ds-kitsune

0.0
No commit activity in last 3 years
No release in over 3 years
Integrated Rails Content Management System.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 2.2.12
~> 2.3.11
 Project Readme

Kitsune: A drop in Rails CMS

Setup

$ gem install kitsune --source http://gems.github.com

$ script/generate kitsune --include-page-model

Other options supported:
--without-page-model Exclude Page Model
--without-user-model Exclude User Model
--versioned Setup versioning for ActiveRecord, will need vestal_versions preinstalled

$ rake db:migrate

$ script/server

Then go to:
http://localhost:3000/admin/kitsune
Lo and behold, admin UI is automatically created for all models defined in the rails application.

Usage

Cherry pick from the commands below to add functionality to the admin interface:
display, edit, display_and_edit, no_menu, name, category, order_by, disable,sortable, file, image, multipart, select, string, text, sit, no_edit

Example Model

@class Product < ActiveRecord::Base
  has_and_belongs_to_many :product_categories
  has_many :product_photos
  has_many :voltage_ratings

  admin do
    display_and_edit :short_name
    edit :long_name, :product_category_ids, :description, :overview, :features, :order
    wysiwyg :description
    wysiwyg :overview
    wysiwyg :features
    collection_select :product_category_ids, ProductCategory.all, :id, :title, {:include_blank => true}, {:multiple => true}
  end

  def self.search_results(keywords)
    Product.all(:conditions => ["(products.short_name like :search or products.long_name like :search or products.description like :search)", {:search => "%#{keywords}%"}])
  end

  def to_param
    "#{id}-#{short_name.gsub(/[^a-z0-9]+/i, '-')}"
  end
end@

And that is how you do it.