Text fields and carriage returns
Reported by Ignacio Huerta | September 25th, 2011 @ 10:31 AM | in Hobo 1.3 (Rails 3)
With the latest Hobo 1.3 from Github and Rails 3.0.10, text fields don't work with carriage returns.
This was discussed in Hobo Users (http://groups.google.com/group/hobousers/browse_thread/thread/a12d9...) where kevinpfromnm suggested a workaround, which works perfectly. Maybe we should merge it into Hobo or look for a cleaner solution.
I'm not sure if this is related, but I'm experiencing another problem with text fields. In place editors for text fields don't work with or without kevin's workaround. See http://groups.google.com/group/hobousers/browse_thread/thread/0f5f6...#.
Comments and changes to this ticket
-
Matt Jones September 25th, 2011 @ 10:34 PM
(from [76ba85d9c80dd87b51893a129a6eab0cb68d71f2]) [#967] mark escaped string as html_safe in text type https://github.com/tablatom/hobo/commit/76ba85d9c80dd87b51893a129a6...
-
Matt Jones September 25th, 2011 @ 11:49 PM
(from [95939936752575432c12f57a648567527c2513a4]) [#967] fix obscure heisenbugs caused by class reloading after basic types are registered https://github.com/tablatom/hobo/commit/95939936752575432c12f57a648...
-
Matt Jones September 25th, 2011 @ 11:55 PM
- State changed from new to resolved
- Milestone set to Hobo 1.3 (Rails 3)
- Milestone order changed from 197983 to 0
Two issues here - the code that was escaping the test and then adding br tags wasn't marking the string HTML-safe. This may have been a bug introduced when Rails 3 made gsub and friends mark return strings automatically unsafe.
Second, there was a tricky bug with class reloading that caused the in-place editing code to not trigger for text fields. I was able to get the editor to work - but ONLY on the very first request to the server. The issue was that the editor field was getting a class from
type_id
, which was looking up a reloaded version ofHobo::Types::Text
and thus failing. The resulting class ofhobo__types__text
didn't trigger the code in hobo_rapid.js to enable the editor.The solution to the second issue was to add the hobo directories to the Rails
autoload_once_path
, causing them to stay loaded between requests in development mode.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Referenced by
- 967 Text fields and carriage returns (from [76ba85d9c80dd87b51893a129a6eab0cb68d71f2]) [#967] ...
- 967 Text fields and carriage returns (from [95939936752575432c12f57a648567527c2513a4]) [#967] ...