Когда я сталкиваюсь с определенной конечной точкой моего запущенного приложения, которое находится на удаленном сервере, Я получаю 500 Внутренняя ошибка .ДА, код отлично работает на моей локальной системе / сервере.
код:
order_controller.rb
module Admin
module Statistic
class OrdersController < BaseController
def show
@orders_grid = ::Statistic::OrdersGrid.new(params[:statistic_orders_grid])
@assets = @orders_grid.assets
@paginated_assets = @assets.page(params[:page]).per(20)
fee_sums_per_currency = {}
@assets.each do |order|
fee_currency = order.get_order_fee_currency
unless fee_sums_per_currency.key?(fee_currency)
fee_sums_per_currency[fee_currency] = 0
end
fee_sums_per_currency[fee_currency] += order.fee
end
fee_summary = []
fee_sums_per_currency.each do |currency, fee_sum|
fee_summary << "#{ currency } #{ fee_sum }"
end
@summary = {
:count => @assets.length,
:fee_summary => fee_summary.join(", ")
}
@order_reset_button = true
end
end
end
end
просмотров / admin / статистика / orders / show.html.slim
.row
= render "admin/statistic/shared/filter_panel", form_target: @orders_grid, url: admin_statistic_orders_path
.row
= render "admin/statistic/shared/summary_panel", groups: @assets
.row
.panel.panel-primary
.panel-heading
span = t('admin_header.orders')
.panel-body
= datagrid_table(@orders_grid, @paginated_assets)
ОБЪЕДИНЕННЫЕ ФАЙЛЫ
admin / статистика / общий ресурс / фильтр_панель
.panel.panel-primary
.panel-heading
h4.panel-title = t('admin.statistic.filter')
.panel-body
= form_for form_target, url: url, html: {method: :get, class: 'form-horizontal'} do |f|
.row
.col.col-xs-3
= f.datagrid_label :currency
= f.datagrid_filter :currency, class: "form-control"
.col.col-xs-3
= f.datagrid_label :state
= f.datagrid_filter :state, class: "form-control"
.col.col-xs-3
= f.datagrid_label :type
= f.datagrid_filter :type, class: "form-control"
.col.col-xs-6
= f.datagrid_label :created_at
.form-inline
= f.datagrid_filter :created_at, class: "form-control"
.col.col-xs-2
br.heighten-br
= f.submit t('datagrid.form.submit'), class: "btn btn-primary", style: "width: 100%"
.col.col-xs-2
br.heighten-br
= link_to t('datagrid.form.clear'), {:controller => 'admin/statistic/orders', :action => 'show'}, class: 'btn btn-primary', style: "width: 100%"
администратор / статистика / общий доступ / итоговая_панель
.panel.panel-default
.panel-heading
h4.panel-title.row
a data-parent="#filter-accordion" data-toggle="collapse" href="#summary"
span.col-xs-8.text-muted = t('admin.statistic.summary')
span.col-xs-4.text-right.text-muted = t('admin.statistic.click-to-expand')
#summary.panel-collapse.collapse
.panel-body
.datagrid-groups
- if groups
- groups.each do |key, val|
.datagrid.group.row
span.col-xs-2.title = t("admin.statistic.#{controller_name}.#{controller.action_name}.#{key}")
span.col-xs-10.value = val
Navbar Основано на cancancan
- if can? :menu, Trade
li.dropdown class = check_active('withdraws')
= link_to 'javascript:;', class: 'dropdown-toggle', 'data-toggle' => 'dropdown' do
span = t('admin_header.trades')
span.caret
ul.dropdown-menu
- if can? :manage, Order
li class = check_active('orders')
= link_to t(".menus.items.operating.orders"), admin_statistic_orders_path
способность.рб
module Admin
class Ability
include CanCan::Ability
def initialize(user)
return unless user.admin?
can :read, Order
can :read, Trade
can :read, Proof
can :update, Proof
can :manage, Document
can :manage, Member
can :manage, Ticket
can :manage, IdDocument
can :manage, TwoFactor
can :manage, Coupon
can :manage, Order
can :manage, Trade
can :manage, Revenue
can :menu, Deposit
can :menu, Trade
end
end
end
config / routs / admin.rb
namespace :admin do
namespace :statistic do
resource :orders, :only => :show
resource :trades, :only => :show
end
end
Я проверил и не знаю, чего не хватает, чтобы работать на сервере разработки, а не на удаленном сервере.