This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit 00b551bc074e886e7c0e3bf89c53d91a4cc4a204
tree 9247527b3bc61b2c565501e679bece4b94536cfa
parent 5a9908e74b60aad6dd95492527605445afc0eb8f
tree 9247527b3bc61b2c565501e679bece4b94536cfa
parent 5a9908e74b60aad6dd95492527605445afc0eb8f
| name | age | message | |
|---|---|---|---|
| |
README | Wed Mar 19 22:13:32 -0700 2008 | [chriseppstein] |
| |
Rakefile | Wed Mar 19 22:13:32 -0700 2008 | [chriseppstein] |
| |
ext/ | Wed Mar 19 23:09:37 -0700 2008 | [chriseppstein] |
| |
init.rb | Mon Apr 21 16:17:11 -0700 2008 | [dustin] |
| |
install.rb | Wed Mar 19 22:13:32 -0700 2008 | [chriseppstein] |
| |
lib/ | Wed Apr 23 21:32:36 -0700 2008 | [dustin] |
| |
tasks/ | Wed Mar 19 22:13:32 -0700 2008 | [chriseppstein] |
| |
test/ | Wed Mar 19 22:13:32 -0700 2008 | [chriseppstein] |
| |
uninstall.rb | Wed Mar 19 22:13:32 -0700 2008 | [chriseppstein] |
README
GibberishDb =========== This plugin adds database support to Gibberish (http://errtheblog.com/posts/55-ya-talkin-gibberish) allowing you to store (and change) your strings in your database. This probably is a bad idea unless you have a copy-editor who is always bugging you to change the text on your website. Strings are cached using acts_as_cached to minimize the database impact. Author:: Chris Eppstein (chris@eppsteins.net) Copyright:: (c) Copyright 2008 Caring, Inc. All Rights Reserved. License:: Released under the same licensing terms as Gibberish == Installation Migrate your database like so: def self.up create_table "languages" do |t| t.column :name, :string, :null => false, :limit => 15, :unique => true end create_table "translations" do |t| t.column :language_id, :integer, :null => false t.column :key, :string, :null => false, :limit => 100 #max length for a column used in an index in mysql t.column :value, :text t.column, :format, :string, :null => false, :default => "inline" end add_index :translations, [:language_id, :key], :name => :one_translation_per_language, :unique => true end def self.down drop_table "languages" drop_table "translations" end Add this to your environment.rb: config.after_initialize do Gibberish.load_languages! rescue nil #if you don't rescue, you'll crash during migrations end == Dependencies * Gibberish (duh!) * acts_as_cached (or cache_fu) == Usage Use is the same as before only the strings will come from your database now. You can now use the following models: * +Gibberish::Language+ * +Gibberish::Translation+ Translation cache is automatically expired after save, but if you add a new language, you'll need to call +Gibberish.load_languages!+ again.




