diff options
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/menu_items_controller.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/menu_items_controller.rb b/app/controllers/menu_items_controller.rb index b095c8df..8b4e636e 100644 --- a/app/controllers/menu_items_controller.rb +++ b/app/controllers/menu_items_controller.rb | |||
| @@ -19,7 +19,9 @@ class MenuItemsController < ApplicationController | |||
| 19 | end | 19 | end |
| 20 | 20 | ||
| 21 | def create | 21 | def create |
| 22 | if MenuItem.create( menu_item_params ) | 22 | @menu_item = MenuItem.new( menu_item_params ) |
| 23 | |||
| 24 | if @menu_item.save | ||
| 23 | redirect_to menu_items_path | 25 | redirect_to menu_items_path |
| 24 | else | 26 | else |
| 25 | render :new | 27 | render :new |
| @@ -58,6 +60,6 @@ class MenuItemsController < ApplicationController | |||
| 58 | private | 60 | private |
| 59 | 61 | ||
| 60 | def menu_item_params | 62 | def menu_item_params |
| 61 | params.require(:menu_item).permit(:node_id, :path, :position, :type, :title, :type_id) | 63 | params.require(:menu_item).permit(:node_id, :path, :position, :titles => {}) |
| 62 | end | 64 | end |
| 63 | end | 65 | end |
