Topic: Dynamic navigation menu using Menuitem model
Hi all,
I am using this table to store navigation links in db:
class CreateMenuitems < ActiveRecord::Migration
def self.up
create_table :menuitems do |t|
t.column :title, :string, :limit => 100, :null => false
t.column :url, :string, :null => false
t.column :parent_id, :integer, :default => 0
end
enddef self.down
drop_table :menuitems
end
end
Model Menuitem uses ACTS_AS_TREE. What is the best way to render Menuitems in all views (layouts)? Using partial, component rendering or helper?
Thanks!