Bra*_*gan 10 ruby-on-rails devise
错误信息:
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) lib/action_controller/metal/rendering.rb:11:in `process_action'
Run Code Online (Sandbox Code Playgroud)
我最近更新了:Devise 1.2.1(我也收到了1.2.0的错误)Rails 3.0.5 Ruby 1.8.7 WEBrick 1.3.1
另外,我在我的路线中有这个:
devise_for :users
Run Code Online (Sandbox Code Playgroud)
我曾经运行良好,直到最新的更新.谢谢
问题是你的助手confirmation_path被 devise 的 url_helpers 覆盖。
https://github.com/plataformatec/devise/blob/master/lib/devise/controllers/url_helpers.rb
基本上,devise 认为您想要为您的活动提供确认路径。
将您的路线更改为类似
match '/admin/events/confirmation/:id' => "events#confirmation", :as => 'confirmation_event'
Run Code Online (Sandbox Code Playgroud)
然后使用
redirect_to(confirmation_event_path(@event), :notice => 'Your event has not been confirmed.')
Run Code Online (Sandbox Code Playgroud)
在您的控制器以及您使用它的任何其他地方。
| 归档时间: |
|
| 查看次数: |
2306 次 |
| 最近记录: |