This repository has been archived on 2025-08-18. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
plistifier/README
2010-06-12 18:23:33 +02:00

50 lines
1.1 KiB
Text

Plistifier
==========
Adds the ActiveRecord#to_plist and Array#to_plist methods similar to ActiveRecord#to_xml.
The :only, :except, :methods, and :include options are supported.
It too ads the :plist option to the ActiveRecord::Base#render method
Install
=======
script/plugin install git://github.com/jeena/plistifier.git
Example
=======
def index
@posts = Post.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @posts }
format.plist { render :plist => @posts, :only => [:id, :title] }
end
end
def show
@post = Post.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @post }
format.plist { render :plist => @post }
end
end
Thanks
======
This plugin uses Christian Kruses CFPropertyList http://rubyforge.org/projects/cfpropertylist/
to generate Plists.
This plugin started as a copy of http://github.com/chuyeow/jsonifier/ I just changed it to
support and added the CFPropertyList stuff.
Copyright (c) 2010 Jeena Paradies, released under the MIT license