diff --git a/app/controllers/achievements_controller.rb b/app/controllers/achievements_controller.rb index e220540..3e317ca 100644 --- a/app/controllers/achievements_controller.rb +++ b/app/controllers/achievements_controller.rb @@ -36,7 +36,7 @@ def new def create @achievement = current_user.achievements.build(achievement_params) if @achievement.save - redirect_to @achievement, notice: 'Achievement was successfully created.' + redirect_to achievements_path, notice: 'Achievement was successfully created.' else render :new end @@ -49,8 +49,7 @@ def edit def update @achievement = current_user.achievements.find(params[:id]) if @achievement.update(achievement_params) - # After updating, redirect to the show page, not the URL - redirect_to @achievement, notice: 'Achievement was successfully updated.' + redirect_to achievements_path, notice: 'Achievement was successfully updated.' else render :edit end diff --git a/app/controllers/links_controller.rb b/app/controllers/links_controller.rb index 470059a..a629880 100644 --- a/app/controllers/links_controller.rb +++ b/app/controllers/links_controller.rb @@ -37,7 +37,7 @@ def new def create @link = current_user.links.build(link_params) if @link.save - redirect_to @link, notice: 'Link was successfully created.' + redirect_to links_path, notice: 'Link was successfully created.' else render :new end @@ -50,8 +50,7 @@ def edit def update @link = current_user.links.find(params[:id]) if @link.update(link_params) - # After updating, redirect to the show page, not the URL - redirect_to @link, notice: 'Link was successfully updated.' + redirect_to links_path, notice: 'Link was successfully updated.' else render :edit end