A collection of Ruby on Rails mixins and generators, an administration framework. Contains some basic models so that you don't have to make them for every website you create. Consists mostly of:
Folio::Pagemodel for individual web pages, consisting of content parts called
- Administration in
Folio::Accountadministrators with a simple generator to add custom models.
- User management for
bundle exec rails app:folio:prepare_dummy_app.
Add this line to your application's Gemfile:
gem 'folio', github: 'sinfin/folio'
And then execute:
$ rails generate folio:install
which will copy bunch of things into your, hopefully clean, app
Then run migrations
$ rails db:migrate
Then You can seed some pages and sites
$ rails db:seed
Folio is build on philosophy "You can have it, if You want, but it is not required." So for example, You can build CMS pages bysed on Atoms, but they are not added during installation of gem. You have to add them for Yourself (see Github Wiki). Take a look to, not only Folio, handy generators by
$ rails g
Due usage of
dragonfly_libvips gem from on-fly processing images, You need to have installed
gifsicle on your system.
If you want to analyse and store all Exif & IPTC data from uploaded Image files you have to install ExifTool (https://www.sno.phy.queensu.ca/~phil/exiftool/index.html).
sudo apt install exiftool
brew install exiftool
Every uploaded file will be processed and all the metadata will be saved
For a manual analysis of a file call
rake folio:file:metadata for batch processing of already downloaded but not
Easily scaffold console controller and views for existing models.
$ rails generate folio:console:scaffold ModelName
Then add correct routes to
scope module: :folio do namespace :console do ... resources :model_names ... end end
and update Folio console config (
config/initializers/folio.rb) to see this
ModelName in console menu
Rails.application.config.folio_console_sidebar_link_class_names = [ %w[ ... ModelName ], %w[...] ....
If class responds to
:console_sidebar_count, such number is displayed in Folio console sidebar
If aasm event have option
confirm, confirmation alert is displayed in change (in Foio console). You can pass
t("folio.console.confirmation")) or string
event :pay, confirm: "Do You really want to pay this" do ... end
Some Oauth providers (eg. apple) requires HTTPS for callback. Set
/etc/hosts) and start
test/dummyapp as in ssl mode by
rails s -b 'ssl://dev.dummy.cz:3000?key=./certificates/dev.dummy.cz.key&cert=./certificates/dev.dummy.cz.crt'. And set callbacks tohttps://dev.dummy.cz:3000/users/auth/apple/callback`
Folio::Auditedin model requires also setting routes in console
scope module: :folio do namespace :console do resources :x do member do get :revision, path: "revision/:version" post :restore, path: "restore/:version" end end end end
Clone & setup
git clone email@example.com:sinfin/folio.git cd folio bundle install bin/rails db:setup
The gem is available as open source under the terms of the MIT License.