diff --git a/app/controllers/translations_controller.rb b/app/controllers/translations_controller.rb index dafd0e3..61aec87 100644 --- a/app/controllers/translations_controller.rb +++ b/app/controllers/translations_controller.rb @@ -25,7 +25,7 @@ class TranslationsController < ApplicationController respond_to do |format| if @translation.save - format.html { redirect_to @translation, notice: t('translations.notice.successfully_created') } + format.html { redirect_to @translation.problem, notice: t('translations.notice.successfully_created') } format.json { render :show, status: :created, location: @translation } else format.html { render :new } diff --git a/test/controllers/translations_controller_test.rb b/test/controllers/translations_controller_test.rb index 41b3e18..df02bcc 100644 --- a/test/controllers/translations_controller_test.rb +++ b/test/controllers/translations_controller_test.rb @@ -25,7 +25,7 @@ class TranslationsControllerTest < ActionController::TestCase post :create, problem_id: 1, translation: @update end - assert_redirected_to translation_path(assigns(:translation)) + assert_redirected_to problem_path(id: 1) end test "should show translation" do