    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>vaporbase :: make-resourceful and nested polymorphic associations</title>
        <link>http://www.vaporbase.com/</link>
        <description>the knowledge base that almost is</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Vaporbase Admin</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:admin@parkerhill.com" /> 
       <sy:updatePeriod>hourly</sy:updatePeriod> 
       <sy:updateFrequency>1</sy:updateFrequency> 
       <docs>http://backend.userland.com/rss</docs>

<!-- show a header for the current publication type -->
        <h2>Postings</h2>


<div class="xar-mod-head"><span class="xar-mod-title">rails</span></div>

<table border="0" cellpadding="1" cellspacing="0">
<tr>
    <td valign="top">
        Browse in :
   </td>
   <td valign="top">

                                    <a href="http://www.vaporbase.com/postings/">All</a>

                 &gt;                     <a href="http://www.vaporbase.com/postings/c36/">subjects</a>

                 &gt;                     <a href="http://www.vaporbase.com/postings/c42/">rails</a>
<br />
</td>
</tr>
</table>






<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xd</em>
and <em>user-summary-[publicationtype].xd</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles
The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;make-resourceful and nested polymorphic associations</h1>
<p><strong>Author:</strong>&nbsp;linoj</p>
<p>
<strong>Date:</strong> July 01, 2007 12:37:42 PM  or Sun, 01 July 2007 12:37:42 </p>
<p><strong>Summary:</strong>&nbsp;Here's a patch that enables make_resourceful to handle polymorphic resources with nested routes.</p>
<p><strong>Body:</strong>&nbsp;<h2>polymorphic resources<br /></h2><p>A polymorphic model can belong to more than one parent model class. For example, Comments can belong to both Articles and Documents. The Rails idiom for setting this up is like this:</p><p>comments table schema includes:</p><pre>commentable_id:integer</pre><pre>commentable_type:string </pre><p>models/comment.rb contains<br /></p><pre>belongs_to :commentable, :polymorphic =&gt; true</pre><p>then both the models/article.rb and document.rb contains</p><pre>has_many :comments, :as =&gt; :commentable</pre><p>In this way, you can reference article.comments and document.comments for an Article and Document object, respectively. With RESTful resource routes, you can have url&#39;s  and named routes like</p><pre>article_comment_path(@article,@comment) # =&gt; /articles/1/comments/22</pre><pre>article_new_comment_path(@article)     # =&gt; /articles/1/comments/new</pre><h2>make_resourceful</h2><p>The make_resourceful (&quot;mr&quot;) plugin (ver 0.1.0) automatically creates typical RESTful actions in controllers, but does not presently support these associations.</p><p>Although mr supports has_many nested resources (and multiple levels of them at that), it assumes that a child resource has just one kind of parent.</p><p>I&#39;ve submitted this patch to the authors but its not tightly integrated. So if you use this, consider it a temporary patch until the plugin authors integrate it or come up with their own (better) solution.</p><p>Most of the code can be put in application.rb. There are a few other methods that go into the controller for the polymorphic resource. </p><h2>multiple parents</h2><p>Important: When using polymorphic resources, I&#39;ve changed the meaning of <em>parents</em> from the standard mr convention. Normally, mr&#39;s parents is a list of models in a nested resource chain, such as /projects/3/articles/4/comments/5, then parents contains [&quot;project&quot;,&quot;article&quot;]. </p> <p>In the polymorphic case, we can have several alternative parents. Thus, I use <em>parents</em> to represent the list of possible parent resources, one level up. </p><p>This also means that in the polymorphic case, we only handle one level of nesting. That&#39;s not so bad because that&#39;s being strongly recommended by the Rails core team.  See <a href="http://weblog.jamisbuck.org/2007/2/5/nesting-resource">http://weblog.jamisbuck.org/2007/2/5/nesting-resource</a> </p><h2>URL helpers </h2><p>As a sidebar, I want to mention an undocumented feature: mr has a number of very handy URL generator methods, only you need to expose them as helpers to use them in views. They are :object_path, :objects_path, :new_object_path, and :edit_object_path. </p><p>You can use these instead of the built-in RESTful named routes. If your resources are nested the nested paths will be generated. My patch now lets them support polymorphic nesting too. </p><p>I&#39;ve also added a new helper, parent_path, that can be used for example in a &quot;Back&quot; link. Thus, for example:</p><pre>object_path(item) # =&gt; /articles/1/comments/22 <br /></pre><pre>object_path       # assumes current_object </pre><pre>edit_object_path  # =&gt; /articles/1/comments/22/edit</pre><pre>parent_path       # =&gt; /articles/1 </pre><h2>application.rb<br /></h2><p>Add the following to your application.rb to extend the make_resourceful library:<br /></p><p>&nbsp;</p><pre>  # make_resourceful fixes for polymorphic models</pre><pre>  # use this to override parent_objects method </pre><pre>  # def parent_objects</pre><pre>  #   parent_objects_poly</pre><pre>  # end</pre><pre>  def parent_objects_poly</pre><pre>    return [] if parents.empty?</pre><pre>    return @parent_objects if @parent_objects</pre><pre>    # find index of first (and only) non-zero parent_param </pre><pre>    parent_i = parent_params.index( parent_params.find { |el| el != 0 })</pre><pre>    return @parent_objects = [] unless parent_i</pre><pre>    model = parent_models[ parent_i ]</pre><pre>    @parent_objects= [model.find(parent_params[parent_i])]</pre><pre>  end</pre><pre>  </pre><pre>  # parent object helper</pre><pre>  def parent_object</pre><pre>    parent_objects[0] unless parent_objects.empty?</pre><pre>  end</pre><pre>  helper_method(:parent_object)</pre><pre>  </pre><pre>  def parent_path</pre><pre>    send(&quot;#{namespace_prefix}path&quot;, *parent_objects)</pre><pre>  end</pre><pre>  helper_method(:parent_path) </pre><pre>   </pre><pre>  # expose the url methods as helpers</pre><pre>  helper_method(:object_path, :objects_path, :new_object_path, :edit_object_path)</pre><p>&nbsp;</p><p>The first method, <em>parent_objects_poly</em>, is the body of the override of the parent_object method.</p><p>I introduce a new <em>parent_object</em> helper that returns the parent of the current_object. Related to this, I&#39;ve also added a parent_path URL helper.</p><p>The last line exposes the built-in mr URL generators as helpers.</p><p>You can keep this code in application.rb. Normally these will not affect make_resourceful controllers, unless you add the following code to the controller to make it a polymorphic resource.<br /></p><h2>your_controller.rb</h2><p>The second part of the implementation requires adding a few methods to your controller. </p><p>If this part looks a little kludgey, its because I&#39;m trying to avoid editing the plugin code directly, to force the order of method overrides (internally, make_resourceful method calls load_parent_objects in base from kontroller.before_filter).</p><p>&nbsp;</p><pre>  make_resourceful do</pre><pre>    actions: all</pre><pre>  end</pre><pre> </pre><pre>  # add the following to make this controller for a polymorphic resource </pre><pre>  def parents</pre><pre>    <strong>[&quot;article&quot;,&quot;document&quot;] </strong>#this is the only line specific to this resource</pre><pre>  end</pre><pre>  </pre><pre>  def parent_objects</pre><pre>    parent_objects_poly</pre><pre>  end</pre><pre>  </pre><pre>  def namespaces</pre><pre>    parent_i = parent_params.index( parent_params.find { |p| p != 0 })</pre><pre>    [parents[parent_i]]</pre><pre>  end</pre><br /><p>(Note, we do not use the belongs_to declaration, rather we override the parents method directly.)  </p><p>As noted above, <em>parents</em> returns the list of possible parents, one level up. <em>You need to insert your own parents array there.</em><br /></p><p><em>parent_objects</em> is overriden using the body we put in application.rb. It still returns an array, but it will have no more than one element.</p><p>Finally, the internal method for generating namespaces is also overridden for the URL helper methods (again, this didn&#39;t work when I put it in application.rb)</p><p>&nbsp;</p><p>That it. It seems to be working fine for me. I hope it helps you too. </p><p>&nbsp;</p></p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
        <p>Last modified on Aug 01, 2007 2:39:26 AM by <a href="http://www.vaporbase.com/roles/3">linoj</a></p>
        <p>



<div>
   <p class="xar-cm-note xar-sub">
 Note: Comments are owned by the poster. We are not responsible for their content. </p>
</div>
    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="118"></a>
                <form action="http://www.vaporbase.com/?module=comments&amp;func=reply" method="post" class="xar-cm-actions">
                    <div>
                        <input type="hidden" name="header[modid]" value="151" />
                        <input type="hidden" name="header[itemtype]" value="9" />
                        <input type="hidden" name="header[objectid]" value="133" />
                        <input type="hidden" name="header[pid]" value="118" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/make-resourceful_and_nested_polymorphic_associations?&amp;depth=1&amp;order=1&amp;sortby=2&amp;render=flat" />
                        <input type="hidden" name="receipt[returnurl][encoded]" value="http%3A%2F%2Fwww.vaporbase.com%2Fpostings%2Fmake-resourceful_and_nested_polymorphic_associations%3F%26amp%3Bdepth%3D1%26amp%3Border%3D1%26amp%3Bsortby%3D2%26amp%3Brender%3Dflat" />
                        <input type="hidden" name="receipt[action]" value="reply" /> 
                        <input type="submit" name="submit" id="submit-reply118" value="Reply" />
                   </div>
               </form>

                <h4>make-resourceful and nested polymorphic associations</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 September 08, 2007 08:00 PM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                I've given this a good effort and still can't get it to work. Could you show what the routes.rb info should look like for this example?                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=118" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="120"></a>
                <form action="http://www.vaporbase.com/?module=comments&amp;func=reply" method="post" class="xar-cm-actions">
                    <div>
                        <input type="hidden" name="header[modid]" value="151" />
                        <input type="hidden" name="header[itemtype]" value="9" />
                        <input type="hidden" name="header[objectid]" value="133" />
                        <input type="hidden" name="header[pid]" value="120" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/make-resourceful_and_nested_polymorphic_associations?&amp;depth=1&amp;order=1&amp;sortby=2&amp;render=flat" />
                        <input type="hidden" name="receipt[returnurl][encoded]" value="http%3A%2F%2Fwww.vaporbase.com%2Fpostings%2Fmake-resourceful_and_nested_polymorphic_associations%3F%26amp%3Bdepth%3D1%26amp%3Border%3D1%26amp%3Bsortby%3D2%26amp%3Brender%3Dflat" />
                        <input type="hidden" name="receipt[action]" value="reply" /> 
                        <input type="submit" name="submit" id="submit-reply120" value="Reply" />
                   </div>
               </form>

                <h4>make-resourceful and nested polymorphic associations</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     linoj on                 September 15, 2007 12:38 PM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                <p>Thomas, if you're using rails edge, the routes might contain:</p>

<pre>
map.resources :articles, :has_many =&gt; :comments
map.resources :documents, :has_many =&gt; :comments
</pre>

<p>Otherwise, its a bit more verbose,</p>

<pre>
map.resources :articles do |article|
  article.resources :comments, :controller =&gt; &quot;Comments&quot;, :name_prefix =&gt; &quot;articles_&quot;
end
map.resources :documents do |doc|
  doc.resources :comments, :controller =&gt; &quot;Comments&quot;, :name_prefix =&gt; &quot;documents_&quot;
end
</pre>                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=120" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="184"></a>
                <form action="http://www.vaporbase.com/?module=comments&amp;func=reply" method="post" class="xar-cm-actions">
                    <div>
                        <input type="hidden" name="header[modid]" value="151" />
                        <input type="hidden" name="header[itemtype]" value="9" />
                        <input type="hidden" name="header[objectid]" value="133" />
                        <input type="hidden" name="header[pid]" value="184" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/make-resourceful_and_nested_polymorphic_associations?&amp;depth=1&amp;order=1&amp;sortby=2&amp;render=flat" />
                        <input type="hidden" name="receipt[returnurl][encoded]" value="http%3A%2F%2Fwww.vaporbase.com%2Fpostings%2Fmake-resourceful_and_nested_polymorphic_associations%3F%26amp%3Bdepth%3D1%26amp%3Border%3D1%26amp%3Bsortby%3D2%26amp%3Brender%3Dflat" />
                        <input type="hidden" name="receipt[action]" value="reply" /> 
                        <input type="submit" name="submit" id="submit-reply184" value="Reply" />
                   </div>
               </form>

                <h4>make-resourceful and nested polymorphic associations</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 November 13, 2007 11:45 PM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                Hey, Jonathan, great hack! 

I'm wondering why parent_params is returning nil instead of 0 when that given parent is not in the path for a request, using the new m_r release with edge.

I've had to change p != 0 to not p.nil? in both places and it seemed to pull the trick, tho!

Cheers,

Fabio.                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=184" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="671"></a>
                <form action="http://www.vaporbase.com/?module=comments&amp;func=reply" method="post" class="xar-cm-actions">
                    <div>
                        <input type="hidden" name="header[modid]" value="151" />
                        <input type="hidden" name="header[itemtype]" value="9" />
                        <input type="hidden" name="header[objectid]" value="133" />
                        <input type="hidden" name="header[pid]" value="671" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/make-resourceful_and_nested_polymorphic_associations?&amp;depth=1&amp;order=1&amp;sortby=2&amp;render=flat" />
                        <input type="hidden" name="receipt[returnurl][encoded]" value="http%3A%2F%2Fwww.vaporbase.com%2Fpostings%2Fmake-resourceful_and_nested_polymorphic_associations%3F%26amp%3Bdepth%3D1%26amp%3Border%3D1%26amp%3Bsortby%3D2%26amp%3Brender%3Dflat" />
                        <input type="hidden" name="receipt[action]" value="reply" /> 
                        <input type="submit" name="submit" id="submit-reply671" value="Reply" />
                   </div>
               </form>

                <h4>iPhone plastic cases</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 July 22, 2010 03:03 AM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                I just purchased my Iphone 3GS and purchased the bundle (extended warranty and Otterbox case). At first I thought - YUK. You can't see my beautiful Iphone! However, when I read the reviews of some of the cases that allow you to see the Iphone, I noticed they all had shortcomings. Chief among them is the fact that they don't do an effective job of protecting your phone. I've noticted a number of complaints about the holster. Personnally, I've never owned a holter that didn't eventually break at the belt clip, or fall off. I'm not risking dropping my $200 investment! I'l forgo use of the holster and hold my device. <a href="http://www.fashioniphone.com/iphone-cases">iphone case</a>

                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=671" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="674"></a>
                <form action="http://www.vaporbase.com/?module=comments&amp;func=reply" method="post" class="xar-cm-actions">
                    <div>
                        <input type="hidden" name="header[modid]" value="151" />
                        <input type="hidden" name="header[itemtype]" value="9" />
                        <input type="hidden" name="header[objectid]" value="133" />
                        <input type="hidden" name="header[pid]" value="674" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/make-resourceful_and_nested_polymorphic_associations?&amp;depth=1&amp;order=1&amp;sortby=2&amp;render=flat" />
                        <input type="hidden" name="receipt[returnurl][encoded]" value="http%3A%2F%2Fwww.vaporbase.com%2Fpostings%2Fmake-resourceful_and_nested_polymorphic_associations%3F%26amp%3Bdepth%3D1%26amp%3Border%3D1%26amp%3Bsortby%3D2%26amp%3Brender%3Dflat" />
                        <input type="hidden" name="receipt[action]" value="reply" /> 
                        <input type="submit" name="submit" id="submit-reply674" value="Reply" />
                   </div>
               </form>

                <h4>iphone for sale</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 July 22, 2010 03:10 AM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                Another old but useful function of iPhone OS which is unknown to many people is screenshots on all areas with 768 × 1024 resolution ratio. Hold Power and Home for half a second, here is the screen shot. And it is saved at your photo library. When you finally reach the end of a long page and want to return to the top you only need to click on the title . Do you know you can set to preview more than two lines of he e-mail? iPhone also has this option, but it means nothing for its small screen<a href="http://www.fashioniphone.com">iphone deals</a>
                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=674" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

<script type="text/javascript" src="modules/base/xartemplates/includes/submitonce.js"></script>
  <h3>Post a new comment</h3> 
  <form action="http://www.vaporbase.com/?module=comments&amp;func=reply" method="post" name="post" id="post" onSubmit="submitonce(this)" id="post"
 >
   <div class="xar-ib-wrapper xar-accent-outline">
<div class="xar-ib-actionpanel xar-accent">
         <span>
 BBCode Actions             : 
          </span>
          <span>
            <!-- New xaraya style link tag <xar:set name="$stylesheet">xarTplAddStyleLink('bbcode', 'bbcode')</xar:set> -->

<span>
    <input type="button" accesskey="z" name="addbbcode18" value=" p " onclick="bbstyle(18)" onmouseover="document.post.helpbox.value='Paragraph: [p]text[/p] (alt+z)'; return true" />
    <input type="button" accesskey="b" name="addbbcode0" value=" b " style="font-weight:bold;" onclick="bbstyle(0)" onmouseover="document.post.helpbox.value='Bold text: [b]text[/b] (alt+b)'; return true" />
    <input type="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic;" onclick="bbstyle(2)" onmouseover="document.post.helpbox.value='Italic text: [i]text[/i] (alt+i)'; return true" />
    <input type="button" accesskey="u" name="addbbcode4" value=" u " style="font-style: underline;" onclick="bbstyle(4)" onmouseover="document.post.helpbox.value='Underline text: [u]text[/u] (alt+u)'; return true" />
    <input type="button" accesskey="q" name="addbbcode6" value="Quote" onclick="bbstyle(6)" onmouseover="document.post.helpbox.value='Quote text: [quote]text[/quote] (alt+q)'; return true" />
    <input type="button" accesskey="c" name="addbbcode8" value="Code" onclick="bbstyle(8)" onmouseover="document.post.helpbox.value='Code display: [code=xml]code[/code] (alt+c)'; return true" />
    <input type="button" accesskey="p" name="addbbcode14" value="Img" onclick="bbstyle(14)" onmouseover="document.post.helpbox.value='Insert image: [img]http://image_url[/img] (alt+p)'; return true" />
    <input type="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline;" onclick="bbstyle(16)" onmouseover="document.post.helpbox.value='Insert URL: [url]http://url[/url] or [url=http://url]URL text[/url] (alt+w)'; return true" />
</span>
<label for="addbbcode20">
 Font color     :
</label>
<select name="addbbcode20" onchange="bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onmouseover="document.post.helpbox.value='Font color: [color=red]text[/color] Tip: you can also use color=#FF0000'; return true">
   <option style="color:black; background-color: #FAFAFA" value="#444444" class="xar-bbcode-genmed">
 Default </option>
   <option style="color:darkred; background-color: #FAFAFA" value="darkred" class="xar-bbcode-genmed">
 Dark Red </option>
   <option style="color:red; background-color: #FAFAFA" value="red" class="xar-bbcode-genmed">
 Red </option>
   <option style="color:orange; background-color: #FAFAFA" value="orange" class="xar-bbcode-genmed">
 Orange </option>
   <option style="color:brown; background-color: #FAFAFA" value="brown" class="xar-bbcode-genmed">
 Brown </option>
   <option style="color:yellow; background-color: #FAFAFA" value="yellow" class="xar-bbcode-genmed">
 Yellow </option>
   <option style="color:green; background-color: #FAFAFA" value="green" class="xar-bbcode-genmed">
 Green </option>
   <option style="color:olive; background-color: #FAFAFA" value="olive" class="xar-bbcode-genmed">
 Olive </option>
   <option style="color:cyan; background-color: #FAFAFA" value="cyan" class="xar-bbcode-genmed">
 Cyan </option>
   <option style="color:blue; background-color: #FAFAFA" value="blue" class="xar-bbcode-genmed">
 Blue </option>
   <option style="color:darkblue; background-color: #FAFAFA" value="darkblue" class="xar-bbcode-genmed">
 Dark Blue </option>
   <option style="color:indigo; background-color: #FAFAFA" value="indigo" class="xar-bbcode-genmed">
 Indigo </option>
   <option style="color:violet; background-color: #FAFAFA" value="violet" class="xar-bbcode-genmed">
 Violet </option>
   <option style="color:white; background-color: #FAFAFA" value="white" class="xar-bbcode-genmed">
 White </option>
   <option style="color:black; background-color: #FAFAFA" value="black" class="xar-bbcode-genmed">
 Black </option>
</select>
<label for="addbbcode22">
 Font size     :
</label>
<select name="addbbcode22" onchange="bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onmouseover="document.post.helpbox.value='Font size: [size=x-small]small text[/size]'; return true">
   <option value="7" class="xar-bbcode-genmed">
 Tiny </option>
   <option value="9" class="xar-bbcode-genmed">
 Small </option>
   <option value="12" selected="selected" class="xar-bbcode-genmed">
 Normal </option>
   <option value="18" class="xar-bbcode-genmed">
 Large </option>
   <option value="24" class="xar-bbcode-genmed">
 Huge     </option>
</select>
<a href="javascript:bbstyle(-1)" class="xar-bbcode-genmed" onmouseover="document.post.helpbox.value='Close all open bbCode tags'; return true">Close Tags</a>
<span class="gensmall">
    <input type="text" name="helpbox" size="50" maxlength="100" class="helpline" value="Tip: Styles can be applied quickly to selected text." />
</span>         </span>
       </div>
       <div class="xar-ib-leftpanelshort">
         <p>
 Name :
              Anonymous</p>
         <label for="package-title">
 Title: </label>
            <input class="xar-ib-field" type="text" name="package[title]" id="package-title" value="make-resourceful and nested polymorphic associations" tabindex="1" />
         <label for="package-text">
 Comment: </label>
<textarea class="xar-ib-fieldtext" name="package[text]" id="package-text" tabindex="2"></textarea>

          <input type="hidden" name="header[modid]" id="header-modid" value="151" /> 
          <input type="hidden" name="header[objectid]" id="header-objectid" value="133" /> 
          <input type="hidden" name="header[itemtype]" id="header-itemtype" value="9" />
<input type="hidden" name="header[pid]" id="header-pid" value="0" />
          <input type="hidden" name="receipt[returnurl][decoded]" id="receipt-returnurl-decoded" value="http://www.vaporbase.com/postings/make-resourceful_and_nested_polymorphic_associations?&amp;depth=1&amp;order=1&amp;sortby=2&amp;render=flat" />
          <!--<input type="hidden" name="receipt[returnurl][encoded]" id="receipt-returnurl-encoded" value="#$receipt['returnurl']['encoded']#" />-->
          <input type="hidden" name="receipt[action]" id="receipt-action" /> 
          <input type="submit" id="receipt-action-preview" onclick="document.getElementById('receipt-action').value='preview'" value="Preview" /> 
          <input type="submit" id="receipt-action-submit" onclick="document.getElementById('receipt-action').value='submit'" value="Submit" />
       </div>
</div>
 </form>
</p>
        <p></p>
        <p><br/>
<b>Keywords :</b>
<div style="margin-left: 1em; margin-right: 1em; text-align:left;">
    <li><a href="http://www.vaporbase.com/keywords/make_resourceful/">make_resourceful</a></li>
    <li><a href="http://www.vaporbase.com/keywords/polymorphic/">polymorphic</a></li>
</div>
<br/>

</p>
</div>
   </channel>
</rss>
