I create a controller to manage account balance BalanceController
. It's supposed to use data from the Invoices and Expenses table. So I added one action to the BalanceController called account_balance
. But I need to add a month and year param to generate a balance report.
This doesn't seem to work on routes.rb
get 'balance/account_balance/:month' => 'balance#account_balance/:month'
get 'balance/account_balance/:month' => 'balance#account_balance'
The string is just a controller/action combo.
Going to /balance/account_balance/march would then route to the account_balance
action of the balance
controller and params[:month]
would be set to 'march'.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.