<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>unorganized.net (Entries tagged as Ruby on Rails)</title>
    <link>http://unorganized.net/blog/</link>
    <description>directly from the brain of Eike Bernhardt</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.5.3 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Ruby on Rails: serialize</title>
    <link>http://unorganized.net/blog/archives/27-Ruby-on-Rails-serialize.html</link>
            <category>Coding</category>
            <category>Ruby on Rails</category>
    
    <comments>http://unorganized.net/blog/archives/27-Ruby-on-Rails-serialize.html#comments</comments>
    <wfw:comment>http://unorganized.net/blog/wfwcomment.php?cid=27</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://unorganized.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=27</wfw:commentRss>
    

    <author>nospam@example.com (Eike Bernhardt)</author>
    <content:encoded>
    &lt;p&gt;Da ich inzwischen immer mehr mit &lt;a href=&quot;http://www.rubyonrails.org/&quot;&gt;Ruby on Rails&lt;/a&gt; arbeite, brauch ich auch hier mal wieder ne Sammelstelle für gute Tips und Ideen .. und Sachen die ich praktisch finde.&lt;/p&gt;&lt;p&gt;Los gehts mit “:serialize”:&lt;/p&gt;

	&lt;p&gt;&lt;pre&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
class User &amp;lt; ActiveRecord::Base
 serialize :preferences&lt;br /&gt;
end&lt;/p&gt;

	&lt;p&gt;user = User.create(:preferences) =&gt; { &amp;#8220;details&amp;#8221; =&gt; &amp;#8220;full&amp;#8221;, &amp;#8220;stylesheet&amp;#8221; =&gt; &amp;#8220;old&amp;#8221; })&lt;br /&gt;
User.find(user.id).preferences # =&gt; { &amp;#8220;details&amp;#8221; =&gt; &amp;#8220;full&amp;#8221;, &amp;#8220;stylesheet&amp;#8221; =&gt; &amp;#8220;old&amp;#8221; }&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;Und mit diesem bischen Code kann man ohne Probleme Arrays oder Hashes oder was man will in User.preferences speichern, für den Programmierer ist es völlig transparent, die komplette “Arbeit” wird einem von RoR abgenommen. Sehr praktisch!&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Tue, 11 Apr 2006 10:58:00 +0200</pubDate>
    <guid isPermaLink="false">http://unorganized.net/blog/archives/27-guid.html</guid>
    <category>Coding</category>
<category>Ruby on Rails</category>

</item>

</channel>
</rss>