location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /dp/ {
auth_basic "closed site";
auth_basic_user_file /home/local/html/.htpasswd;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
class XlsController < ApplicationController
# В index вьюшке выводим фарму
def index
end
# Тут получаем POST запрос с данными формы и формируем XLS
# routes.rb - post 'xls/get_xls'
def get_xls
filename = "form-#{Time.now.strftime("%Y%m%d%H%M%S")}.xls"
send_data([validate_params].to_xls, :type => "text/xls; charset=utf-8; header=present", :filename => filename)
end
private
# Валидация формы
def validate_params
params.require(:form).permit(:value1, :value2)
end
end
<%= form_tag xls_get_path, method: "post" do %>
<p><%= label_tag('VALUE1') %></p>
<p><%= text_field_tag('form[value1]') %></p>
<p><%= label_tag('VALUE2') %></p>
<p><%= text_field_tag('form[value2]') %></p>
<p> <%= submit_tag('SEND') %></p>
<% end %>
Неужели остаётся только отключать от коммутатор по 1-му кабелю и ходить смотреть по кабинетах где сети нет?