Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix redirect to back #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/controllers/copycat_translations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ def help

def sync
if Copycat.staging_server_endpoint.nil?
redirect_to :back, alert: 'You didn\'t set your source server'
redirect_back fallback_location: copycat_translations_path, alert: 'You didn\'t set your source server'
else
yaml = read_remote_yaml(Copycat.staging_server_endpoint)

if yaml
CopycatTranslation.import_yaml(yaml)
redirect_to :back, notice: "Translations synced from source server"
redirect_back fallback_location: copycat_translations_path, notice: 'Translations synced from source server'
else
redirect_to :back
redirect_back fallback_location: copycat_translations_path
end

end
Expand Down
1 change: 1 addition & 0 deletions app/views/copycat_translations/import_export.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
%a{:href => "http://guides.rubyonrails.org/i18n.html"} I18n conventions
= form_tag 'upload', :multipart => true, :'accept-charset' => 'UTF-8' do
= file_field_tag "file"
= hidden_field_tag :authenticity_token, form_authenticity_token
= submit_tag "Upload"

- unless Copycat.staging_server_endpoint.nil? || Rails.env.staging?
Expand Down