# Key not found error

**URL:** <https://www.ruby-forum.com/t/key-not-found-error/139884>\
**Category:** Rails\
**Created:** [June 8, 2008, 6:41pm UTC](https://www.ruby-forum.com/t/key-not-found-error/139884 "2008-06-08T18:41:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [June 8, 2008, 6:41pm UTC](https://www.ruby-forum.com/t/key-not-found-error/139884/1 "2008-06-08T18:41:45Z")

</div>

Any ideas what the problem is here? It’s showing up on the edit page  
for a restful resource.

Extracted source (around line #3):

1:

# Editing content
  
2:  
3: \<% form\_for([:admin, @content]) do |f| %\>  
4: \<%= f.error\_messages %\>  
5:  
6: 

Trace  
/usr/local/lib/ruby/gems/1.8/gems/facets-2.4.1/lib/facets/hash/  
slice.rb:8:in `fetch' /usr/local/lib/ruby/gems/1.8/gems/facets-2.4.1/lib/facets/hash/ slice.rb:8:in`slice’  
/usr/local/lib/ruby/gems/1.8/gems/facets-2.4.1/lib/facets/hash/  
slice.rb:7:in `each' /usr/local/lib/ruby/gems/1.8/gems/facets-2.4.1/lib/facets/hash/ slice.rb:7:in`slice’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action\_view/  
helpers/form\_helper.rb:699:in `initialize' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/ helpers/form_helper.rb:317:in`new’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action\_view/  
helpers/form\_helper.rb:317:in `fields_for' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/ helpers/form_helper.rb:253:in`form\_for\_without\_haml’  
/usr/local/lib/ruby/gems/1.8/gems/haml-2.0.0/lib/haml/helpers/  
action\_view\_mods.rb:124:in `form_for' app/views/admin/contents/edit.html.erb:3:in`\_run\_erb\_47app47views47admin47contents47edit46html46erb’

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [June 20, 2008, 7:49am UTC](https://www.ruby-forum.com/t/key-not-found-error/139884/2 "2008-06-20T07:49:06Z")

</div>

Install facets 2.4.0 and all should be good. Not sure what the error  
is in 2.4.1 yet.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [June 20, 2008, 7:59am UTC](https://www.ruby-forum.com/t/key-not-found-error/139884/3 "2008-06-20T07:59:04Z")

</div>

OK, it still happens with 2.4.0 too. Looks like facets has issues with  
Rails 2.1
