favgroups: add create new option to add to favgroup dialog.

Add option to create a new favgroup when the user opens the Add to
Favgroup dialog and they don't have any favgroups yet.
This commit is contained in:
evazion
2020-01-15 13:18:25 -06:00
parent 1ce628c31f
commit 7d53af64c1
3 changed files with 22 additions and 19 deletions

View File

@@ -21,15 +21,7 @@ class FavoriteGroupsController < ApplicationController
def create
@favorite_group = FavoriteGroup.create(favgroup_params)
respond_with(@favorite_group) do |format|
format.html do
if @favorite_group.errors.any?
render :action => "new"
else
redirect_to favorite_groups_path
end
end
end
respond_with(@favorite_group)
end
def edit