mirror of
https://github.com/projekteuler/projekteuler.git
synced 2025-12-10 08:46:41 +01:00
Redirect to original problem after translation creation
This commit is contained in:
parent
fb108420b4
commit
b281f56d11
@ -25,7 +25,7 @@ class TranslationsController < ApplicationController
|
|||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @translation.save
|
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 }
|
format.json { render :show, status: :created, location: @translation }
|
||||||
else
|
else
|
||||||
format.html { render :new }
|
format.html { render :new }
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class TranslationsControllerTest < ActionController::TestCase
|
|||||||
post :create, problem_id: 1, translation: @update
|
post :create, problem_id: 1, translation: @update
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_redirected_to translation_path(assigns(:translation))
|
assert_redirected_to problem_path(id: 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "should show translation" do
|
test "should show translation" do
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user