Skip to content

Instantly share code, notes, and snippets.

View deathbob's full-sized avatar

Bob Larrick deathbob

View GitHub Profile
---- config/initializers/to_plist.rb
require 'rails_extensions/plist'
ActiveRecord::Base.class_eval do
include Plist
end
#example with a formatted date and a boolean
xml.instruct!
xml.declare! :DOCTYPE, :plist, :PUBLIC, "-//Apple Computer//DTD PLIST 1.0//EN", "http://www.apple.com/DTDs/PropertyList-1.0.dtd"
xml.plist("version" => 1.0) do |plist|
plist.dict do |wrapper|
@occasions.each do |occasion|
wrapper.key occasion.id
wrapper.dict do |dict|
dict.key 'ccd_remote_id' # required id from the system of record (rails db in this case)
Holy fuck is getting a has_one to work with nested forms a pain in the dick.
useful links if you're working on this http://www.pixellatedvisions.com/2009/03/18/rails-2-3-nested-model-forms-and-nil-new-record
and especially
#
Michał Czyż – February 14, 2009 @ 02:23 PM
i’ve got this same problem, like you Gastón Ramos, when i write something like this:
What is a gist? I dunno but maybe it's like a blog.
Getting rspec set up for my latest project here at INM United. The following applies only to a brand new project, not an upgrade or retrofitting of rspec. Altho it may apply to them too, I just don't know.
required reading -
http://blog.davidchelimsky.net/2007/05/14/an-introduction-to-rspec-part-i/
gem install rspec
gem install rspec-rails
to generate the rspec stuff, cd to your project directory and