# Category custom field value strage behaviour in category edit form

**URL:** <https://meta.discourse.org/t/category-custom-field-value-strage-behaviour-in-category-edit-form/55807>\
**Category:** Development\
**Created:** [Janvier 15, 2017, 4:43 UTC](https://meta.discourse.org/t/category-custom-field-value-strage-behaviour-in-category-edit-form/55807 "2017-01-15T16:43:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Alavi1412](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alavi1412/32/67721_2.png) [@Alavi1412](https://meta.discourse.org/u/Alavi1412)\
**Post date:** [Avril 3, 2017, 1:08 UTC](https://meta.discourse.org/t/category-custom-field-value-strage-behaviour-in-category-edit-form/55807/2 "2017-04-03T13:08:59Z")

</div>

I have a question.  
what should we do for adding a custom field to a category?  
1.Using plugin.rb:  
`Category.register_custom_field_type('tracking_number', :integer)`  
2.using the code above.  
Which one should we use?

---

_[View the full topic](https://meta.discourse.org/t/category-custom-field-value-strage-behaviour-in-category-edit-form/55807)._
