Skip to content

Commit

Permalink
Fix flash message generation on restful redirect controller errors
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Aug 28, 2018
1 parent 747c3a1 commit d592c21
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/controllers/restful_redirect_controller.rb
@@ -1,4 +1,6 @@
class RestfulRedirectController < ApplicationController
before_action :check_privileges

def index
case params[:model]
when 'MiqRequest'
Expand All @@ -12,8 +14,8 @@ def index
end
redirect_to :controller => controller, :action => 'show', :id => params[:id]
else
flash_to_session(_("Could not find %{model}[id=%{id}]") % {:model => params[:model], :id => params[:id]})
redirect_to(:controller => 'dashboard')
flash_to_session(_("Could not find the given \"%{model}\" record.") % {:model => ui_lookup(:model => params[:model])}, :error)
redirect_to(:controller => 'dashboard', :action => 'show')
end
end
end

0 comments on commit d592c21

Please sign in to comment.