[Nitro] in the skin.rb

Emmanuel Piperakis epiperak at softlab.ece.ntua.gr
Fri Sep 2 03:28:26 EDT 2005


Just in case somebody has the same problem in the future...

In the skin.rb
--------------------
   def projects
     %~
       <div id="secnav_projects">
         <table>
           <tr>
             <td><a href="officers">[[officers]]</a> | </td>
             <td><a href="investments">[[investments]] | </a></td>
             <td><a href="loans">[[loans]]</a> | </td>
             <td><a href="security">[[security]]</a></td>
           </tr>
         </table>
       </div>
     ~
   end

   def render
     %~
       #{doctype}
       <html>
         #{head}
         <body>
           <div id="page">
             #{header}
             #{mainnav}
             <?r if request.path.chop == 'projects' ?>
               #{projects}
             <?r elsif request.path.chop == 'bgroups' ?>
               #{bgroups}
             <?r elsif request.path.chop == 'reports' ?>
               #{reports}
             <?r end ?>
             <div class="main">
               #{content}
             </div>
             #{footer}
           </div>
           #{rendering_errors}
         </body>
       </html>
     ~
   end



> Just found the problem...
> I had to escape # to get request!
> \#{request.path.chop} in the skin.rb gives me what I was searching for...
>
>
>> is it possible to put code like this?
>> 
>>  def render
>>    %~
>>      #{doctype}
>>      <html>
>>        #{head}
>>        <body>
>>          <div id="page">
>>            #{header}
>>            #{mainnav}
>>            #{if @request != nil}
>>              #{if @request.path.chop == 'projects' then  secnav_projects 
>> end}
>>              #{if @request.path.chop == 'bgroups' then  secnav_bgroups end}
>>              #{if @request.path.chop == 'reports' then  secnav_reports end}
>>            #{end}
>>            <div class="main">
>>              #{content}
>>            </div>
>>            #{footer}
>>          </div>
>>          #{rendering_errors}
>>        </body>
>>      </html>
>>    ~
>>  end
>> 
>> I want depending on the fist navigation menu choice to display a second 
>> navigation menu... There must a be a smarter way to do this... Any help?
>> 
>> Emmanouil Piperakis (epiperak at cs.ntua.gr)
>> {To explore is Human, to Create is Devine,
>> To teach is Primal, to Rule is Sin}
>> _______________________________________________
>> Nitro-general mailing list
>> Nitro-general at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/nitro-general
>> 
>
> Emmanouil Piperakis (epiperak at cs.ntua.gr)
> {To explore is Human, to Create is Devine,
> To teach is Primal, to Rule is Sin}
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>

Emmanouil Piperakis (epiperak at cs.ntua.gr)
{To explore is Human, to Create is Devine,
  To teach is Primal, to Rule is Sin}



More information about the Nitro-general mailing list