diff --git a/app/controllers/recipes_controller.rb b/app/controllers/recipes_controller.rb index ef47f65..97269b3 100644 --- a/app/controllers/recipes_controller.rb +++ b/app/controllers/recipes_controller.rb @@ -31,7 +31,8 @@ def new def create @recipe = Recipe.new(recipe_params) - @recipe.user = current_user + + # @recipe.user_id = current_user if @recipe.save flash[:success] = "Your recipe was created successfully!" redirect_to recipes_path @@ -94,17 +95,17 @@ def set_user # name: , summary: , description: , prep_times: , servings_made: def recipe_params - params.require(:recipe).permit(:name) + # raise recipe_params.inspect - # params.require(:recipe).permit(:id, :user_id, :name, :summary, :description, - # :prep_times, :servings_made, - # :picture, :chef_id, - # style_ids: [], - # ingredients_attributes: [:id, :name, :_destroy], - # # directions_attributes: [:id, :name, :step, :_destroy], - # feed_ids: [], - # calorie_ids: [], - # preptime_ids: []) + params.require(:recipe).permit(:id, :user_id, :name, :summary, :description, + :prep_times, :servings_made, + :picture, :chef_id, + style_ids: [], + ingredients_attributes: [:id, :name, :_destroy], + directions_attributes: [:id, :name, :step, :_destroy], + feed_ids: [], + calorie_ids: [], + preptime_ids: []) end def set_recipe diff --git a/app/views/recipes/index.html.erb b/app/views/recipes/index.html.erb index 93984c0..80e31a9 100644 --- a/app/views/recipes/index.html.erb +++ b/app/views/recipes/index.html.erb @@ -18,7 +18,7 @@