diff options
Diffstat (limited to 'app/controllers/admin_request_controller.rb')
-rw-r--r-- | app/controllers/admin_request_controller.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index 4d45ced8b..2f5f51c0f 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_request_controller.rb @@ -26,15 +26,13 @@ class AdminRequestController < AdminController def show @info_request = InfoRequest.find(params[:id]) - # XXX is this *really* the only way to render a template to a - # variable, rather than to the response? - vars = OpenStruct.new(:name_to => @info_request.user_name, - :name_from => AlaveteliConfiguration::contact_name, - :info_request => @info_request, :reason => params[:reason], - :info_request_url => 'http://' + AlaveteliConfiguration::domain + request_url(@info_request), - :site_name => site_name) - template = File.read(File.join(File.dirname(__FILE__), "..", "views", "admin_request", "hidden_user_explanation.html.erb")) - @request_hidden_user_explanation = ERB.new(template).result(vars.instance_eval { binding }) + vars_for_explanation = {:reason => params[:reason], + :info_request => @info_request, + :name_to => @info_request.user_name, + :name_from => AlaveteliConfiguration::contact_name, + :info_request_url => request_url(@info_request, :only_path => false)} + @request_hidden_user_explanation = render_to_string(:template => "admin_request/hidden_user_explanation", + :locals => vars_for_explanation) end def resend |