added documentation about :plist_filename

This commit is contained in:
Jeena Paradies 2010-06-18 17:57:32 +02:00
parent 30931f0384
commit 7a3c754e6b
2 changed files with 13 additions and 4 deletions

11
README
View file

@ -2,7 +2,8 @@ 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.
The :only, :except, :methods, and :include options are supported. Additionally you can use
the :plist_filename option to change the default name for download.
It too ads the :plist option to the ActiveRecord::Base#render method. With help of that
you get binary plist files which you can easy use in your iPhone.
@ -39,6 +40,14 @@ In your PostController use for example:
end
end
def show
@post = Post.find(params[:id])
respond_to do |format|
format.plist { render :plist => @post, :plist_filename => "a-testfile.plist" }
end
end
On the iPhone use for example:
NSURL *url = [NSURL URLWithString:@"http://example.com/posts.plist"];