=== Release 0.6 === DRYML Local tags are gone. We finally gave up on this feature as too complex. New feature - allows a variable assignment that exists only for the lifetime of the tag-body of . At the end of the block, the previous value of the variable, if there will be restored. This feature gives a lot of the power of local tags in a less pure but far simpler mechanism. New feature - polymorphic tags. A tag can have many definitions for different types of object. Define with e.g. ... ... call with The actual tag called will be selected according to the type of the current context. Core tags moved from lib/hobo/core.rb to tags/core.dryml. This follows on from the deprecating of def_tag Fix: attrs_for now works with tags imported from a taglib Gone: template parameter modifiers (e.g. ). The only one left is 'replace' which is now written as '' and 'replace' is now a reserved attribute name. Two new features - default tagbodies and restoring parameters - give the same functionality but are more powerful because you can now _wrap_ a parameter in your own tag. New feature - default tagbodies. Tags can provide a default tagbody like this: ...this is the default... Callers can keep the default: replace it my tagbody or wrap it in new content: You can give restore the default tagbody of an element further up the hierarchy using the 'for' attribute. e.g: New feature: restoring replaced template parameters. For example - wrapping a template param in an extra div:
def@alias_current renamed to 'alias_current_as' @if and @unless controll attributes always test for non-blank rather than true. This is more convenient in DRYML where we generally want to skip stuff if a collection is empty (empty enumerables are blank, but not false) An attribute that starts with an XML entity reference is *not* considered a code attribute, even though it does start '&' e.g. label="» Next" #merge_attrs now always accumultates rather than replaces css classes. form, input and a have been removed from static_tags - these are now defined tags. Many core tags moved to Rapid. There are very ferw core tags now - just the basic control tags (if, unless etc.) Hobo Models The display_name method is not used anymore. Instead use the new polymorphic tags. ... The tag eventually falls back on to_s, so as an alternative you can rename your display_name methods to to_s. New semantics for #new and #build. #new now does what new_without_appending used to do. That is, it instantiates a new object exactly as if it was in the collection, but it does not modify the collection itself. #build is extended so that it sets the belongs_to association that is the counterpart to the has_many. For existing apps, just change any calls to #new_without_appending to #new Refactored the rich type mechanism to make it easier to add new types. To add a new type, e.g.: class Isbn < String; COLUMN_TYPE = :string; end Hobo.field_types[:isbn] = Isbn You can then use :isbn as a field type in 'fields do', and register a view with New rich type Hobo::EmailAddress < String Doesn't have any special behaviour as yet, but we could do nifty things with it in the future like auto anti-spam cloaking, validations... New method #nillable_field? tests if the underlying collumn can be null. New methods #created_date and #modified_date return [created|modified]_at.to_date Default to_s for all hobo_models Model controller Boolean fields now get a false value when the param is either '0' or 'false'. Front controller All the templates are updated to use the new DRYML Migration generator Now gives an option to generate and run the migration immediately Will create the "foo_type" column for belongs_to associations marked as polymorphic. Hobo Rapid lib/hobo/rapid.rb is gone. The tags are now in tags/rapid.dryml and the helpers are in lib/hobo/rapid_helper.rb Now includes two CSS stylesheets. hobo_base.css provides some handy reset rules to reduce cross-browser headaches, and hobo_rapid.css provides default styling for some of the Rapid components. Rapid split up into more separate dryml files: rapid, rapid_document_tags, rapid_forms, rapid_pages, rapid_editing, rapid_navigation, rapid_support There are a great many changes to the Rapid tags, too much to describe individually here. The most important changes are: becomes . is a polymorphic tag, so you can is gone. Use if you want a tag that gives an in-place (ajax) editor, and degrades to if the user does not have edit permission. is a polymorphic tag, so you can is now . If you give a type attributes, you get a regular html input tag, if you don't you get a smart Hobo form field appropriate for the type of the context. is a polymorphic tag, so you can All the special form-field tags tags that ended _field now end _input becomes becomes