This project rocks and uses the MIT license.
$ gem install singleton-rails
class AboutPage < ActiveRecord::Base
include ActiveRecord::Singleton
end
RailsAdmin.config do |config|
config.actions do
dashboard
index &RailsAdmin::Config::Actions::SingletonAwareIndex::PATCH
new
export
history_index
bulk_delete
show
edit
delete &RailsAdmin::Config::Actions::SingletonAwareDelete::PATCH
history_show
show_in_app
end
end
class AboutPageController < ApplicationController
def index
@about_page = AboutPage.instance
end
end
Hyper made this. We're a digital communications agency with a passion for good code, and if you're using this library we probably want to hire you.