hi all!
I am now reading the recursive menu example and got some problem with the
code below:
------------------------------------------------------------------------------------
@menus[i] = {:indent => allmenus[i].level,
                     :title  => allmenus[i].title,
                     :children_count => allmenus[i].all_children_count,
                     :url  =>  allmenus[i].page ?
allmenus[i].page.whole_url : ''''}
--------------------------------------------------------------------------
but in the database section, I dont see the column definition of
''title'' and ''page'', so is there somthing
missed or
is it my misundstanding?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/betternestedset-talk/attachments/20071008/4c064b19/attachment.html
The title and page are simply example fields.  The page is probably 
a table join like this:
class Menu
    has_one :page
end
... and Page has the property of whole_url.  You will need to modify the 
code to suit your layout.  This threw me for a long time too since I 
started using this plugin when I first started to use Ruby and Rails.   
I suppose the documentation could be a little clearer on the use of 
these variables.
--
Jeremy
leon du wrote:> hi all!
>
> I am now reading the recursive menu example and got some problem with 
> the code below:
>
------------------------------------------------------------------------------------
>
> @menus[i] = {:indent => allmenus[i].level, 
>
>                      :title  => allmenus[i].title,
>                      :children_count => allmenus[i].all_children_count,
>                      :url  =>  allmenus[i].page ?
allmenus[i].page.whole_url : ''''}
>
>
> --------------------------------------------------------------------------
> but in the database section, I dont see the column definition of
''title'' and ''page'', so is there somthing
missed or
>
> is it my misundstanding?
>
>   
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Betternestedset-talk mailing list
> Betternestedset-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/betternestedset-talk
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/betternestedset-talk/attachments/20071008/6a426360/attachment-0001.html
oh... thanks I think a more detailed documentation with the whole source code download link could be better for users. 2007/10/8, Jeremy Nicoll <jnicoll at gnexp.com>:> > The title and page are simply example fields. The page is probably a > table join like this: > > class Menu > has_one :page > end > > ... and Page has the property of whole_url. You will need to modify the > code to suit your layout. This threw me for a long time too since I started > using this plugin when I first started to use Ruby and Rails. I suppose > the documentation could be a little clearer on the use of these variables. > > -- > Jeremy > > > > leon du wrote: > > hi all! > > I am now reading the recursive menu example and got some problem with the > code below: > ------------------------------------------------------------------------------------ > > > @menus[i] = {:indent => allmenus[i].level, > > :title => allmenus[i].title, > :children_count => allmenus[i].all_children_count, > :url => allmenus[i].page ? allmenus[i].page.whole_url : ''''} > > > -------------------------------------------------------------------------- > but in the database section, I dont see the column definition of ''title'' and ''page'', so is there somthing missed or > > is it my misundstanding? > > > ------------------------------ > > _______________________________________________ > Betternestedset-talk mailing list > Betternestedset-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/betternestedset-talk > > > _______________________________________________ > Betternestedset-talk mailing list > Betternestedset-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/betternestedset-talk > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/betternestedset-talk/attachments/20071009/a0c72be5/attachment.html