We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In model I have a query with alias in select
def self.receiving_check LineItem.select("*, (line_item.quantity - supplier.stock_change) as remain_quantity").joins( ... end
It returns a activerecord relation something like this
<LineItem ...., remain_quantity: 100>
but after I initialize_grid in controller and render the attribute in view, I got undefined method error. The same code works with wice_grid 3.4.14
ActionView::Template::Error: undefined method `remain_quantity' for #<LineItem:0x007f88c2535d20>
This is how I initialized_grid in controller
@report_grid = initialize_grid(LineItem.receiving_check, joins: [:assembly_info], name: 'receiving_check', per_page: 25, order: 'creation_time', order_direction: 'desc', enable_export_to_csv: true, csv_file_name: "Receiving_check_#{Time.now.strftime('%Y%m%d')}")
render in view
= grid(@report_grid, show_filters: :when_filtered) do |g| - g.column name: t('th.remain_quantity') do |p| - p.remain_quantity
The text was updated successfully, but these errors were encountered:
Hi @brian-vogogo did you find any solution? I have a similiar problem. Thanks!
Sorry, something went wrong.
No branches or pull requests
In model I have a query with alias in select
It returns a activerecord relation something like this
but after I initialize_grid in controller and render the attribute in view, I got undefined method error. The same code works with wice_grid 3.4.14
This is how I initialized_grid in controller
render in view
The text was updated successfully, but these errors were encountered: