    <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 :: A Micro-CMS in Rails</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;A Micro-CMS in Rails</h1>
<p><strong>Author:</strong>&nbsp;linoj</p>
<p>
<strong>Date:</strong> March 25, 2007 6:50:37 PM  or Sun, 25 March 2007 18:50:37 </p>
<p><strong>Summary:</strong>&nbsp;Here's a quick tutorial that builds a little page manager for Rails apps, which can be used for About pages and such. Lets you arrange pages in a hierarchy, and change the order position. Includes a little side menu.</p>
<p><strong>Body:</strong>&nbsp;<h2>Get Started</h2><p> To get started generate your Rails app and database, if you haven&#39;t already, something like this:<br /></p><pre>$ rails myapp</pre><pre>$ cd myapp </pre><pre>$ mysqladmin -u root -p create myapp_development </pre><p>Edit config/database.yml as needed, e.g. add your password, and then test the db connection (the db:migrate does nothing yet but should not generate any errors):</p><pre>$ rake db:migrate</pre><h2>Create Pages Resource</h2><p>We&#39;ll start with the RESTful resource scaffold, and define the model as an ordered list (position field), and a tree (parent_id foreign key references the same table). </p><pre>$ script/generate scaffold_resource page name:string title:string body:text updated_on:date parent_id:integer position:integer </pre><pre>$ rake db:migrate </pre><p> Edit app/models/page.rb, add the following:</p><pre>acts_as_tree :order =&gt; :position</pre><pre>acts_as_list :scope =&gt; :parent_id </pre><p>Replace app/views/pages/show.rhtml with something like the following:</p><pre>&lt;h1&gt;&lt;%= @page.title %&gt;&lt;/h1&gt;</pre><pre>&lt;div&gt;</pre><pre>    &lt;%= @page.body %&gt;</pre><pre>&lt;/div&gt;</pre><br /><h2>Create Some Example Pages</h2><p>Link to <a href="http://0.0.0.0:3000/pages," target="_blank">http://0.0.0.0:3000/pages,</a> and add pages such as the following (only need to fill out these fields, leave the others blank/default):<br /> </p><blockquote><p>Name: about<br />Title: About Us<br />Body: This is the About page.</p><p>Name: contact<br />Title: Contact Us<br />Body: This is the Contact us page.</p><p>Name: privacy<br />Title: Privacy Policy<br />Body: This is the privacy policy page.</p><p>Name: history<br />Title: Our History<br />Body: This page describes our history.</p></blockquote><p>Check results by linking to <a href="http://0.0.0.0:3000/pages/1" target="_blank">http://0.0.0.0:3000/pages/1</a> , /2 , etc. </p><h2>Route to Page by Name</h2><p>Numbers are ugly in a url so lets use the page name for id instead, so we can link to <a href="http://0.0.0.0:3000/pages/about" target="_blank">http://0.0.0.0:3000/pages/about</a> , /contact , etc. <br /></p><p>Edit app/controllers/pages_controllers.rb, change the beginning of def show to:</p><pre>def show<br />  @page = Page.find_by_name(params[:id])  # GET/pages/name<br />  @page ||= Page.find(params[:id]) # GET/pages/id</pre><p>If you want to go even further, and avoid the /pages/name so you can go to <a href="http://mysite.com/about" target="_blank">http://mysite.com/about</a> or even about.html, add this to routes.rb:</p><pre># any named page<br />map.connect &quot;:id&quot;, :controller =&gt; &quot;pages&quot;, :action =&gt; &quot;show&quot;<br />map.connect &quot;:id.html&quot;, :controller =&gt; &quot;pages&quot;, :action =&gt; &quot;show&quot;</pre><h2>Handle Bad Page ID&#39;s</h2><p>If you specify an unknown page id in the url (whether id number or name), you get a Rails error page. Lets handle that as a 404 exception in the <em>show</em> action,</p><pre>def show<br />  <strong>begin</strong><br />    @page = Page.find_by_name(params[:id])  # GET/pages/name<br />    @page ||= Page.find(params[:id])<br />  <strong>rescue<br />    redirect_to_url &quot;/404.html&quot;<br />  else</strong><br />     ...</pre><pre>  <strong>end</strong> </pre><pre>end </pre><p>If you don&#39;t want to lose the layout, you could create a page named &quot;404error&quot; (for example) with the &quot;not found&quot; message (then dont need that else clause):<br /></p><pre>  <strong>rescue<br />    @page = Page.find_by_name(&#39;404error&#39;)<br />  end</strong><br />  ...</pre><h2>Make a Layout (with Side Menu)<br /> </h2> <p>You might want to make a nicer page layout, if you don&#39;t have one. The main point here is to add &lt;%= yield :sidemenu %&gt; that we&#39;ll use next. If you&#39;re starting from scratch try this: edit views/layouts/pages.rhtml as follows:</p> <p>In the &lt;head&gt; section replace the &lt;title&gt; tag with:</p> <pre>&lt;title&gt;&lt;%= (@page.nil? || @page.title.nil?) ? &quot;My Site&quot; : @page.title %&gt;&lt;/title&gt;</pre><pre> </pre> <p>And replace the default &lt;body&gt; section with this (using inline styles to simplify this tutorial):</p> <pre>&lt;body style=&quot;background-color:#ddd&quot;&gt;</pre> <pre>  &lt;div style=&quot;min-height:600px; margin:0 20px; background-color:white&quot;&gt;</pre> <pre>    &lt;div style=&quot;height:80px; background-color:#88A; text-align:center; padding:1em&quot;&gt;</pre> <pre>      &lt;h1&gt;Welcome to My Site&lt;/h1&gt;</pre> <pre>    &lt;/div&gt;</pre> <pre>    &lt;div&gt;</pre> <pre>      &lt;div style=&quot;float:left; background-color:#888&quot;&gt;</pre> <pre>        &lt;%= yield :sidemenu %&gt;</pre> <pre>      &lt;/div&gt;</pre> <pre>      &lt;div style=&quot;margin-left:150px&quot;&gt;</pre> <pre>        &lt;p style=&quot;color: green&quot;&gt;&lt;%= flash[:notice] %&gt;&lt;/p&gt;</pre> <pre>        &lt;%= yield :layout %&gt;</pre> <pre>      &lt;/div&gt;</pre> <pre>    &lt;/div&gt;</pre> <pre>  &lt;/div&gt;</pre> <pre>&lt;/body&gt;</pre> <h2>Add Side Menu</h2><p>Now we&#39;ll add a side menu containing all the pages, in proper position (we&#39;ll let you edit the position next). </p><p>In pages_controller.rb, in def show add the following line </p><pre>  def show<br />    @page = Page.find_by_name(params[:id])  # GET/pages/name<br />    @page ||= Page.find(params[:id])<br />    <strong>@pages = Page.find( :all, :order =&gt; :position)</strong></pre><p>Add to views/pages/show.rhtml:</p><pre>  &lt;% content_for(:sidemenu) do %&gt; <br />    &lt;h3&gt;Pages:&lt;/h3&gt;<br />    &lt;ul&gt;<br />      &lt;% for item in @pages %&gt;<br />        &lt;li&gt;&lt;%= link_to item.title, page_url(:id =&gt; item.name)  %&gt;&lt;/li&gt;<br />      &lt;% end %&gt;<br />    &lt;/ul&gt;<br />  &lt;% end %&gt;<br /> </pre><p>Now when you view a page, the menu of all pages appears on the left.<br /></p><h2>Edit Page Positions </h2><p>Next we let you modify the relative position of pages in the index list, by adding &quot;up&quot; and &quot;down&quot; links, with RESTful syntax like /pages/1;higher and /pages/1;lower. <br /></p><p>Edit pages_controller.rb, add the following actions:</p><p>&nbsp;</p><pre># PUT /pages/1;higher<br />def higher<br />  page = Page.find(params[:id])<br />  unless page.nil?<br />    if page.first?<br />      page.move_to_bottom<br />    else<br />      page.move_higher<br />    end<br />  end<br />  redirect_to pages_url<br />end<br /><br /># PUT /pages/1;lower<br />def lower<br />  page = Page.find(params[:id])<br />  unless page.nil?<br />    if page.last?<br />      page.move_to_top<br />    else<br />      page.move_lower<br />    end<br />  end<br />  redirect_to pages_url<br />end <br /></pre><p>In pages_controller, to sort the index list by position, change first line of def index to</p><pre>@pages = Page.find(:all<strong>, :order =&gt; :position</strong>) </pre><p>Edit routes.rb, add custom actions:</p><pre>map.resources :pages<strong>,<br />              :member =&gt; { :higher =&gt; :put,<br />                           :lower =&gt; :put }</strong> </pre><p>Edit views/pages/index.rhtml, replace position cell:</p><pre>&lt;td&gt;&lt;%=h page.position %&gt;&lt;/td&gt; </pre><p> with:</p><pre>&lt;td&gt;<br />  &lt;%=h page.position %&gt;<br />  &lt;%= link_to &#39;Up&#39;, higher_page_path(page), :method =&gt; :put %&gt;<br />  &lt;%= link_to &#39;Dn&#39;, lower_page_path(page), :method =&gt; :put %&gt;<br /> &lt;/td&gt; </pre><h2>Edit and Show Tree Hierarchy</h2><p>Initially, we already defined acts_as_tree in the model. Now lets use it.</p><p>Edit view/pages/edit.rhtml, for the &quot;parent&quot; field, replace  </p><pre>&lt;%= f.text_field :parent_id %&gt;</pre><p> with</p><pre>&lt;%= select(&quot;page&quot;, &quot;parent_id&quot;, Page.find(:all).collect {|p| [ p.name, p.id ] }, { :include_blank =&gt; true } ) %&gt;</pre><p>Link to /pages and edit the examples pages &quot;history&quot; and &quot;contact&quot; so both have the &quot;about&quot; page as their parent.</p><p>Wouldn&#39;t it be nice to show the pages hierarchy in the index list? Unfortunately I haven&#39;t found an easy way to sort the pages as parent1, child1a, child1b, parent2, child2a, etc. So instead we&#39;ll use partials and recursively show the children.</p><p>To start, the index action will only pass the list of root pages to the template. So change the first line of def index as follows:</p><pre>  def index<br />    @pages = Page.find( :all, <strong>:conditions =&gt; [&#39;parent_id IS NULL&#39;],</strong> :order =&gt; :position )<br /></pre><p>Edit views/pages/index.rhtml and replace the entire &lt;% for page in @pages %&gt; ... &lt;% end%&gt; loop with this line:</p><pre>&lt;%= render(:partial =&gt; &quot;index_item&quot;, :collection =&gt; @pages )%&gt;<br /></pre><p>Then create a file views/pages/_index_item.rhtml with the following:</p><pre>&lt;tr&gt;<br />  &lt;td&gt;<br />    <strong>&lt;%= prefix ||= nil %&gt;</strong><br />    &lt;%=h index_item.name %&gt;<br />  &lt;/td&gt;<br />  &lt;td&gt;&lt;%=h index_item.title %&gt;&lt;/td&gt;<br />  &lt;td&gt;&lt;%=h index_item.body %&gt;&lt;/td&gt;<br />  &lt;td&gt;&lt;%=h index_item.updated_on %&gt;&lt;/td&gt;<br />  &lt;td&gt;&lt;%=h index_item.parent_id %&gt;&lt;/td&gt;<br />  &lt;td&gt;<br />    &lt;%=h index_item.position %&gt;<br />    &lt;%= link_to &#39;Up&#39;, higher_page_path(index_item), :method =&gt; :put %&gt;<br />    &lt;%= link_to &#39;Dn&#39;, lower_page_path(index_item), :method =&gt; :put %&gt;<br />  &lt;/td&gt;<br />  &lt;td&gt;&lt;%= link_to &#39;Show&#39;, page_path(index_item) %&gt;&lt;/td&gt;<br />  &lt;td&gt;&lt;%= link_to &#39;Edit&#39;, edit_page_path(index_item) %&gt;&lt;/td&gt;<br />  &lt;td&gt;&lt;%= link_to &#39;Destroy&#39;, page_path(index_item), :confirm =&gt; &#39;Are you sure?&#39;, :method =&gt; :delete %&gt;&lt;/td&gt;<br />&lt;/tr&gt;<br /><strong>&lt;% unless index_item.children.nil? %&gt;<br />&lt;%= render(:partial =&gt; &quot;index_item&quot;, :collection =&gt; index_item.children, :locals =&gt; {:prefix =&gt; &#39;|--&#39;} )%&gt;<br />&lt;% end %&gt; </strong></pre><p>Changes from the index.rhtml are highlighted. Note the recursive trick here, after a root page row is output, if the page has children then we call the same partial for the children. But in that case, we append a prefix &quot;|--&quot; a crude way of showing the tree graph.</p><p>&nbsp;</p><div style="text-align: center"><img style="width: 359px; height: 215px" src="var/uploads/Image/tutpages2.jpg" alt=" " width="359" height="215" /> </div><h2>Modified Side Menu</h2><p>The left side menu still shows all the pages. Lets change it to show the root pages, and current section pages separately.</p><p>In pages_controller.rb, in the show action, change the @pages= assignment, to: </p><pre>@pages = Page.find( :all, <strong>:conditions =&gt; [&#39;parent_id IS NULL&#39;],</strong> :order =&gt; :position ) </pre><p> and add this line after it,</p><pre>@relatives = @page.relatives</pre><p>And then edit models/page.rb to return the list of relatives (this page, uncles, and children):</p><pre>  def relatives<br />    c = parent.nil? ? [self] : [parent] + parent.children<br />    c += children<br />  end<br /> </pre><p>In views/pages/show.rhtml, add this to the &lt;% content_for(:sidemenu) do %&gt; block:</p><pre>  &lt;% unless @relatives.nil? || @relatives.size &lt;= 1 %&gt;<br />    &lt;h3&gt;In This Section:&lt;/h3&gt;<br />    &lt;ul&gt;<br />      &lt;% for item in @relatives %&gt;<br />        &lt;li&gt;&lt;%= link_to item.title, page_url(:id =&gt; item.name)  %&gt;&lt;/li&gt;<br />      &lt;% end %&gt;<br />    &lt;/ul&gt;<br />  &lt;% end %&gt;<br /></pre><p>&nbsp;</p><div style="text-align: center"><img style="width: 312px; height: 355px" src="var/uploads/Image/tutpages.jpg" alt=" " width="312" height="355" /></div> <br /><h2>Other Stuff </h2><p>You&#39;ll want to improve this, and adapt it to your own application. For instance, the side menu might be nested menu instead.  You might also want to add a WYSIWYG editor for the page body, or some other markup. Naturally, you&#39;ll want to add some authentication so visitors only access the show action, while administrators can create, update, and delete pages.</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 Apr 23, 2007 10:38:39 PM 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="58"></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="109" />
                        <input type="hidden" name="header[pid]" value="58" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply58" value="Reply" />
                   </div>
               </form>

                <h4>A Micro-CMS in Rails</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 March 28, 2007 04:28 AM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                Change
@section = @page.relatives 

to
@relatives = @page.relatives

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

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="59"></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="109" />
                        <input type="hidden" name="header[pid]" value="59" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply59" value="Reply" />
                   </div>
               </form>

                <h4>Re: A Micro-CMS in Rails</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     linoj on                 March 28, 2007 08:24 AM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                oops, right. Fixed it in the article. thx.
It makes you think though, which would be more semantically correct, to name the variable &quot;relatives&quot; or &quot;section&quot;? :)
                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=59" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="74"></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="109" />
                        <input type="hidden" name="header[pid]" value="74" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply74" value="Reply" />
                   </div>
               </form>

                <h4>A Micro-CMS in Rails</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 April 26, 2007 03:53 AM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                nice tutorial. ;p                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=74" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="150"></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="109" />
                        <input type="hidden" name="header[pid]" value="150" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply150" value="Reply" />
                   </div>
               </form>

                <h4>A Micro-CMS in Rails</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 October 06, 2007 08:53 PM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                What about urls? Have you been able to reflect the hierarchy in the url as well? Ex: parent/child/grand-child                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=150" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="151"></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="109" />
                        <input type="hidden" name="header[pid]" value="151" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply151" value="Reply" />
                   </div>
               </form>

                <h4>A Micro-CMS in Rails</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     linoj on                 October 07, 2007 09:50 AM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                Arik, good question. I havent tried it myself, but I'd probably route to the top level page, and permit optional level2 and level3 names as params, something like  /:id/:level2/:level3 . Then in the show action, find the child of params[:id] with name params[:level2], and find the child of level2 with name params[:level3]. According to the Agile book (2nd edition- may'07, p 401) in routes.rb, you can add :level2 =&gt; nil, :level3 =&gt; nil to map.connect to make them optional.                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=151" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="155"></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="109" />
                        <input type="hidden" name="header[pid]" value="155" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply155" value="Reply" />
                   </div>
               </form>

                <h4>A Micro-CMS in Rails</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     linoj on                 October 11, 2007 09:40 PM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                fyi, there are follow up articles here too
<a href="http://www.vaporbase.com/postings/Micro-CMS%3A_Page_Content_using_Model_Methods" target="_blank">http://www.vaporbase.com/postings/Micro-CMS%3A_Page_Content_using_Model_Methods</a>
and
<a href="http://www.vaporbase.com/postings/Enhancements_to_Micro-CMS" target="_blank">http://www.vaporbase.com/postings/Enhancements_to_Micro-CMS</a>                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=155" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="280"></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="109" />
                        <input type="hidden" name="header[pid]" value="280" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply280" value="Reply" />
                   </div>
               </form>

                <h4>A Micro-CMS in Rails</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 January 01, 2008 10:39 PM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                For rails 2.0

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

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="281"></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="109" />
                        <input type="hidden" name="header[pid]" value="281" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply281" value="Reply" />
                   </div>
               </form>

                <h4>A Micro-CMS in Rails</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 January 02, 2008 01:50 AM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                OOPs I meant 
script/generate scaffold Page name:string title:string body:text parent_id:integer position:integer 

I also added some constraints for not null title and name.

How hard would this be to change to add arbitrary routes from the same controller (i.e. /pages/page /articles/page etc.)

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

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="379"></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="109" />
                        <input type="hidden" name="header[pid]" value="379" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply379" value="Reply" />
                   </div>
               </form>

                <h4>A Micro-CMS in Rails</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 April 25, 2008 06:15 PM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                Wonderful - a complete newbie and you have made me understand everything!
One question/help needed: my &quot;up&quot; and &quot;dn&quot; links do not seem to work - I get the following error......

Unknown action

No action responded to higher

-----

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

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="380"></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="109" />
                        <input type="hidden" name="header[pid]" value="380" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply380" value="Reply" />
                   </div>
               </form>

                <h4>A Micro-CMS in Rails</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 April 25, 2008 06:23 PM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                Sorry!!! My fault - I was missing the last &quot;end&quot; in the pages_controller.rb                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=380" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="432"></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="109" />
                        <input type="hidden" name="header[pid]" value="432" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply432" value="Reply" />
                   </div>
               </form>

                <h4>showing hierarchy</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 August 23, 2008 07:17 PM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                1) Thank you for this awesome walkthrough/tutorial/example set!

2) One limitation of the acts_as_free design here is that it only shows one level of hierarchy (no matter now many levels you have).

Here's a three-line block that fixes this: it replaces a two-line block in _index_item.rhtml - the middle line is the new one. (May be an easier way to do it - I made it more explanatory.)

&lt;% unless index_item.children.nil? %&gt;
&lt;% if (prefix.nil?) then prefix = '|--' else prefix = prefix + '|--' end %&gt;
&lt;%= render(:partial =&gt; &quot;index_item&quot;, :collection =&gt; index_item.children, :locals =&gt; {:prefix =&gt; prefix} )%&gt;
                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=432" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="460"></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="109" />
                        <input type="hidden" name="header[pid]" value="460" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply460" value="Reply" />
                   </div>
               </form>

                <h4>Performance issues</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 September 23, 2008 12:37 AM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                It's worth noting that this code does a single SQL query for every page (to see if it has children). This makes rendering the page list very slow.

It would make sense to create an array at the top with all of the pages with children, and check that, rather than doing the index_item.children.nil? check on every line in the recursion. If I do this, I'll provide the code.                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=460" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="461"></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="109" />
                        <input type="hidden" name="header[pid]" value="461" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply461" value="Reply" />
                   </div>
               </form>

                <h4>Performance Improvement</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 September 26, 2008 11:03 AM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                FYI, as above, I've posted code for reducing the number of SQL queries and massively speeding up the page. It's at <a href="http://scottru.com/2008/09/26/vaporbase-micro-cms-performance-improvement/" target="_blank">http://scottru.com/2008/09/26/vaporbase-micro-cms-performance-improvement/</a> .

Again, thanks for the great work!                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=461" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="545"></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="109" />
                        <input type="hidden" name="header[pid]" value="545" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply545" value="Reply" />
                   </div>
               </form>

                <h4>A Micro-CMS in Rails</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 February 26, 2009 06:38 AM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                Hi dude..
Im having a doubt..
just like in windows environment when we open mycomputer (windows+E) it will display in frame format, in left side there will be tree with folders.
when we click on that &quot;+&quot; symbol, it changes to &quot;-&quot; and then a tree will be displayed right?
can we get the same &quot;+&quot; and &quot;-&quot; thing in ruby??????
when we click &quot;+&quot;, then only we must get the sub folders of that folder??, if we can do please mail me at mca.jayanth [at] gmail.com   :::::::: replace [at] with @::::::::::

pls make this clarified.

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

       </div>

</div>

    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="680"></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="109" />
                        <input type="hidden" name="header[pid]" value="680" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/A_Micro-CMS_in_Rails?&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%2FA_Micro-CMS_in_Rails%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-reply680" value="Reply" />
                   </div>
               </form>

                <h4>A Micro-CMS in Rails</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 July 30, 2010 05:41 AM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                In my page's model, i have a column 'private'
in  the page relatives method, how find childrens only column private = 0 ?
Thks                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=680" 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="A Micro-CMS in Rails" 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="109" /> 
          <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/A_Micro-CMS_in_Rails?&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/acts_as_list/">acts_as_list</a></li>
    <li><a href="http://www.vaporbase.com/keywords/acts_as_tree/">acts_as_tree</a></li>
    <li><a href="http://www.vaporbase.com/keywords/cms/">cms</a></li>
    <li><a href="http://www.vaporbase.com/keywords/partial/">partial</a></li>
</div>
<br/>

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