wice_grid
wice_grid copied to clipboard
Using only_path: true in forming links
Hello!
Settings nginx to use SSL ( https://localhost/ ). Start the Web application server (WEBrick or unicorn) at http://localhost:3000. Got error in firefox: Mixed Content (Заблокирована загрузка смешанного активного содержимого)
Any idea how else could solve the problem?
I made a small change:
# wice_grid/lib/wice/grid_renderer.rb
module Wice
class GridRenderer
def base_link_for_filter(controller, extra_parameters = {}) #:nodoc:
...
new_params[:only_path] = true # <<<<<
...
end
def link_for_export(controller, format, extra_parameters = {}) #:nodoc:
...
new_params[:only_path] = true # <<<<<
...
end
end
end
it worked! Please tell me why apparently used only_path: false ? That may break if you use only_path: true ?
I had WiceGrid working on SSL pages without any problems, the question is which URL is the offender? Which link is generated by the plugin with a scheme different from the scheme of the page (https)?
URL, for example, http://localhost/tenants?grid%5Bf%5D%5Bstatus%5D%5B%5D=0 WEBrick works on http (port 3000) nginx - https (port 443)
Perhaps configured incorrectly nginx. You can provide a configuration file nginx?
What is the reason to use only_path: false?
please create a gist with html source code of the page which causes this error message
I think this will be enough:
<div
data-processor-initializer-arguments="[
"http://localhost/tenants",
"http://localhost/tenants",
"/tenants?grid%5Bexport%5D=csv",
"grid%5Bq%5D=",
"grid%5Bfoc%5D=",
"production"
]"
...
<div data-processor-initializer-arguments="["http://localhost/tenants","http://localhost/tenants","/tenants?grid%5Bexport%5D=csv","grid%5Bq%5D=","grid%5Bfoc%5D=","production"]" data-filter-declarations="[{"filterName":"№","detached":"false","declaration":{"templates":["grid%5Bf%5D%5Bid%5D%5Beq%5D="],"ids":["grid_f_id_eq"]}},{"filterName":"№ заказа в облачной платформе","detached":"false","declaration":{"templates":["grid%5Bf%5D%5Border_id%5D%5Beq%5D="],"ids":["grid_f_order_id_eq"]}},{"filterName":"Название","detached":"false","declaration":{"templates":["grid%5Bf%5D%5Bname%5D="],"ids":["grid_f_name"]}},{"filterName":"№ заказа ВЦОД в облачной платформе","detached":"false","declaration":{"templates":["grid%5Bf%5D%5Bparent_order_id%5D%5Beq%5D="],"ids":["grid_f_parent_order_id_eq"]}},{"filterName":"Имя ВЦОД","detached":"false","declaration":{"templates":["grid%5Bf%5D%5Bvdc_name%5D="],"ids":["grid_f_vdc_name"]}},{"filterName":"Регион ВЦОД","detached":"false","declaration":{"templates":["grid%5Bf%5D%5Bregion%5D="],"ids":["grid_f_region"]}},{"filterName":"Система виртуализации ВЦОД","detached":"false","declaration":{"templates":["grid%5Bf%5D%5Bvirtualization%5D="],"ids":["grid_f_virtualization"]}},{"filterName":"Дата создания","detached":"false","declaration":{"templates":["grid%5Bf%5D%5Bcreated_at%5D%5Bfr%5D=","grid%5Bf%5D%5Bcreated_at%5D%5Bto%5D="],"ids":["grid_f_created_at_fr","grid_f_created_at_to"]}},{"filterName":"Статус","detached":"false","declaration":{"templates":["grid%5Bf%5D%5Bstatus%5D%5B%5D="],"ids":["grid_f_status"]}}]" class="wg-data"></div></div>
No, that is definitely not enough. At least the whole WG code is needed, or the whole page.
To solve the problem turned out to be enough to add the settings nginx:
proxy_set_header X-Forwarded-Proto $scheme;
Thanks!
But it is interesting why can not use only_path: true?