查询 Rails 中某列不为 nil 的记录 4

How to make the settings for Download in Firefox when launched using Webdriver?

在代码中:

<% @hotelUser=HotelUser.find( cookies[:user_id2]) %>

<%= debug @orderLast=Order.where(:email=>@hotelUser.email,"order.hotel_user_id IS NOT NULL").last%>

执行此 code.I 后出现语法错误,我想在 hotel_user_id != nil or empty? 中搜索 hotel_user_id。请告诉我正确的语法。

像这样创建一个 firefox 配置文件:

https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles

在此配置文件中,在创建 firefox 驱动程序时在代码中设置正确的下载 destination.Now,并使用新创建的配置文件启动它。这应该可以解决问题。

我能够使用以下代码片段实现此目的:

FirefoxProfile profile = new FirefoxProfile();
profile.SetPreference("browser.download.useDownloadDir", false);
IWebDriver driver = new FirefoxDriver(profile);
driver.Navigate().GoToUrl("http://www.google.com");