Sha256: 5d5d3a0f5c9a8051ac52a0aa2924e3d0f484b55a6ba39d358b36b25a9ea6ab99
Contents?: true
Size: 1.6 KB
Versions: 1
Compression:
Stored size: 1.6 KB
Contents
= Sunrise CMS Open source mini content management system for programmers. == Instructions Create new project rails new [PROJECT_NAME] -d mysql -T -m https://raw.github.com/gist/2700424 == Export data === XML, JSON, CSV GET /manage/users/export.xml GET /manage/users/export.csv === JSON GET /manage/users/export.json For more info look at jbuilder https://rubygems.org/gems/jbuilder. === Excel gem "ruby2xlsx", "~> 0.0.1" GET /manage/users/export.xlsx == Usage Just create class: class SunriseProduct < Sunrise::AbstractModel self.resource_name = "Product" list :thumbs do scope { Product.includes(:picture) } preview { lambda { |product| product.picture.try(:url, :thumb) } } field :title field :price field :total_stock end show do field :title field :price field :total_stock field :sort_order field :is_visible end edit do field :title field :price field :total_stock field :notes group :sidebar, :holder => :sidebar do field :sale_limit_id, :collection => lambda { SaleLimit.all }, :include_blank => false field :sort_order field :is_visible, :boolean => true end group :bottom, :holder => :bottom do nested_attributes :variants do field :size field :total_stock field :item_model_id, :collection => lambda { ItemModel.all }, :include_blank => false end field :picture, :as => :uploader end end end Copyright (c) 2012 Fodojo, released under the MIT license
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sunrise-cms-0.4.2 | README.rdoc |