Skip to content

Commit

Permalink
WTH - Error clicking 'edit original'
Browse files Browse the repository at this point in the history
Correctly passed in error message from Application controller to
authorization error partial. Set 'in_dashboard' variable in
shared/header_logos to false as authorization error partial will never
be in the dashboard section. Fixed other instances of partial usage.

set in_dashboard variable to false

passing local variable to partial

explicitly rendering partial and passing in local variable as error
  • Loading branch information
William Holt committed May 20, 2016
1 parent 8058260 commit 6b29fcd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def authorization_error msg, ref
error += "<br />If you believe this is in error please contact, #{I18n.t 'error_contact'}, and provide the following information:"
error += "<br /> Reference #: "
error += ref
render 'service_requests/authorization_error', error: error
render partial: 'service_requests/authorization_error', locals: { error: error }
end

def clean_errors errors
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/service_requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,8 @@ def authorize_protocol_edit_request
unless authorized
@service_request = nil
@sub_service_request = nil
render 'service_requests/authorization_error', error: 'You are not allowed to edit this Request.'
render partial: 'service_requests/authorization_error',
locals: { error: 'You are not allowed to edit this Request.' }
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/service_requests/_authorization_error.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
= stylesheet_link_tag '960', "#{CUSTOM_ASSET_PATH}application", 'jquery-ui', :media => 'all'
%body
#container.container
= render :partial => 'shared/header_logos'
= render 'shared/header_logos', in_dashboard: false
#title
%h1= t 'application_title'
#content.container_12
Expand Down

0 comments on commit 6b29fcd

Please sign in to comment.