=== Hobo 0.8.6 === Hobo 0.8.6 includes Rails 2.3 support. Rails 2.2 support has been maintained. Rails 2.1 support was dropped in 0.8.5. Significant effort was put into unit and integration tests in this release. Unit tests may be run via `rake test_all`. Integration tests live in agility: http://github.com/tablatom/agility/tree/master. Some small changes were made to item orders to fix bugs with IE6. This may require updates in custom stylesheets. Previously, the lifecycle transitions had a parameter called :params in the documentation and :update in the code. The code has been updated to match the documentation. Support for `big_integer` in HoboFields has been dropped. It appears that this has never worked correctly. input-many is now a polymorphic tag and the default tag for has_many inputs. The 'content' parameter has been renamed to 'description' for generated cards. input-many and sortable-collection have been improved. Many tags have had parameters and attributes added to improve customization. Many bugs have been fixed. See the [lighthouse]( http://hobo.lighthouseapp.com) or the [git commit history](http://github.com/tablatom/hobo/commits/master/) for more details. 0.8.6 is a release candidate for Hobo 1.0. At this point we do not believe that there are any outstanding bugs on Hobo that do not have workarounds. The [lighthouse](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/bins/8323) shows the remaining tickets scheduled for 1.0 === Hobo 0.8.5 === New permission system Various fixes Now runs permission checks *before* callbacks, not after In the switch to the new permissions system, we changed to running them after all callbacks. This turned out to be wrong. Permissions should only be about what the user tried to change, not other changes triggered by application logic API change: Web method permissions should now be defined as foo_permitted? instead of foo_call_permitted? Updated hobo command and hobo generator to use the new config.gem style for apps that use the Hobo gem The --add-gem option to script/generate hobo will add "config.gem 'hobo'" to environment.rb. The hobo command does this automatically Lifecycles fix -- state_name would throw a nil error if there was no state (not returns nil) This was causing the :new_key option to fail on a create step Fixes to problems with live-search introduced with the Rails 2.2 upgrade === Hobo 0.8.4 === Rails 2.2 compatible. Rails 2.1 support dropped. Removing the Rails routing patch (from the hobo generator) that is no longer needed. Existing apps can delete this from config/initializers/patch_routing.rb BREAKING: New permission system This is the major feature of this release. The big change is that we now use the dirty tracking features of Active Record for update permission, rather than passing that weird 'new' object. We also use the acting_user method throughout, rather than passing the user as an argument. See the docs online: http://cookbook.hobocentral.net/manual/permissions Removing special Hobo semantics for association.new which was breaking the Rails API, and added #new_candidate association.new_candidate instantiates the record but does not add it to the collection. Fix to linkable? helpers when context responds to origin but is not a collection POSSIBLY BREAKING: Improved multi-model form support has_many and belongs_to now support the :accessible => true option, which allows mass-asssignment of attributes to work with sub-hashes that correspond to associations. Docs to follow! BREAKING: Lifecycle improvements The lifecycle DSL has been tidied up. Various changes to the semantics. Lifecycle validations are now supported (e.g. validates_presence_of :foo, :on => :my_transition) Also small improvements to the controller layer lifecycles support See: http://cookbook.hobocentral.net/manual/lifecycles New ViewHints mechanism Classes in app/viewhints are a place to declare things about your models that are view layer concerns. For example, you can give the presenation name for a field if this should be different from the back-end name. You can give "field help" for each field. You can specify which collections are the "children" of a model from a UI point of view. Rapid -- removed use of as it gets some words wrong (e.g. "an user") Rapid -- moved to rapid_forms.dryml Model controller fix -- owner instance variable should be named after the association, not the class (e.g. @author, not @user) View hints fix -- inconsistent results due to class reloading problem in dev mode (was causing inconsistent Rapid pages to be generated) Hobo Models -- added support for 1-to-1 relationships to Hobo::Model.reverse_reflection This puts us a step closer to better support for 1-to-1 relationships in various places, e.g. for owner actions Improved error message when declaring auto_actions_for on an association that doesn't have the corresponding reverse-reflection Fixed query_params helper -- should URI decode the parameters Rapid -- simplified (no need for a hidden tag) Rapid pages -- added parameter to account page DRYML -- fix to merge-attrs="a, b, c" Rapid -- added support for disable attribute Fix to when forgery protection is disabled User model - validates_presence_of password confirmation, in addition to validates_confirmation_of Fixes #310 - thanks to Jaub Suder BREAKING: Rapid page generators -- Renamed 'primary-content' parameter in to 'description' User controller -- made account action follow the auto_actions declaration Changed hobo->hobofields->hobosupport gem dependency rules to require the exact version User model generator -- Hobo apps now have people log in with their email address by default, and the user has a 'name' field rather than 'username'. Note this will not effect existing apps Clean theme - fix to styling of login page in IE6 Rapid javascripts -- fix to in-place-editor errors not showing up properly (#324). Thanks to Jakub Suder DRYML -- fixed duplicate ID bug with ajax parts (#326) POSSIBLY BREAKING: Models -- removed support for chronic parsing of times / dates. Was wrong to hardwire this support in for every date/time field. Will be added back in as a rich type at some point Scopes - Fixed association.conditions with scopes for has_many :through Rapid -- now honours the 'skip' attribute under all circumstances Rapid -- app-stylesheet param, to make it easier to add in custom stylesheets, but have them *before* application.css Rapid -- call stylesheet_link_tag once only so that asset combining is supported DRYML -- allow as a shorthand for Removed super_user? and adminstrator? from Hobo::Guest, and added administrator? to Guest generator administrator? should not be present at all in core Hobo, it's just a default starting point Rapid -- don't add the hidden field if the checkbox is disabled - thanks to Tola. Rapid -- Fix to 'current' CSS class when a body is not given Rapid pages -- fix to selecting current nav item Added hobo:run_standard_generators task (*NIX only) Guest - changed default #to_s and #login to use lower case Rapid -- allow method name to use dashes, and raise an error if there's no such web method DRYML -- never run DRYML generators in production mode. Instead run rake hobo:generate_taglibs Rapid JavaScripts -- adding custom events to Rapid JavaScript -- added option to specify { message: false } on ajaxRequest to disable the spinner Model Controller -- fix to re_render_form when in a subsite hobo_model_controller generator -- adding support for generating subsite controllers HoboSupport -- adding remove and remove_all (plus mutating versions with a !) to string - better name for sub(x, '') DRYML -- added support for scope.even_odd to the attribute version of repeat (was only on the tag version) DRYML -- improved error message for mixed param / non-param tags Model controller -- fix to index actions on non-paginated formats (was passing will-paginate options to a regular find) Migration generator -- adding option: --force-drop-yes-i-really-mean-it-i-know-what-i-am-doing-dammit Not really, it's actually just --force-drop With this option it won't ask you "drop or rename?" it will just drop HoboFields -- fix to EnumString when values are not valid contant names Rapid -- added support for 'disabled' to Enhanced ajax mechanism so that it can refresh form inputs (was previously not able to figure out the name attributes) Rapid -- adding support for 'disabled' attribute to Rapid -- added a 'no-edit' attribute to and . Gives control over how non-editable fields are handled. - view: render the current value using the `` tag - disable: render the input as normal, but add HTML's `disabled` attribute - skip: render nothing at all - ignore: render the input normally. That is, don't even perform the edit check. Added to the user 'simple pages' (login, signup...) User conrtroller -- redirect to home_page if a logged-in user visits the login page Model controller -- fix to lifecycle form inputs not showing up after a validation error Rapid -- changed rules for chosing whether to be in-place or not BREAKING (minor): removed 'type' attribute from BREAKING (minor): Rapid -- renamed 'separator' attribute of to 'join' Rapid -- moved live-search and filter-menu tags into rapid_plus Rapid -- removed unused . Renamed to , made it polymorphic, and extracted the default definition as Rapid -- tweak to behaviour of . Is now more sensible when called on a non-AR class Re-organisation and documentation for Rapid Document Tags BREAKING: Deleted tag. Models - fix to overriding of not_found and permission_denied in applicatin controller. Also fix to bug in permission denied Models -- fix to preceding dashes in to_param (sometimes showed up in the URL) DRYML -- allow - instead of _ in repeat/if/unless, when not code attribute HoboSupport - re-org of the file layout HoboFields -- new rich type :serialized (HoboFields::SerializedObject) example usage: foo :serialized, :class => Array Also some fixes to wrapping of rich types that were needed HoboFields -- adding 'declared' callback to rich types. Called whenever a field of that type is declared See HoboFields::HtmlString for an example HoboFields -- new types RawHtmlString and RawMarkdownString that are not sanitized. Plus fix to sanitizing DRYML -- new DrymlDoc facility. Starting point for a roll-your-own documentation generator Used to generate the cookbook taglib API reference. hobo_front_controller generator -- use map.root for adding the root route Model controller -- can call #re_render_form without an arg (for when you know params[:page_path] is set) Support for non-numeric model IDs Rails has no problems with these but Hobo was assuming integer IDs in a few places. Fix to default ApplicationController#home_page -- was broken when the app lives in a sub-directory Rapid -- allow '-' instead of '_' in (and therefore, and ) Rapid -- made submit IDs instead of names, so that it also works with models that don't have a unique name Cleanup of dom_id / typed_id. We now use the term "typed id" throughout to refer to a string that includes a model name and an ID. These now use ':' instead of '_' as the model-name/id separator, which has the benefit of allowing non-integer keys HoboSupport -- adding String#safe_constantize. Returns nil (instead of raising a NameError) the constant does not exist and cannot be loaded by ActiveSupport BREAKING. Rapid pages -- separated out application.js from other JS includes and added a parameter Adding extra scripts using this new parameter will ensure application.js comes last and can thus override behaviour of custom scripts. This is a breaking change because apps that have customised the list of JS includes might not now have the set of scripts they expect Rapid - adding polymorphic tag as a place to define the kind of input you want used for collections of a given model Rapid javascripts -- making non-ajax HTML Editor pluggable Plugins assign a function to Hobo.makeHtmlEditor. See hoboyui plugin for an example (github.com/tablatom) Adding XSS protection to HoboFields rich types (Sanitizing) Rapid -- new tag . Add remove items to a has_many :through by checking the ones you want. Obviously this is only suitable when the number of items in the target model is small. (e.g. blog post categories) Page generators -- better titles for collection previews in aside on a user's page Page generators -- improved collection heading on show-page for a user Fixes to "remember me" Card generator -- observe view-hints when putting a count on the card Rapid -- change to css classes on new-object forms (was 'new-post' now 'new post') Rapid -- workaround for the fact that Maruku defines a to_html method on String Page generators -- changed heading used on HoboSupport -- added Object#present? that is on it's way from edge Rails (will remove when Rails provides this) User pages: Added editing of email address to user's account page Got rid of Rapid plus -- added and tags Rapid -- removed unimplemented if-content attribute from base Rapid -- fixed class name dash problem in User model generator -- allow users to change their email address by default Automatic scopes extended with_things and without_things automatic scopes so that they work without arguments. e.g. Question.with_answers and Question.without_answers Automatic scopes -- have 'recent' scope just do a 'limit x' if there is no created_at column (used to blow up) Model Controller, allow :scope => :some_scope_name on index_action Made object_url handle a scoped class (gives the index url, e.g. /posts) Rapid generators -- fixed bug where some cards had title when they should not have Rapid generators -- smarter index-for-owner page when the owner is a user Rapid generators -- fixed wrongly named param in for new-for-ower pages User controller generator -- remove :new action by default DRYML - fixed problem where parameters where conflicting rather than merging Improvements to reset stylesheet - strong, em and code now render as expetced Moved all the tags defined in rapid.dryml into a new included file rapid_core.dryml to make it easier to include only parts of the tag library if required === Hobo 0.8.3 === Hobo models -- improvements to logic for validating passwords. Closes #281 Hobo users -- simpler definition of account_active? This assumes the user has the default lifecycle or similar. If the lifecycle is cusomtised this method can be overridden Lifecycles -- Make current creator/transition available as lifecycle.active_step Lifecycles -- user a safer name for methods to test if the lifecycle is in a given state Now record.lifecycle.is_active? instead of record.lifecycle.active? Lifecycles -- become method should not polute AR namespace (use lifecycle.become) Models -- to_param should always return a string. Closes #280 Rapid -- -- "remember me" is now on by default Fixed typo in . Thanks to Jakub Suder Fixes and Clean theme improvements for site-wide live-search. Closes #290 Removing hobo_spec - test will live in hobo/test, hobofields/test as is normal Adding close button (also, keyboard = ESC) to live-search popup Models -- classes for polymorphic assciations (e.g. Tagging::ble) are now automatically created instead of blowing up when calling reflection.klass. Closes #83 Removed nicedit - we've moved to a plugin based system for rich editors now (see github.com/tablatom/hoboyui) Rapid -- the select menus in now observe conditions applied to the has_many :through Rapid -- fix to double-escaping of names in merge-attrs on Rapid -- added if-present attribute to to supress the nil-view if there is no name Used in to ensure the input box is blank Improved support for validation in multi-model-forms Added support for owner actions where the owner is a has_many :through (was only for :belongs_to owners) Rapid -- improvements to index-for-owner page Rapid -- renamed parameter from 'description' to 'content' Rapid -- adding multipart attribute to
. Usage: Model Controller -- fix to :redirect option for hobo actions DRYML -- fix to dom_id helper when this_parent is a collection Model Controller -- improved remember_page_path to also remember the query string Rapid - fix to -- the confirm attribute was incorrectly changing the button into an ajax button Rapid -- now supports an array of label/value pairs, like the options_for_select helper Model Controller -- Now remembers the previous page path in the session and uses this to fix a problem with (occured after a validation error) New tag for situations where you want input for every item in an existing collection (without the +/- buttons that has) HoboSupport -- enum.rest now returns [] for an empty enumerable (was nil) Rapid + DRYML -- recfactoring the way DRYML keep track of which form field names. It's now possible to track these for a sub-object by setting a new scoped variable form_field_names Rapid -- enhancements to : - sensible defaults for complete-target and completer (you can now use as a drop-in replacement for - The of the referenced object is included in the input box if there is one Rapid -- improved grammar (use of 'a' or 'an') in Model controller autocompleter enhancement -- you can ommit the name of the autocompleter, in which case it defaults to the model's name_attribute Hobo Model -- more robust handling of date hashes Support in Rapid and javascript for It's now very easy to embed form fields for items in a has_many collection. These use javascript + and - buttons, but this does not use ajax. Hobo models -- improved support for mass assignment to has_many associations. Any has_many association can now be assigned a hash. The keys are *only* for ordering purposes. The values are themsleves hashes of attributes. New records are created for any such hash that has no :id key Hobo model -- fix to has_one extension (was discarding the block) DRYML - New behaviour for context_map (repeat): this_field is now the index (0 based) when iterating over a collection. New helpers (HoboHelper) first_item? and last_item? DRYML - fix to loading of nested taglibs Rapid user pages -- don't show forgot-password link if the route is not present should use
instead of

, otherwise block level elements won't be allowed inside and Firefox will sometimes treat them as if they are outside Rapid page generators -- added param to on DRYML - fix to using in a taglib included by a taglib Migration generator -- convert spaces to _ when responding to rename questions Rapid user pages -- made forgot-password link a param hobo_model generator -- formatting improvement Model Controller -- new :redirect option for controller actions Use the rails 'pick_template' mechanism to determine the correct template path when rendering a DRYML view Rapid generators -- adding missing tags to lifecycle forms === Hobo 0.8.2 === Hobo models -- improvement to name-in-URL (#to_param) Added missing input for time fields Rapid forms -- added missing hours/minutes/seconds fields to datetime input Reorg of Hobo Rakefile, in preprartion for move to Shoulda Rapid -- fix to Echoe tasks -- adding workaround for developer-dependencies problem Rapid -- fixes to css class named that had '_' instead of '-' Rapid pages generators -- improvements to form submit button labels ModelController - set the provided key on the record *before* the view permission check during a lifecycle transition Hobo Models -- Model.user_find can now take a block to perform actions on the record prior to the permission check Added Rails dependency to hobofields gem Fix to Rails dependency - any Rails >= 2.1 is ok Reorganised generator tests Hobo users now have an #account_active? method. Used in two places: - This method rather than the return value of the block passed to hobo_login, is now used to figure out if an account is active when logging in. - After signing up, also log the user in iff account_active? is true. This is useful if there is a second step to signing up, such as email activation hobo_front_controller generator -- improved title of home page Rapid generators -- fix to owner link on new-for-owner page Fix to bug where validations were not happening during lifecycle creates/transitions === Hobo 0.8.1 === Fixes to generating and loading subsite controllers Add Rails routing monkey-patch to hobo generator Fixed deprecated use of ActiveSupport Dependencies module Migration generator -- fix to mysql limit problem in Rails 2.1.1 Migration generator -- fixed bug with validation of filename input by user New lifecycle semantics. Lifecycle create and transition actions (blocks) now run *after* the create or transition, and not at all if there are validation errors. To create a key, you can no longer call lifecycle.generate_key in the action, as the key timestamp will not be saved (record has already been saved) Instead pass :new_key => true as an option to the create or transition, and access it in the block using lifecycle.key Fix usage of 'skip' on hidden-fields tag; wasn't comma-splitting input. Correctly skip search field in table-plus search form. Fix to viewable_by? helper Partial fix #251 - add requirement that :id not be empty to resource routes Fix for #256, generating user model not named 'User' Maade request and app_name available by default New user model method account_active? Default implementation is state == 'active' but this method is intended as a hook that can be overridden as required. On signup, the user is only logged in if user has #account_active? Rapid generators -- fixes for form cancel links Rapid generators -- added parameter to show-page Fixes to in-place-editors Allow more advanced default ordering options like 'lower(users.last_name), lower(users.first_name)' Fixed typo in dryml-generator lifecycle pages show-page generator -- fix to test for create permission Rapid generators -- fix for show-page generator, when the 'owner' association that goes with the page's collection cannot be found === Hobo 0.8 === (There's a million changes in this release -- most of the fixes are *not* mentioned) Hobo now works with, and indeed requires, Rails 2.1 Hobo can now be used entirely from the gem, and need not be installed in vendor/plugins. To activate Hobo in this manner in an existing Rails app, just run the hobo generator. This will add the Hobo initializer to config/initializers. hobo command Now shows you what it's doing Renamed --create-dbs to --db-create to match the name of the rake task DRYML DRYML generators Hobo now provides a facility to generate DRYML tags on the fly using normal erb based templates. (the generators run when needed in development mode). The taglibs are written to taglibs/auto. Note that the generated tablibs are *not* intended to be modified, but rather should be imported and overridden in your application. Extending tags: The extend-with attribute is gone, instead we have the tag, e.g. instead of the rather confusing: we now have Also works with polymorphic tags, e.g. Polymorphic tags: new mechanism for defining polymorphic tags. ... "base" definition here ... ... in here you can call and it's not a recursive call but a call to the base definition ... "without" attributes: is a shorthand for . Doesn't sound like much but it's great. You'll like it. now respects the 'if' attribute Using 'with' and 'field' on a parameter works more sensibly now -- DRYML will never merge with attributes and field attributes New semantics for scoped variables. Scoped variables must be declared at the start of the scope. Assignments and reads always go back to the scope where that variable was declared. Fix to (i.e. one or more whitespace chars) being ignored Removed feature from add_classes helper that was converting all _ to -. Closes #11 param='x' now adds class='x' to the output. Closes #22. Doesn't add a css class if the param name is the same as the tag name, or is 'default' Fixes to errors when reporting syntax error : ) Now raises an error rather than outputting nonsensical name attributes on form inputs Removed incorrect leading '/' on template paths (e.g. in logs, stack traces) Fix -- was accepting close tags that are a prefix of the start tags, e.g. ... Rapid tag Library Rapid generators utilising the new DRYML generators feature. Pages, cards, forms, and the main navigation tag, are all generated now. New layout mechanism, and simplified tag. Together with the Clean theme, it is not very easy to create column based layouts. As a result, the "layout" attribute (to ) is gone, as are tags like . The standard tag now has just a parameter. Specific pages might add or themselves. As a result of the switch to generators and the simplified page-layout stuff, there's quite a lot of change in Rapid.

will include the flash messages at the top of the section *unless* they are rendered by a sub-section or have been rendered already Update forms with not render if the user doesn't have permission Removed
-- the "Edit" link now goes to action="edit" (was linking to the show page) is now better at guessing the label to use, also now supports to downcase the label. is gone - hooray for overflow: hidden Added do to as in: New tag creates a form with a , non-editable fields are skipped (used keep them in but to drop back to views). displays nothing if the object is not viewable. Default card has various improvements. New attribute Fix: merge-attrs was missing on the belongs_to view now supports a custom ajax message and configures the ajax spinner to appear near the checkbox. Fix: incorrect use of
is now
and only has the special behaviour if you give a 'fields' attribute or '' parameter. Otherwise it's just like a static tag. for dates and times no longer break when the context is nil. - unless-none attribute is gone. user if-any now takes a 'name' attribute takes a 'subsite' attribute Rake tasks New task hobo:fixdryml (see DRYML section above) dump_fixtures is now hobo:fixtures:dump Hobo models Automatically declares the field 'position :integer' if the model acts_as_list. never_show declarations are now inherited Fix: def_scope was broken when the scope name ended '?' Fix: Hobo broke the 'guard_protected_attributes' optional parameter to attributes=. (this was breaking attachment_fu) Fix: assigning Date and Time objects in mass-assignment was broken. User model Newly generated user models (hobo_user_model generator) now give create permission to all by default (to enable signup). logins_count renamed to login_count (Hobo manages this field for you if it exists). Core extensions Module#alias_tag_chain, which never should have been there is gone. (It's not needed now that camel-case tags have gone). === Release 0.6.4 === Fix: In-place-editors were not working with the new version of Scriptaculous The default fade effect on in-place-editors is now disabled now has a title === Release 0.6.3 === New feature: subsites, i.e. namespaced routes, plus support in the controller and view layers. Subsites are created automatically for any directories found in app/controllers. Links default to the current subsite unless you give a subite="..." attribute. The taglib app/views//.dryml is automatically included in every page in the subsite. The out-of-box app is not in great shape in this release, mostly due to problems with the theme. We haven't fixed it because the theme system going to change radically in Hobo 0.7 New version of lowpro, compatible with Prototype 1.6 (rev 267) Change to hobo command: hobo [...options...] app-name instead of hobo app-name [...options...] Migration generator Automatically ignores non-Hobo models (and associated tables) Hobo::Migrations.ignore_models is now deprecated. Use Hobo::Migrations.ignore to list models that should be ignored. The associated tables are ignored too (rarely needed, as these are probably not Hobo models anyway) Hobo::Migrations.ignore_tables is still supported Fix: problems with going back to a nil default from a non-nil default. Hobo model generator In line with Rails 2.0, the timestamps declaration is now included by default (it's generally something every model should have). hobo_base.css Removed over-zealous styling of too many elements. hobo_rapid.css Change of class names for validation errors. hobo_rapid.js Now silently ignores update to non-existent part. This is convenient when parts are being added dynamically, but may prove to be a mistake :-) Global variable controllerNames is gone. Now use calls to Hobo.pluralise. (Gee I guess we should really standardise on American spellings) The 'fade' parameter to removeButton is now an option. Confirmation is now optional too. Hobo.partFor returns the part containing a given element. Used in the new update="self" feature. LowPro behaviour HasManyThroughInput. This is badly named and will change. Core extensions alias_tag_chain is like alias_method_chain but for DRYML tags SafeNil Now more efficient (thanks to "steve d" -- http://coderrr.wordpress.com) Fix when used with DelegateClass New method #implies on booleans. Borrowed from Eiffel. Useful in permission methods. true.implies false #=> false true.implies true #=> true false.implies x #=> true Hash#map_hash. The block is passed only the value if the arity is 1. DRYML The ability to define tags in Ruby is now removed Tag extension: This encapsulates the alias_method_chain pattern. The tag can make a call to to get the old behaviour. alias_current_as is gone -- replaced by extend_with Fix: some DRYML attributes were leaking through to the output HTML part_locals can now be passed instance variable names, e.g. part_locals="@user". Note that inside the part this creates a local variable "user". Don't user @user inside the part. It's just a convenience to avoid the need to do Fix: failure to accumulate CSS class names when merging attributes. DRYML now gives the type returned by #field_type (when available) over this.class Fix: when overriding a parameter, the of the new parameter would incorrectly provide the old tagbody which should have been overridden. hoboParts variable is now set by rather than being hard wired in the output from the DRYML compiler. Fix: caching problems with tags imported by the include_tablib directive. AJAX Parts Calls to parts, along with the part-state variables are now logged. Can now say part="self" when a tag wants to update the part it is contained in (useful for re-usable tags). Rich data types All rich data types now register themselves with Hobo, e.g. class Hobo::EmailAddress < String COLUMN_TYPE = :string ... end Hobo.field_types[:email_address] = Hobo::EmailAddress New type builder - enum_string. e.g. fields do gender enum_string(:male, :female) end You can then do, e.g. if current_user.gender.male? (You also automatically get select menu's in your views) Hobo models In fields declaration: Got rid of weird thing where providing :length meant the type defaulted to :string Can now give classes as well as symbolic names for column types. Mass attribute assignment extended to support some features that were in the model controller. e.g. Dates can be represented as Hashes of month, day etc. Chronic will be used to parse dates if available. Object references (e.g. belongs_to relationships) can be set with "@" as before. "fields do" can optionally be used with a parameter if you don't like the instance_eval hackery: fields do |f| f.name :string end belongs_to can be given :null => false, which is passed through to the migration generator. New method #column returns the meta-data for the named column. #find now returns arrays with a #member_class method def_scope Chained scopes on a class didn't work at all -- now fixed, e.g. Posts.recent.by_author.find(:all) Fix: def_scope with sql parameter interpolation was broken. #changed_fields, which was next to useless, replaced with #only_changed_fields, which is used to assert that only the given fields have changed. Hobo user model The module is renamed from Hobo::AuthenticatedUser to just Hobo::User It is no longer possible to set the login attribute by passing a symbol to hobo_user_model. Go back to using set_login_attr. Didn't work out. It happens sometimes. Helpers #subsite returns the name of the current subsite. #object_url can now be passed the siubsite, e.g. :subsite => "admin" #object_url can only be passed a single hash of options now (could be passed any ammount before) #dom_id now returns "" when a dom_id cannot be generated (used to raise an error) #map_this now works with ranges (used by DRYML's repeat) #current_page_url returns request.request_uri without the query string #query_params now returns a HashWithIndifferentAccess Hobo.dom_id now works better with non-hobo models Permission System Fix: view permission was causing errors with non-hobo models. Now defaults to viewable. Hobo Controller include_tablib accepts symbols as well as strings #redirect_to now forwards all params to object_url when not given a String, Symbol or Hash #hobo_ajax_response no longer need be passed a dryml this Model controller Multiple model creates / updates are gone from the controller layer. Hobo now uses good ol' Rails mass attribute assignment. Coping with multiple object updates should be handled in the model layer. Some features from the model controller have been moved to the model layer, and more will be added in the future. Attempts to automatically re-render the correct page after a validation error on create / update using a form parameter "page_path", which the tag provides in a hidden field. Previously assumed the form came from the new / edit action. Automatic pagination is now only applied to appropriate mime-types. Add mime-types to Hobo::ModelController.PAGINATE_FORMATS to have them paginated. New declaration 'auto_actions' allows you to select which actions Hobo provides for you automatically. # White list auto_actions :show, :index or # Black list auto_action :all, :except => [ :new_comment ] You can use :collections to add/remove all collection actions in either the black or white list. New declaration 'index_action' declares a new index-like action (similar to show_action) index_action, show_action and web_method can now all be given blocks, rather than defining a method of the same name: show_action :summary do hobo_show Post.find(params[:id], :include => :comments) end Web methods now automatically respond with hobo_ajax_response if the method does not respond. #search Now less magic (i.e. doesn't operate by side-effecting). It now returns a condition string suitable to be passed to :conditions. Can be given a model as the first argument to search on a different model (e.g. for show-collection actions). Fix: :paginate => false was broken #create, #update and #destroy now set flash messages by default (only on "wants.html" requests) used as the default permission denied response. used as the default 404 response. User controller Added various customisation options to login and signup On login, redirect to #home_page -- you can override this on your controllers. The actual name of the login attribute (e.g. "email", "username") is now used in flash messages. hobo_logout can now be given a block to customise the response. Fixes for validation errors on signup. Routing Routes for non-existent actions are not generated. Tag library: Core tags will wrap its content in ther tag specified by tag="..." if when="..." is true. Fix: -- was behaving like Tag library: Rapid now has params
new attribute 'empty' -- when given the table is rendered even when there are items in the collection. now respects view permission properly now does a #strip to the output -- new attribute if_any - set to true to output nothing if the count is zero. Tag library: Rapid documents The 'document' tags like
,
now supports tempalte parameters for each cell when given a 'fields' attribute, e.g. ( might seem like a better name, but we wanted to be compatible with so it's easy to flip back and forth). tag now respects view permission. now only renders the link if the current user has the required create permission. now supports attribute 'truncate' now supports a 'format' attribute - a strftime style format string. New tag . Sometimes permissions are a view layer concern - you actually want to say "these colors, this logo, etc. are only to be seen by the administrator". New tag . An easy way to say either "You have 3 posts in this thread" or "Fred Blogs has 3 posts in this thread", depending on whether Fred Blogs is the current user. Fixes to the tags in rapid_documents to avoid evaling tagbody twice. fixed (was outputing hidden fields even when the field existed in the form). Also now support "for_query_string" attribute, to output hidden fields for the name/value pairs in the current query string. now sets a scoped variable "in_form" so tags can behave differently when they are inside a form (FieldList does this). for datetime and date now supports the same attributes as the equivalent rails helpers. e.g. you can change the order of the fields. can now be passed an array of records in the "options" attribute (instead of retrieving the entire target table from the DB). Fixes to page navigation upgraded to cope with multiple user models. Rapid pages: Various new template params made available, including many on login and signup pages. updated for multiple user models fix to ajax updating of record count New css classes added to and added to Fix to new link in tag removed from default ajax progress. Dryml Important change ommitted from 0.6 changelog - attributes passed to the tag that are not in the tags declared attributes are available in a local variable "attributes" (used to be called "options"). can now assign to dotted named (object attributes) as well as locals, and can have controll attributes on it (e.g. if) Fix to replacing template parameters that are themselves templates. When a boolean is in context, this_type is now always TrueClass (never FalseClass even if the value is false). TrueClass is the Hobo boolean type. #render_tag on a page renderer object (Dryml internals) now returns false. This alows Hobo's controller to say "call this tag if it exists, otherwise..." Rich types Registered rich types can now provide there own validations that get added to the model automatically. E.g. Hobo::EmailAddress automatically validates the content as a valid email address. Hobo helpers New helper query_params returns a hash of parameters extracted from the query string only (#params returns route-based parameters too). Only works with simple name=value parameters. === Release 0.6.1 === Multiple user models Hobo now supports multiple user models, with independent sign-up / log-in/out for each. The controller needs to declare hobo_user_controller instead of hobo_model_controller (it still has all the hobo_model_controller features). e.g. class AdminsController; hobo_user_controller; end Hobo routing will automatically give you /admin_login /admin_logout /admin_signup Note this controller will now filter logging of passwords. The model needs to include Hobo::AuthenticatedUser and declare a login attribute with, e.g. set_login_attr :email The hobo_front_controller generator no longer generates anything related to users - it's now just the fron page and search page. There is a new hobo_user_model generator to create these controllers. The global value Hobo.user_model is gone Rapid now has and templates. They're not so customisable just now but you can of course replace them completely with your own views. Misc fixes Search was broken The 'hobo' command tried to connect to the DB, which was a problem as you'd had no chance to configure database.yml Rapid Fix: reset_form and refocus form options
now supports @fields, allowing you to give a bunch of field names and automatically have a table with a column for each of those fields. There's also a param that can be used to have a delete button and edit link on each row. As usual there's a ton of customisation options - see the source. is now and takes flags @plural and @lowercase and have better automatic css classes Restored old behaviour where would display nothing when there's only one page. Finally created Small cleanups in the rapid pages New tag used in
to iterate over the column headings. for Time objects now supports @format - a strftime style format string. Migration generator Fix: Edge Rails now dumps out in sexy format, which was freaking the migration generator. You can now configure the generator to completely ignore specified tables and models. In environment.rb do Hobo::Migrations.ignore = %w(red_fish blue_fish) That will ignore the models RedFish and BlueFish, and the tables red_fishes and blue_fishes To ignore just tables, assign an array of their names to Hobo::Migrations.ignore_tables To ignore just models, assign an array of the class names to Hobo::Migrations.ignore_models New secure ajax parts mechanism The new mechanism stores the part state in a base 64 encoded string, complete with an SHA1 (by default) digest, so malicious tampering with the part state is prevented. Parts can now capture the state of local variables along with the DRYML context. Give a list of locals you wish to capture in the 'part_locals' attribute. e.g.
...
(the inability to do this was a serious limitation of the previous mechanism) Core extensions Added Methodphitamine and removed omap, oselect, ofind, oany oall. See http://jicksta.com/articles/2007/08/04/the-methodphitamine DRYML merge_attrs fixed to not complain about nils Fix: css classes were not accumulated in some template parameter situations Hobo module #type_name renamed to #type_id #object_from_dom_id will now return classes when the id has no, er, id. As in Hobo.object_from_dom_id("blog_post") #=> BlogPost Similarly, #dom_id generates those kind of ID for classes === 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 attribute, 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