Sha256: 0c8899f50076ac635691e29da15bbc39aa18050c0bb789b28a38e457c69af68a

Contents?: true

Size: 380 Bytes

Versions: 15

Compression:

Stored size: 380 Bytes

Contents

class MenuEditor::Page::FormWidget < Apotomo::Widget
  responds_to_event :submit

  def display
    @pages = ::Page.scoped
    render
  end

  def submit(event)
    @menu_item = MenuItem.new params[:menu_item]
    if @menu_item.save
      trigger :new_menu_item, :menu_item => @menu_item
      replace :state => :display
    else
      replace :view => :display
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
navi-0.2.1 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.2.0 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.1.4 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.1.3 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.0.17 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.0.16 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.0.15 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.0.14 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.0.13 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.0.12 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.0.11 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.0.10 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.0.9 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.0.6 spec/dummy/app/widgets/menu_editor/page/form_widget.rb
navi-0.0.2 spec/dummy/app/widgets/menu_editor/page/form_widget.rb