我在 Ubuntu 上使用 Lynx 命令行浏览器。Generate Report我的网页上有一个按钮,单击该按钮后,会从我的 Rails 应用程序下载 Excel 报告。
我无法找到下载的文件的去向。
请帮忙!下载的文件在 Lynx 浏览器中去哪里了?
I have a User table for my app which contains the list of all users. This table has a Boolean field named active.
我有以下代码来获取用户:
existing_user = User.where("LOWER(email) = ?", auth_hash['info']['email'].downcase)
Run Code Online (Sandbox Code Playgroud)
这就是我执行以下操作时得到的existing_user.inspect:
User Load (1.9ms) SELECT "users".* FROM "users" WHERE (LOWER(email) = 'biswanath.chandramouli@gmail.com')
#<ActiveRecord::Relation [#<User id: 4, name: "Biswanath Chandramouli", email: "Biswanath.Chandramouli@gmail.com", last_updated_by: "", admin: true, active: true, last_updated_on: nil, created_at: "2018-10-30 08:14:59", updated_at: "2018-10-30 08:14:59"
Run Code Online (Sandbox Code Playgroud)
如您所见,existing_user具有active如上所述的可用属性。
但是此代码失败:
if(!existing_user.active?)
Run Code Online (Sandbox Code Playgroud)
上面的调用抛出此错误:
undefined method `active?' for …Run Code Online (Sandbox Code Playgroud)