class Menu < ActiveRecord::Base
translates :title
accepts_nested_attributes_for :translations, allow_destroy: true
acts_as_nested_set
belongs_to :page
def self.latest
MenuTranslation.order(:updated_at).last
end
end
module ApplicationHelper
def render_menu(code, partial)
menu = Menu.find_by :code => code
render :partial => partial, :locals => { :menu => menu.children }
end
end
= render_menu("header_menu", "common/menu")