Skip to content

Instantly share code, notes, and snippets.

@bfcapell
bfcapell / gist:1601452
Created January 12, 2012 16:31
example ubiquo settings
Settings[:key] = value
Settings[:context][:key] = value
value = Settings[:key]
<%= form.category_selector :color, :include_blank => true %>
# book.rb
belongs_to :author
# author.rb
has_many :books
# book form:
<%= form.relation_selector :authors %>
<%= form.collection_select :sport_id, Sport.all, :id, :name %>
Article.order("published_at desc").limit(10)
Article.find(:all, :order => "published_at desc", :limit => 10)
rake ubiquo:foreach:pull
has_many :books, :translation_shared => true
media_attachment :images, :translation_shared => true
# now equivalent to
has_many :books
media_attachment :images
share_translations_for :books, :images
share_translations_for :books, :authors, :file, :biography
has_many :books, :translation_shared => true
has_many :authors, :translation_shared => true
belongs_to :file, :translation_shared => true
has_one :biography, :translation_shared => true