From b281f56d11eb37fbfd5236ad51cc050fb883d377 Mon Sep 17 00:00:00 2001 From: Philipp Fischbeck Date: Sun, 1 Feb 2015 11:10:38 +0100 Subject: [PATCH] Redirect to original problem after translation creation --- app/controllers/translations_controller.rb | 2 +- test/controllers/translations_controller_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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