这是我的模型中的代码
include Mongoid::Document
include Mongoid::Timestamps
field :message, :type => String
field :send_at, :type => DateTime
Run Code Online (Sandbox Code Playgroud)
这是我的表单部分的代码
<%= f.label :send_at %><br />
<%= f.datetime_select :send_at %>
Run Code Online (Sandbox Code Playgroud)
但是从不填充日期和时间.我确保Mongo和Mongoid也是最新的.不确定是否有我遗漏的东西.
[更新日志条目]
Started POST "/notifis" for 127.0.0.1 at Mon Oct 18 05:48:05 -0400 2010
Processing by NotifisController#create as HTML
Parameters: {"commit"=>"Create Notifi",
"authenticity_token"=>"/hrlnvA2Xn5NqGgCkPFAQV254IHPJEvZoLxOYNNUwhc=", "_snowman"=>"?",
"notifi"=>{"send_at(2i)"=>"10", "is_sent"=>"0", "send_at(3i)"=>"18",
"send_at(4i)"=>"09", "message"=>"erwer", "send_at(5i)"=>"48",
"send_at(1i)"=>"2010"}}
MONGODB noti_development['notifis'].insert([{"send_at(2i)"=>"10", "created_at"=>Mon Oct
18 09:48:05 UTC 2010, "is_sent"=>false, "updated_at"=>Mon Oct 18 09:48:05 UTC 2010,
"_id"=>BSON::ObjectID('4cbc17d5c24d7602bc00002d'), "send_at(3i)"=>"18",
"message"=>"Sample Message", "send_at(4i)"=>"09", "send_at(1i)"=>"2010",
"send_at(5i)"=>"48"}])
Redirected to …Run Code Online (Sandbox Code Playgroud) 错误信息:
Could not find a valid mapping for #<Event id: 10022, event_name: "test", start_date: "2011-03-31", end_date: "2011-03-31", event_description: "test", created_at: "2011-03-30 03:26:01", updated_at: "2011-03-30 03:26:01", is_ecommerce: false, is_secure: false, event_password: nil, notify_rsvp: false, user_id: 20, start_time: "noon", street_address: "", city: "", state: "", country: "", zipcode: "", website_url: nil, status: "Draft", payment_received: false, is_confirmed: false>
Run Code Online (Sandbox Code Playgroud)
这是我的全栈跟踪的顶部:
devise (1.2.1) lib/devise/mapping.rb:40:in `find_scope!'
devise (1.2.1) lib/devise/controllers/url_helpers.rb:29:in `confirmation_path'
app/controllers/events_controller.rb:163:in `edit'
actionpack (3.0.1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.1) lib/abstract_controller/base.rb:150:in `process_action'
actionpack (3.0.1) …Run Code Online (Sandbox Code Playgroud) 我检查了以下网址:
如何删除通过 Shopify API 制作的 Shopify Webhooks?
但两者似乎都没有真正解释如何通过应用程序内部删除它们。
例如,我有超过 100 家带有旧版 webhook 的商店,我想使用 API 为它们删除它们。
@legacyhooks = ShopifyAPI::Webhook.find(:all, :params => {:limit => 15, :created_at_max => '2013-09-02', :order => "created_at DESC" })
Run Code Online (Sandbox Code Playgroud)
这很好用。但是如何删除它们?
我试过了:
ShopifyAPI::Webhook.destroy ShopifyAPI::Webhook.delete ShopifyAPI::Webhook.remove
Run Code Online (Sandbox Code Playgroud)
这些似乎都不起作用。
编辑:
我试过:ShopifyAPI::Webhook.delete({ :id => h.id })
其中 PKID h.id 在循环中。但是我收到 404 错误。
有文档ShopifyAPI::Webhook.create,ShopifyAPI::Webhook.find但在那之后,什么都没有。
我不希望使用 CLI 或为每个命令运行 cURL 命令(例如可能是数千个)
我只想在创建它的应用程序中自动完成它。