Sha256: ba0a589eb939a7607f3455b5088f07fd97d57444527060091a92a5be5bfaaa25

Contents?: true

Size: 393 Bytes

Versions: 15

Compression:

Stored size: 393 Bytes

Contents

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

  def display
    @categories = ::Category.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/category/form_widget.rb
navi-0.2.0 spec/dummy/app/widgets/menu_editor/category/form_widget.rb
navi-0.1.4 spec/dummy/app/widgets/menu_editor/category/form_widget.rb
navi-0.1.3 spec/dummy/app/widgets/menu_editor/category/form_widget.rb
navi-0.0.17 spec/dummy/app/widgets/menu_editor/category/form_widget.rb
navi-0.0.16 spec/dummy/app/widgets/menu_editor/category/form_widget.rb
navi-0.0.15 spec/dummy/app/widgets/menu_editor/category/form_widget.rb
navi-0.0.14 spec/dummy/app/widgets/menu_editor/category/form_widget.rb
navi-0.0.13 spec/dummy/app/widgets/menu_editor/category/form_widget.rb
navi-0.0.12 spec/dummy/app/widgets/menu_editor/category/form_widget.rb
navi-0.0.11 spec/dummy/app/widgets/menu_editor/category/form_widget.rb
navi-0.0.10 spec/dummy/app/widgets/menu_editor/category/form_widget.rb
navi-0.0.9 spec/dummy/app/widgets/menu_editor/category/form_widget.rb
navi-0.0.6 spec/dummy/app/widgets/menu_editor/category/form_widget.rb
navi-0.0.2 spec/dummy/app/widgets/menu_editor/category/form_widget.rb