=== Upgrading to a new version of Hobo === Once you have installed a new version of Hobo, you may wish to run rake hobo:run_standard_generators or rake hobo:run_invite_only_generators This will run all of the standard generators, and pull in any bug fixes or enhancements to generated code. Note that this is quite likely to cause conflicts, so it is highly recommended that you have your code backed up and in a change control system such as git or subversion. === Hobo 1.1 === The biggest change to Hobo 1.1 is that DRYML has been split into it's own gem and may now be used independently of Hobo or Rails: Dryml.render("<html><%= this %>></html>", {:this => something}) Automatic scopes has gained any\_of\_: Person.any_of_friends(Jack, Jill) The default password validation has been changed to 6 characters, one of which must not be lowercase. Luckily, we also made the password validation easier to change. See [Bug #638](https://hobo.lighthouseapp.com/projects/8324/tickets/638) for more information. The `input-many`, `name-one` and `sortable-collection` tags have been updated. See the documentation for more details. New tags have been added: `sortable-input-many`, `login-form`. Some css class names have been changed. Hobo 1.0 creates class names with the '[]' characters, which is technically illegal, although supported by all browsers. However, this does cause problems with some third party libraries, such as JQuery. All code changes may viewed on the [github log](https://github.com/tablatom/hobo/compare/v1.0.2...v1.0.3) === Hobo 1.0.3 === This is a security release. All applications that use the reset password functionality should upgrade. To patch the vulnerability, two changes have been made. First of all, the lifecycle key hash mechanism has been changed. Existing lifecycle keys will become invalid after you upgrade. Lifecycle keys are typically short lived, so this is unlikely to be a problem for most applications. Secondly, lifecycle keys are now cleared on every transition to avoid replay vulnerabilities. This new behaviour may be avoided by added the `:dont_clear_key => true` option to a transition. More information about the vulnerability can be viewed on the [bug report](https://hobo.lighthouseapp.com/projects/8324/tickets/666-user-model-secure-links-have-low-security). All code changes may viewed on the [github log](https://github.com/tablatom/hobo/compare/v1.0.2...v1.0.3) === Hobo 1.0.2 === This release is almost identical to 1.0.1 except that it updates the version requirements to exclude Rails3. Hobo does not currently work with Rails3, although we are working on it. This release silences some warnings produced when running with Rails 2.3.10. This release contains preliminary support for Ruby 1.9.2, although you may encounter problems if you use Single Type Inheritance (STI) models. A few very minor bug fixes have also been included. See the [github log](https://github.com/tablatom/hobo/compare/v1.0.1...v1.0.2) for more details. === Hobo 1.0.1 === This version contains two speedups: one fix that reduces the number of database accesses by Matt Jones and one that speeds up compilation of DRYML by Petteri Räty. This version also contains several bug fixes. See the [github log](http://github.com/tablatom/hobo/tree/v1.0.1) for more details. === Hobo 1.0.0 === Drumm-roll! Trumpets! Fanfare! We did it : ) Hobo 1.0.0 is the same as Hobo 0.9.106 except for documentation updates and [this tiny commit](http://github.com/tablatom/hobo/commit/ba9d2cc60fad2e45c7006c31492607882f568763). === Hobo 0.9.106 === Three small bug fixes. See the Git log for more details. http://github.com/tablatom/hobo/commits/v0.9.106 === Hobo 0.9.105 === Iterating quickly now so we can cut this off as soon as possible. [#608](https://hobo.lighthouseapp.com/projects/8324/tickets/608): One of the IE7 fixes was too aggressive, and broke input-many. === Hobo 0.9.104 (AKA 1.0RC3) === [#604](https://hobo.lighthouseapp.com/projects/8324/tickets/604): The new input-many introduced in 0.9.103 had issues with >10 elements, several issues running with IE7 and an issue with its javascript callbacks. [#537](https://hobo.lighthouseapp.com/projects/8324/tickets/537): `x._?.to_s` now returns nil rather than a blank string [#592](https://hobo.lighthouseapp.com/projects/8324/tickets/592): If you previously had a snippet such as this: <table fields="this, date, account.login"> <login-view:> ... </login-view:> </table> You now have to use: <table fields="this, date, account.login"> <account-login-view:> ... </account-login-view:> </table> The same change has been applied to `<field-list>` [#568](https://hobo.lighthouseapp.com/projects/8324/tickets/568): `hobo_index` now supports the `:scope` option See also the [git log](http://github.com/tablatom/hobo/commits/v0.9.104) === Hobo 0.9.103 (AKA 1.0.RC2) === ### Warning If you are on Rails 2.3.5 and are running Hobo as a plugin, please check out bug [#574](https://hobo.lighthouseapp.com/projects/8324/tickets/574-rails-235-b0rks-our-rake-tasks-running-on-edge-hobo) for a workaround you need to apply to your Rakefile. NOTE: fixed in 0.9.104 ### Bugs This release fixes a couple of serious bugs: [565](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/565) and [567](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/567). ### Input-Many & has-many :through The `<input-many>` tag in Rapid has been replaced with a version ported from the `<hjq-input-many>` tag in Hobo-JQuery. This brings the following enhancements: - it supports 0 length associations - input-many's may be nested inside of other input-many's - it allows the (+) and (-) buttons to be customized - it provides a default for the `item` parameter - it copies from a template rather than cloning the current item and clearing it - the template may be overridden - id's of textareas and selects and other non-input's are adjusted properly - classdata for inner elements updated The new `<input-many>` tag differs from `<hjq-input-many>` in that: - it's written in prototype.js rather than in jquery - it doesn't have the delayed initialization feature - the name of the main parameter is `default` rather than `item` - hjq-input-many allows you to provide javascript callbacks. input-many fires rapid:add, rapid:change and rapid:remove events that can be hooked. You will have to ensure that your hobo-rapid.js and clean.css files are updated in your application. === Hobo 0.9.101/0.9.102 (AKA 1.0.BROWN_PAPER_BAG) === Yes, that was embarrassing. How the test suite failed to catch that one is mind blowing. === Hobo 0.9.100 (AKA 1.0.RC1) === Deletions: - Children must now be specified in the viewhints. Hobo no longer uses the presence of :dependent => :destroy to determine the primary child association. - The bundles feature of Hobo which never really worked and was never documented has been removed from this release. - The message "You must activate your account before you can log in. Please check your email." which used to be added to the flash message when a user has signed up has been removed from `hobo_do_signup`. - The fix for [#556](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/556) means that the migration generator now ignores all models that have a `hobo_model` declaration but not a `fields` declaration. If you have any models that do not have a fields declaration (join tables, for example), you may wish to add a blank fields declaration. Major enhancements: - Hobo now supports Ruby 1.9.1. Problems have been encountered with Ruby 1.9.1 and Rails 2.3.4. Rails 2.3.3 and 2.3.5 work fine. - Hobo has been tested against the new Rails 2.3.5. JRuby users may encounter [Rails bug 3497](https://rails.lighthouseapp.com/projects/8994/tickets/3497) - Rails 2.2 is still supported for this release. Support for 2.2 may be dropped post-1.0. - Translations (ie, the ht functions) has now been moved into its own module. To access the translation functions from elsewhere use `Hobo::Translations.ht`. Alternatively, including the Hobo::Translations module into your class will give you `ht` as a local instance method. (This is one of the things the `hobo_controller` declaration does.) - `rake hobo:run_invite_only_generators` was added as an alternative to `rake hobo:run_standard_generators` for those who created their application with the `--invite-only` flag - [#409](https://hobo.lighthouseapp.com/projects/8324/tickets/409) The `<editor>` tag has been modified to display the `to_s` representation of the object while in edit mode. The `to_html` representation is still used in view mode. The editor tag for HTML columns has been modified to remove the heavy sanitizing that was previously performed. HtmlString will sanitize before saving to the database. You need to update your hobo-rapid.js for this fix. Run `rake hobo:run_standard_generators` or copy the file directly from [github](http://github.com/tablatom/hobo/blob/master/hobo/rails_generators/hobo_rapid/templates/hobo-rapid.js) - [#296](https://hobo.lighthouseapp.com/projects/8324/tickets/296) The migration generator now fully understands HABTM join tables. Note that the "decorated join table" functionality that was deprecated in Rails 2.3 is NOT supported. - [#475](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/475) User-defined rich types are now loaded from `RAILS_ROOT/app/rich_types`, if it exists. - EnumString's can now be translated. The [manual](http://cookbook.hobocentral.net/manual/hobofields/rich_types) has been updated with the details. - ViewHint's can now be translated. Well, they mostly could in 0.9, but it has been cleaned up and [documented with ViewHints](http://cookbook.hobocentral.net/manual/viewhints). - Lifecycle states can now be translated. The key is `#{table_name}.states.#{state}` Transitions use the key `#{table_name}.actions.#{transition}` Major bug fixes: - [#537](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/537) The `._?.` "smart dot" now returns 'nil' rather than calling its trailing function more often than it used to, more closely matching its documentation. - [#457](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/457) ie7-recalc.js has been updated to improve compatibility with IE6. Please update the copy inside of your application, either by running `rake hobo:run_standard_generators` or by copying the file directly from [github](http://github.com/tablatom/hobo/blob/master/hobo/rails_generators/hobo_rapid/templates/ie7-recalc.js) - [#512](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/512) Hobo now has better compatibility with non-DRYML templates Minor enhancements: - [#554](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/554) The transition-buttons tag no longer displays transitions that are not `:available_to` the user. - [#536](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/536) documentation for field-list more closely matches reality - [#536](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/543) i18n has been silenced. It's messages can be made to reappear on the log via `HOBO_VERBOSE_TRANSLATIONS`. - [#555](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/555) Specifying ignore_index :foo will ignore the index named 'foo' on the model when generating migrations - handy for indexes that can't be generated automatically (with a prefix length on MySQL, for instance) or existing indexes in legacy tables. See also the [git log](http://github.com/tablatom/hobo/commits/v0.9.100) === Hobo 0.9.0 === Major enhancements: - Internationalization! Through the hard work of soey and Spiralis, we now have internationalization support in Hobo. The manual page is on the [cookbook](http://cookbook.hobocentral.net/manual/i18n). Locales are available on [github](http://github.com/Spiralis/hobo-i18n-locales). - Index generation: Matt Jones' automatic index generation code has been merged. The default Rails index names are very long, so this is unlikely to work well on Oracle, which has a 30 character limit. Testing against Postgres, Oracle, SQL Server and JDBC has been extremely limited. To generate indices run script/generate hobo_migration. - New projects now have a summary page on /front/summary that provides application information to the administrator. Current projects may add this action by running the `hobo_front_controller` generator. - STI derived classes can add additional fields to their parent class with the fields block. Note that the "can't generate a migration for STI base and derived classes all at once" issue still applies. In general, STI handling should now work much better. - [Bug 464](https://hobo.lighthouseapp.com/projects/8324/tickets/464-transition-buttons-should-have-a-option-to-link-to-forms-instead-for-transitions-that-take-parameters) The transition-buttons tag now generates buttons that link to the transition page for transitions that require parameters. - [Bug 532](https://hobo.lighthouseapp.com/projects/8324/tickets/532) In previous versions, you had to add the new HTML5 tags to RAILS_ROOT/config/dryml_static_tags.txt. This version whitelists all HTML5 tags except for aside, section, header and footer, which conflict with existing Rapid tags. Major bug fixes: - [Bug 530](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/530) is a critical bug for invite-only projects. To incorporate the fix, you must rerun your generators or follow the instructions in the [commit](http://github.com/tablatom/hobo/commit/17247eac8a78f8b36dcc3b9684a3e4ec8da32a23) - [Bug 480](https://hobo.lighthouseapp.com/projects/8324/tickets/480-find_owner_and_association-method-for-has_many-associations) Owner actions now work with has_many associations - [Bug 516](https://hobo.lighthouseapp.com/projects/8324/tickets/516-association-name-as-parameter-in-lifecycle-step-almost-works) Specifying a belongs_to association as a lifecycle param works; it appears as a select-one on the generated page. - [Bug 515](https://hobo.lighthouseapp.com/projects/8324/tickets/515-virtual-boolean-field-uninitialized-constant-hobobooleancolumn_type) Virtual :boolean fields declared with attr_accessor now work - [Bug 484](https://hobo.lighthouseapp.com/projects/8324/tickets/484-transition-actions-with-key-fail-if-model-isnt-visible-to-guests) Transition actions that require a key no longer check if the model is visible to Guest - [Bug 485](https://hobo.lighthouseapp.com/projects/8324/tickets/485-make-lifecycles-on-sti-subclasses-behave) Lifecycle support on STI models works now. Note that derived classes DO NOT inherit any of the parent lifecycle implementation. - [Bug 387](https://hobo.lighthouseapp.com/projects/8324/tickets/387-inheritance-sti-models-name-not-propagating) STI derived classes now inherit settings like name_attribute correctly. - [Bug 533](https://hobo.lighthouseapp.com/projects/8324/tickets/533-remove-id-from-hidden-field-for-check-box) The hidden field generated with a checkbox input shouldn't have an ID. - [Bug 526](https://hobo.lighthouseapp.com/projects/8324/tickets/526-routing-error-does-not-render-not-found-page) Routing errors now render not-found-page, rather than the default Rails routing error message. Minor Enhancements: - Aside collections now have a new-link at the bottom (inside the preview-with-more) [#421](https://hobo.lighthouseapp.com/projects/8324/tickets/421-auto_actions_for-doesnt-create-add-button-in-sidebar) - the manual now includes a Generators section, and a subsite tutorial has been added. - [Bug 386](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/386) and [Bug 501](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/501) have been fixed, reducing the number of extraneous migrations that the hobo_migration generator creates. These are actually Rails and/or database bugs we're working around. For instance, MySQL does not allow default values for text columns, so Rails silently ignores them. SQLite does not allow scale or precision settings on decimal fields. These types of bugs are good reasons why you should use the same type of database for development, testing and production. - A new view_hint, 'inline_booleans', controls whether boolean attributes are displayed in the header (default behavior of Rapid show pages) or inline with the rest of the field-list. You can either pass a list of field names, or 'true' (without quotes) to make all booleans inline. - hobo_show now accepts a model instance as a first parameter. This restores symmetry with the other hobo_* actions. - on Rails 2.3 and above, routes will be generated with the optional .:format suffix, and the formatted_* routes are skipped. - non-required fields that are marked :unique will now allow nil values. Minor Bug Fixes - [Bug 540](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/540) Hobo::Permissions::Associations::HasManyThroughAssociations#create! did not save as the "!" implied. See the [github log](http://github.com/bryanlarsen/hobo/commits/v0.9.0) === Hobo 0.8.10 === This is a brown paper bag release. The fix for Bug 473 was not properly tested. Thanks Iain Beeston for quickly sending us a patch. === Hobo 0.8.9 === Enhancements: - [precompile_taglibs](http://groups.google.com/group/hobousers/browse_thread/thread/29694e75f60c0870/6b05f75f2f7e91f5) allows you to precompile taglibs during application startup rather than on demand. - `--invite-only` options added ti generator Major bug fixes: - [Bug 461](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/461-hobo-is-not-compatible-with-firefox-35): Firefox 3.5 problems were caused by lowpro. For existing projects, you will have to update your copy of [public/javascripts/lowpro.js](http://github.com/tablatom/hobo/raw/master/hobo/rails_generators/hobo_rapid/templates/lowpro.js) - [Bug 477](http://groups.google.com/group/hobousers/browse_thread/thread/5a15288f9703a8a4/58a8dee62b237d29) caused problems when the user submitted a form from the index page. - "collection" was renamed to "collection-heading" in the Rapid generated show-page. - [Bug 473](https://hobo.lighthouseapp.com/projects/8324/tickets/473-use-timezonenow-instead-of-timenow#ticket-473-5): Hobo now uses any time zone's configured for the application rather than using the server's time zone. Minor bug fixes and enhancements: See the [github log](http://github.com/bryanlarsen/hobo/commits/v0.8.9) === Hobo 0.8.8 === Hobo 0.8.8 comes with some slight changes to the colour scheme for the "clean" theme. To apply these enhancements, you may need to run `rake hobo:run_standard_generators`. Significant bug fixes: - [Bug 422](https://hobo.lighthouseapp.com/projects/8324/tickets/422): Because of it's switch to Rack, Rails 2.3 changed the interaction between checkboxes and their accompanying hidden field. This caused us to always return "false" for a checkbox, even if it was checked. - [Bug 425](https://hobo.lighthouseapp.com/projects/8324/tickets/425): Hobo 0.8.6 removed support for the non-working big_decimal. However, this shared some code with decimal, so we removed a little bit too much code. This restores the missing editor and input for the decimal type. Minor bug fixes: - [Bug 413](https://hobo.lighthouseapp.com/projects/8324/tickets/413): add target attribute to `<nav-item>` links - [Bug 420](https://hobo.lighthouseapp.com/projects/8324/tickets/420): `acts_as_list` controls visible to Guest - [Bug 446](https://hobo.lighthouseapp.com/projects/8324/tickets/446): `<transition-button>` not working - Migration generator fix - would occasionally suggest a default migration name that already exists Minor enhancements: - [Bug 434](https://hobo.lighthouseapp.com/projects/8324/tickets/434): allow String or Hash to be passed in a :redirect optione - `key_timeout` option added to lifecycles - [Bug 437](https://hobo.lighthouseapp.com/projects/8324/tickets/437): 'options' attribute added to `<check-many>` - [Bug 424](https://hobo.lighthouseapp.com/projects/8324/tickets/424): 'limit' option added to `<select-one>` - [Bug 440](https://hobo.lighthouseapp.com/projects/8324/tickets/440): support blank Time and DateTime inputs - [Bug 423](https://hobo.lighthouseapp.com/projects/8324/tickets/423): default content for input-many - [Bug 379](https://hobo.lighthouseapp.com/projects/8324/tickets/379): multiple warning messages on email validation - [Bug 404](https://hobo.lighthouseapp.com/projects/8324/tickets/404): Extension to Hobo::Model class to check ViewHints for error validations - [Bug 415](https://hobo.lighthouseapp.com/projects/8324/tickets/415): Visiting sign-up page when logged in gives permission denied - Rapid navigation - added name attribute to `<nav-item>` to make it easier to select the current nav item in some cases (e.g. dynamic nav item text) - Rapid forms -- added url attribute to `<remote-method-button>` - HoboSupport - `Enumerable.build_hash` can now be used without a block to build a hash directly from a list of pairs === Hobo 0.8.7 === I forgot to refresh the Manifest, so this is a brown paper bag release. === 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 <select-many> -- removed use of <a-or-an> as it gets some words wrong (e.g. "an user") Rapid -- moved <or-cancel> 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 <filter-menu> (no need for a hidden tag) Rapid pages -- added <heading:> parameter to account page DRYML -- fix to merge-attrs="a, b, c" Rapid <input-many> -- added support for disable attribute Fix to <hobo-rapid-javascripts> 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 <show-page> 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 <hidden-fields> -- now honours the 'skip' attribute under all circumstances Rapid <page> -- app-stylesheet param, to make it easier to add in custom stylesheets, but have them *before* application.css Rapid <stylesheet> -- call stylesheet_link_tag once only so that asset combining is supported DRYML -- allow <include plugin="foo"/> as a shorthand for <include src="foo" plugin="foo"/> 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 <input for='boolean'> -- don't add the hidden field if the checkbox is disabled - thanks to Tola. Rapid <nav-item> -- 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 <remote-method-button> -- 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 <select-many> 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 <select-many> 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 <select-one> Rapid -- added a 'no-edit' attribute to <input> and <field-list>. Gives control over how non-editable fields are handled. - view: render the current value using the `<view>` 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 <dev-user-changer> 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 <delete-button> chosing whether to be in-place or not BREAKING (minor): removed 'type' attribute from <type-name> BREAKING (minor): Rapid -- renamed 'separator' attribute of <comma-list> to 'join' Rapid -- moved live-search and filter-menu tags into rapid_plus Rapid -- removed unused <belongs-to-view>. Renamed <has-many-view> to <collection-view>, made it polymorphic, and extracted the default definition as <links-for-collection> Rapid -- tweak to behaviour of <name>. Is now more sensible when called on a non-AR class Re-organisation and documentation for Rapid Document Tags BREAKING: Deleted <panel> 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 <with-fields> (and therefore, <field-list> and <table field='...'>) Rapid -- made <select-many> 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 <custom-scripts:> 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 <collection-input> 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 <check-many>. 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 <edit-page> 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 <change-password-form> Rapid plus -- added <preview-with-more> and <gravatar> tags Rapid -- removed unimplemented if-content attribute from base <card> Rapid -- fixed class name dash problem in <name-one> 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 -- <login-page> -- "remember me" is now on by default Fixed typo in <forgot-password-page>. 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 <select-many> now observe conditions applied to the has_many :through Rapid -- fix to double-escaping of names in <select-one> merge-attrs on <section-group> Rapid -- added if-present attribute to <name> to supress the nil-view if there is no name Used in <name-one> 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 <card> parameter from 'description' to 'content' Rapid -- adding multipart attribute to <form>. Usage: <form multipart> 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 <remote-method-button> -- the confirm attribute was incorrectly changing the button into an ajax button Rapid -- <select-menu> 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 <after-submit stay-here/> (occured after a validation error) New tag <input-all> for situations where you want input for every item in an existing collection (without the +/- buttons that <input-many> 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 <name-one>: - sensible defaults for complete-target and completer (you can now use <name-one> as a drop-in replacement for <select-one> - The <name> of the referenced object is included in the input box if there is one Rapid -- improved grammar (use of 'a' or 'an') in <select-many> 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 <input-many> 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 <empty-collection-message> should use <div> instead of <p>, 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 <field-names-where-true> on <show-page> DRYML - fix to using <extend> 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 <error-messages/> 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 <create-button> 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 <extend> tag, e.g. instead of the rather confusing: <def tag="page" extend-with="app"> <page-without-app> we now have <extend tag="page"> <old-page> Also works with polymorphic tags, e.g. <extend tag="card" for="Product"> Polymorphic tags: new mechanism for defining polymorphic tags. <def tag="foo" polymorphic> ... "base" definition here ... </def> <def tag="foo" for="Product"> ... in here you can call <foo> and it's not a recursive call but a call to the base definition ... </def> "without" attributes: <page without-live-search> is a shorthand for <page><live-search: replace/>. Doesn't sound like much but it's great. You'll like it. <set> 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 <foo:> </foo:> (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. <foo>...</fo> 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 <page> tag. Together with the Clean theme, it is not very easy to create column based layouts. As a result, the "layout" attribute (to <page>) is gone, as are tags like <aside-layout>. The standard <page> tag now has just a <content:> parameter. Specific pages might add <content-header:> or <content-body:> themselves. As a result of the switch to generators and the simplified page-layout stuff, there's quite a lot of change in Rapid. <section with-flash-messages> 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 <nav> tag Changed <a-or-an> to give you 'a hotel' not 'an hotel' <card> now always renders a link if there is a show action. Closes #54 <collection> is no longer a polymorphic tag. Drag and drop support moved into separate tag: <sortable-collection>. Got rid of <collection-preview> <stylesheet> tag now calls Rails helper stylesheet_link_tag name to construct the link tag. This change was made so that the css files are automatically cached using the timestamp mechanism, e.g. application.css?1218209632. The media attribute is now 'screen' instead of 'all' by default Wrapped the output of <count> in a <span class='count'> Renamed <name-for-collection> to <collection-name> and added a dasherize parameter <ul> is gone from Rapid and is just a static tag again. Just do <ul><li repeat> New version of IE7.js (http://ie7-js.googlecode.com/svn/trunk/lib/IE7.js rev 29) <with-fields> (and hence <field-list>) now display fields in the order declared in the model <card> and <show-page> no longer include the created_at timestamp Added labels and titleize attributes to <editor for='HoboFields::EnumString'> Added force (no edit check) attribute to <input> <hidden-form-field> (formerly <hidden-field>) is gone Fix to default label on non-ajax <remote-method-button> Now outputs <span> not <div> to wrap field-with-errors (<div> is invalid) Added <transition-buttons> and <transition-button> (lifecycles) Added <dev-user-changer> when in development mode if there is a user model <with-fields> now skips deleted_at by default <name> now properly respects :name => true (in the model) Optimised <count> so that it doesn't hit the DB for already loaded collections Removed <heading> and <sub-heading> and <article> Allowing <def tag=input for=MyModel> to customise inputs for any belongs_to :my_model Changed 'There are no whatsits' message to 'No whatsits to display' Moved to nicedit (nicedit.com) for HTML inputs and editors. Dropped all TinyMCE stuff. It turns out that this change too will be temporary, as nicedit is a bit lacking. It seems that the YUI Editor will be the editor of choice, but we'll support it with a plugin, rather than make it part of core Hobo. Added default empty message to <table-plus> Rename <belongs-to-menu-editor> to <select-one-editor> and improvements. Removed "View" link. Made <view> fall back on to_s rather than giving up select-many: disabled options in the select drop down instead of trying to hide them. Fixed a problem in safari where 'choose xxx...' would get added by mistake to the list New 'options' attribute for <integer-select-editor> If no <input> tag found, fall back on an input for the COLUMN_TYPE if defined Model Controller The collection actions, e.g. PostController#comments, PostController#new_comment and PostController#create_comment have now been moved to the controller that looks after that particular model, e.g. CommentsController#index_for_post, CommentsController#new_for_post and CommentsController#create_for_post. The old way was just plain wrong. Named instance var (e.g. @post) is set in body of web methods Factored out redirect code into #redirect_after_submit Ensure default ordering is respected when paginating Fix to checking in superclass for permission_denied and not_found methods Migration generator Fixed bug with :null setting Ignore sessions table when using the ActiveRecord session store. Closes #187. Fix to loading models that was causing stack overflows (double alias_method_chain) Ignore schema_migrations table Fix to loading of namespaced models Fix to 'm' option on Windows hobo_front_conroller -- removed search page Clean theme Fix to form submit buttons in IE Fixed problem with height of user-changer hobo-rapid.js Hobo.applyEvents is gone - now uses lowpro for all JS events Only do resetForm on success. Add new onSuccess callback to Hobo.ajaxRequest Routing Routes are now reloaded automaticaly on every request in development mode, but you can turn this off if it gets slow. (See hobo generator, below) Fixes to lifecycle routes, so that object_url(obj, :signup, :method => 'post') works Clean-up so that :format => false doesn't sneak into route options Better error reporting if DB problems occur during routing Doesn't try to load routes when running script/destroy Subsites New hobo_subsite generator, and introduced app/views/taglibs/front_site.dryml as the taglib for non-subsite pages. The subsite taglib for, say, admin, is not admin_site.dryml, not admin.dryml Added Hobo.subsites method to enumerate available subsites. Used by Hobo::ModelRouter hobo generator Added config option in initializers/hobo.rb to choose if routes are reloaded on every request (default is yes) Hobo::ModelRouter.reload_routes_on_every_request = true Now generates a blank application.css User controller The standard actions (login, signup, logout, forgot_password, reset_password) now respect the auto_actions declaration. Closes #80 Fix to generate_tag_reference.rake so that maruku is not required when not being used Lifecycles Moving default user lifecycle (signup) from Hobo::User into the generated model file (hobo_user_model generator). Closes #148 Fixed problem with lifecycle keys when timezone was not configured. Now raises an error in that case. Closes #146 Changing lifecycle action names from signup_page (the form page) and signup (the post action), to signup (the form page) and do_signup (th epost action) Hobo models Removed :manged => true option for has_many :through. ActiveRecord now does behaves like this by default. Adding member_class meta-data when calling find_by_sql. Closes #231. Moved Hobo.models to Hobo::Model.all_models, (also added Hobo::ModelController.all_controllers) Added #foo_is? for every belongs_to :foo record.foo_is?(x) is like record.foo == x but does not force foo to load Have an SEO friendly URL (#to_param) by default on any model with a name attribute Added #acting_user, virtual attribute set to the user that does a user_update, user_save etc. Include virtual attributes (e.g. a #name method) when guessing name, description etc. HoboFields Removed RedCloth monkey-patch. Not needed (and broken) in RedCloth 4 Support :null => true/false on belongs_to Making HoboFields::HtmlString a subclass of HoboFields::Text Adding :decimal as another name for BigDecimal Removing symlink_plugins script now that it turns out there's no need for symlinks Just clone the whole hobo repo to vendor/plugins/hobo hobo_user_model generator Removed permission methods that are never used Replaced set_admin_on_forst_user with the actual code (a one liner) for greater clarity Added forgotton password mailer Adding email address to standard model (for forgotten password email) Scopes Goodbye def_scope (Rails now has named_scope). Made automatic scopes work with named_scope apply_scopes now works on other scopes, e.g. User.admin?.apply_scopes(...) Added by_most_recent automatic scope Added is and is_not automatic scopes Made search scope AND terms rather than OR Removed dump_fixtures rake task. See lighthouse #51 Hobo controller -- adding #call_tag (#render_tag without the render) Symlinked generators now even work when they call each other (hobo_model_resource => hobo_model) Hobo support - renamed Enumerable#search to Enumerable#map_and_find. Was clashing with the #search automatic scope Multi-model forms Hobo's support for multi-model forms has been improved, but not completed as Rails is moving in this direction too, so we need to wait and see what happens: DRYML - improvements to DRYML's mechanism to figure out name='...' attributes on form inputs Added experimental support for post.comments_by_user[a_user] Hobo models -- adding include_in_save support for transactional and validated multi-model saves Hobo models -- add origin and origin_attribute accessors, to help DRYML figure out the correct name attribute for input tags Tweaks to Hobo.get_field_path semantics Better handling of hashes wrt DRYML implicit context Valid HTML Various improvements to outputting valid HTML have been made to both DRYML and Rapid Removed use of invalid html attributes like hobo-model-id, hobo-update Empty are output as <br> when using a HTML doctype and <br /> when using XHTML Fix to site-search for better DB comptibility (Oracle in particular had a problem) Hack Rails so that generators are found in symlinked plugins (didn't this get fixed once already?\!) Bundles Pass the callers options to the Bundle#defaults Hobo Modles -- Migration generator -- exit with a warning if there are pending migrations Removed tabla theme Added Guest#login ("Guest") (used by user-changer menu) Adding #signed_up? to Hobo::User and Hobo::Guest (opposite of #guest?) All generators moved to rails_generators directory Hobo::HoboHelper -- new hook for customising URLs - base_url_for == Hobo 0.7.5 === Restructuring the git repo -- all the different gems/plugins live in the same repo now (github.com/tablatom/hobo) Change to themes - the stylesheet and tablib are now called (e.g. for the 'clean' theme) clean.css and clean.dryml New rake task generate_tag_reference. Creates simple HTML reference docs, including any inline documentation comments (found immediately above the <def>) ModelController Made it possible to have a custom #permission_denined and #not_found in ApplicationController Improved logic for figuring out redirect after destroy Fix to bug where we would turn pagination off when we shouldn't We now have a list of mime-types that we *don't* paginate for (can be extended) hobo_index now silently skips pagination when the passed finder doesn't support it Fix to auto_actions :except => :collections Fix to rendering permission denied errors Fixes for IE6 The rapid-pages now include the fabulous IE7.js when the client is IE6. http://dean.edwards.name/IE7/ The clean theme now works much better in IE6. hobo-rapid.js -- fix displaying the empty-message after a removeButton Hobo models No longer defines Model[...] (in Hobo use Model.named(foo) instead) Fix to MyHoboModel.defined_scopes sometimes returning nil Allowing belongs_to and has_one associations to be set by name during mass-assignment e.g. person.attributes = { :department => 'Sales' } Automatic scopes -- give up silently if there's a problem with the DB Fix to :managed => true option on has_many. No longer requires the through association to be declared first. Auto-completers are now working again. The tag to use is <name-one>. Should be a how-to for this availabe soon. In-place-edits are working again New controller method call_dryml_tag (added by DRYML template handler). Calls a tag and returns the result as a string. Fix to <after-submit stay-here> following a part update Bundles -- fixes to class renaming <remote-method-button> is working again Refactored the DRYML parser to make it easier to parse DRYML in other contexts Rapid: Improvements to wording on index-page Display the users name, not login in the account-nav Small tweaks to generic tags Fix: The <view> for various types was reverting to a plain String view Switching to dependency on hobofields and will_paginate as gems rather than plugins Fix: DRYML parser works again with REXML versions back to 3.1.4 Fix: Hobo No longer depends on redcloth unless you're using markdown Routing Recover from ActiveRecord::StatementInvalid (routes may not be declared). Without this you sometimes can't even run rake if something is invalid Don't do routing (and hence load models) during script/generate. This *finally* fixes the dreaded 'User is reserved by Rails' error == Hobo 0.7.4 === Switching to a new style for the changelog. Now that we're using git the commit logs are a lot better, so this file is just going to contain edited highlights of the commit log. Rapid: making <view> make more use of the to_html API from HoboFields Reworked REXML extensions. Now compatible with REXML 3.7.1.1 through 3.7.1.3 ModelController -- fix to chosing whether or not to paginate Various IE Javascript fixes Rapid, <select-many>: Additional params, and IE fix Moving the part-contexts javascripts from the very end of the output, to the end of <body> The script tag must now be output by the <page>, instead of being appended automatically by DRYML. This is done in <simple-layout/> Rapid -- removing <view for='percentage'> DRYML -- improved error reporting Hobo::Model: fix -- we were breaking inheritence of validations Model generators -- adding some helpful comments Rapid: Fix to permission check for adding to primary collection on <show-page> Rapid: removing empty message from <index-page> Rapid: Fix to enum-string editor Rapid: Fix to auto-label in <count> User model generator -- change create permission to allow admin to create another admin New lowpro version New automatic css class 'with-owner' on default <card/> Hobo::ModelController -- fix to automatic inclusion of reorder action for models that act as list Improvements to default <card> Rapid javascript: try to automatically bring back the empty-message on removing the last item from a collection Scopes: fix to apply_scopes Fix to <name-for-collection> Rapid tags: Support for the empty-message on a collection re-appearing automatically if all the items are removed by the user DRYML: scoped variables -- assigning to a variable now modifies it's value in a parent scope if it's present in one <delete-button> fix -- was incorrectly guessing 'in-place' during ajax update New tag <name-for-collection> Fix to <view for='text'/> Improvements to <table-plus> Ability to sort by name of 'this' when 'this' is one of the fields Keep table headings in when the table is empty Don't include page nav if the collection doesn't support it Improvements to rapid pages Allowing has_many associations in forms Allowing the primary collection on a show page to be provided by an instance variable (so that filtering/searching/pagination are supported) Tidy of <show-page> <index-page> -- improved wording Fixes to <index-page> <account-nav> make 'logged in as bob' a link to current_user Factored out default <collection> into <base-collection>, and fixes to <collection-preview> <base-card> -- add 'edit' link <base-card> change 'title' param to 'heading' and make it easier to provide your own <creation-details> use a div rather than a span Fix to <select-many> Fix to <select-menu> Fix to <input for='datetime'> Rapid forms: switching to <select-one> and <select-many> naming <form> -- don't include auth token on GET forms Rapid: <belongs-to-menu-editor> -- don't show 'View' link if the thing is not linkable Rapid: adding sort attribute to <belongs-to-menu-editor> Rapid: default 'no-filter' option for filter-menu Rapid: Fix to extraneous whitespace in <you> Rapid: better guess of label on <count> Rapid: Use association name rather than class name in css classes on <a> tags (when available) Rapid: Fix to use of <else> with <a> Removed 'all' method from ScopedProxy - delegates to the model class instead Fix to origin_attribute on scoped associations Fix to with_abc automatic scopes New automatic scopes 'include' and 'search', and improvements to order_by scope Scopes: fix to parameterised scopes on associations Scopes: new apply_scopes method for models and has_many associations Pass a hash of scope-name => scope-arguments (single valur or array), the result will be scoped accordingly, but only if the first argument to the scope is not blank. It's designed to be used from controllers: if a param (e.g. a search or filter) is not included in the request, the scope is not applied Hobo::ModelController -- fix to permission denied response for ajax actions Hobo::ModelController -- Fix to flash message after update Hobo::ModelController -- fix to redirection after submitting a form Hobo::ModelController -- cleaning up sorting and filtering Hobo::ModelController -- make reorder one of the automatic :write_only actions if the model has the position_column method <with-fields> better error reporting Hobo::ModelController -- adding automatic reorder action Works with acts_as_list and scriptaculous drag and drop re-ordering Hobo::Model adding :managed => true option to has_many Only valid with the :through option. Records of the joining model will be created and destroyed as required when this record is saved, in order to honour the contents of the association at save time. Hobo::Model -- adding .user_update Hobo::Model -- fix to user_find Hobo::HoboHelper -- #map_this (used by repeat) will set this_key when iterating over a hash DRYML: made this_field_reflection do a better job of figuring out the current reflection DRYML: adding this_key -- gives you the current key when <repeat>ing on a hash DRYML: Error message for invalid attributes on parameter tags, e.g. <foo: if-'...'> Hobo module - fix to permission checks on unexpected objects Hobo module -- always return false for can_create? on has_many associations that are not 'simple' (i.e. they have conditions) DRYML: Fix for replacing an overridden tag parameter Rapid pages: new submit label on show page (add to collection) Rapid pages: Add param to <show-page> Rapid pages: by default, append app-name to every title, override with full-title attribute (<base-page>) Rapid pages: <show-page> -- update primary collection count when an item is deleted Rapid pages: fix on <show-page> Rapid pages: make edit link on show-page check if the edit action is linkable Rapid forms: adding inputs (just textareas) for textile and markdown front_controller generator -- use <collection-preview> in index.dryml Rapid generics: adding support for <collection with='&MyModel'/> Rapid tags: switching to <main-nav> tag, called from simple-layout hobo_model_resource generator -- removing creating of (rails style) resource route Improvements to rapid pages Allowing has_many associations in forms Allowing the primary collection on a show page to be provided by an instance variable (so that filtering/searching/pagination are supported) Rapid: Fix to use of <else> with <a> Removed 'all' method from ScopedProxy - delegates to the model class instead Fix to origin_attribute on scoped associations Rapid tags: disabled <belongs-to-view>, new <view for='ActiveRecord::Base'> is used now Hobo::Model -- fix to reverse_refelction Rapid tags: Adding <head:> and <foot:> params to <ul> Rapid tags: Adding params to <select-many> Rapid tags: adding support for <ul empty> (force the <ul> to appear even if empty) Fix: automatic scopes not_ and "association name" were not being created Rapid forms: Renaming <name-array-input> to <select-many> (and improvements) Hobo::Model -- adding assigment by arrays of names to has_many associations Hobo::Model -- adding Model.manage_join_records Routing: fix -- don't try to load assemble.rb if ApplicationController not defined Rapid pages: Fix to body class on <new-page> Rapid pages: fix to show page Rapid pages -- fixing pluralisation of <index-page> title Adding support for 'this' psuedo-field to <with-fields> and <with-fields-names> In particular, this makes it possible to include the object itself in a table plus column Adding a general <view> for ActiveRecord objects (just <a/>) Allowing lookup of polymorphic tags to include ActiveRecord::Base or Object as a catch-all Rapid generics: make collection preview hide the show-all link if there are none <page-nav> now uses will_paginate's helper to provide much better page navigation than before. === Release 0.7.3 === hobo command -- options are now: --user-model <model-name-or-false> --svn # Use 'svn co' to checkout Hobo --create-dbs # Run rake db:create:all --hobo-src <path to hobo src> -d | --database <database> # e.g. mysql, sqlite Core extentions Extracted from Hobo into new project: HoboSupport Some notable changes: #every has gone: users.every(:name) is now users.*.name hobo generator application.dryml now has a generated <app-name> tag hobo_front_controller generator Generated "search" route is now called "site_search" Removed unused --no-user option hobo_migration_generator Removed from Hobo - now part of the HoboFields spinn-off project New generator hobo_model_resource creates a model + controller pair Rapid Javascripts Default ajax message changed to "Saving..." Hobo.ajaxRequest now takes the message as an option (was the second argument) Fix to showing the ajax spinner in the right place in IE Hobo.addUrlParams now has an option to remove specified parameters Fixes to HasManyThroughInput behaviour New behaviour supporting filtering (e.g. on index pages) using <select> tags Rich data types These are all part of the HoboFields project now Booleans are now represented by the type Hobo::Boolean which is still part of Hobo Active record extensions Monkey-patch to make AR complain less about missing classes for polymorphic associations The block-based "composable query mechanism" is gone. Named scopes are much better. Hobo's original implementation of what later became "Sexy Migrations" is gone. Hobo module utility methods Hobo.field_types and Hobo.symbolic_type_name are gone - now part of HoboFields Fixes to can_edit? Site-search: Now automatically skips searching of non-linkable models. Can now be passed an array of models (including scoped finders) to search Now renders <search-card> instead of <card> New feature: Hobo::DevController A controller that adds developer support features (not in production mode). For now it just adds a method that can be used to change the current_user: /dev/set_current_user?name=Fred+Bloggs Very useful Hobo Routing Hobo::ModelRouter.linkable? can now be used with all the routes created by Hobo. Hobo helpers object_url now always returns nil if the URL requested is not a route known to Hobo routing object_url never includes _method= in the query string dom_id is now moved to DRYML's TemplateEnvironment can_view? now utilises some simple cacheing signup_url now defaults to the linkable? no longer accepts an array as parameter Rapid helpers ajax_updater(url_or_form, message, update, options) is now ajax_updater(url_or_form, update, options) (message has become an option) DRYML DRYML integration changes -- this is a start to the work of extracting DRYML from Hobo. The fallback from a template file to a tag, e.g. from index.dryml to <index-page/> is now handled by DRYML, not by Hobo's model controller. You can customise the chosed tag by calling dryml_fallback_tag("my-tag") from your controller action The default DRYML context is now the value returned by #dryml_context (was previously the value of @this). #dryml_context returns @this by default but can be overridden. <include src="mytags" bundle="foo"> includes a taglib from the plugin that the 'foo' bundle came from, and puts into effect any class renames from that bundle (for polymorphic tags). Fix - tags with capitalised names now work <my-param:></my-param:> can now be used to clear the contents of a parameter. It's not the same as <my-param:/> (which does nothing) New psuedo parameters for insterting content in and around parameters. e.g. for a param 'title': <before-title:> and <after-title:> for insterting content immediately before and after the parameter. <append-content:> and <prepend-content:> for inserting content at the begining and end of the default content. Note these are all just syntactic sugar for things you can do already with <param-content/> and <title: replace> / <title: restore/> When changing the context with the ':' shorthand, now use dashes, not underscores (the idea being that underscores are soley for use in Ruby code e.g. <with:my-field> Control attributes <my-tag if> is equivalent to <my-tag if="&this"/> (remember these test for blank? / not blank?, not Ruby trueness) this_type now never returns AssociationReflections, this_field_reflection does this_type now returns Hobo::Boolean for boolean types. this_field_dom_id is now just dom_id -- pass an object and an attriubte, or nothing to default to this and this_field Can now do merge-params="param1, param2" to merge just the named params Fix: <foo:foo> (i.e. field name same as tag name) Fix: using alias-of with a reserved word was broken Hobo models New method Model.named to find things by name, e.g. Category.named("Cars"), also aliased as Category["Cars"] Various new methods to support permission. This moves much of the logic into the model (from Hobo::ModelController). These methods are all passed, as the first argument, the user performing the action. A Hobo::Model::PermissionDeniedError is raised if the permission check fails. Class methods: user_find -- find with view-permission check user_new -- new with create-permission check user_create -- create with create-permission check user_can_create? -- test to see if a user is allowed to create the model. Instace methods: user_can_create? user_save_changes user_view user_destroy Models now get a new_foo method for each has_one :foo The old id_name system is gone. Will be coming back in various guises (e.g. see .named above) def_scope implementation factored out into separate modules New metod #get_creator returns the value of the creator attribute (if there is one) Various features exrtacted and now part of HoboFields Scopes Note: Hobo will probably switch to has_finder which provides (nearly) all the functionality of Hobo's scopes and has a superior implementation. We'll extend has_finder to add the bits that it is missing. The implementation of scopes has been factored out into separate models. Large new set of automatically defined scopes. These are defined automatically when you call them for the first time, much like the magic finders in ActiveRecord (e.g. find_by_name_and_address): For every has_many relationship (e.g. tags) with_tag(t) -- find records that have tag c with_tags(a, b, c) -- find records that have all these tags without_tag(t) without_tags(a, b, c) For every belongs_to and has_one (e.g. manager) manager_is(m) manager_is_not(m) For every regular field (e.g. name) name_is(x) name_is_not(x) For textual fields name_contains(x) name_does_not_contain(x) name_starts(x) name_does_not_start(x) name_ends(x) name_does_not_end(x) For boolean fields (e.g. published) published not_published For the various date/time columns (these must end _at, e.g. pulished_at) published_before(x) published_after(x) published_between(x, y) And finally order_by(field_name) -- add an ORDER BY clause limit(n) -- add a LIMIT clause recent(n) -- orders by created_at and limits to n records Hobo model controller Permission and not-found errors are now handled centrally using the new rescue_from declaration in Rails. No need to worry about these in individual actions. All the hobo actions (hobo_show, hobo_new etc) are greatly simplified. Much of the logic has been moved elsewhere, so it's now a lot easier to avoid using those actions at all and still get the usual features such as permission checks, fallback on page tags etc. hobo_index now takes a "finder" (model class or scoped model class) as the first argument. If you want to retrieve the collection yourself, there's no reason to call hobo_index at all - just write a regular Rails style action. The hobo_actions don't set any extra instance variables any more beyond @this. e.g. hobo_show_collection doesn't set @owner, because you can now use this.origin As part of the previous change, #not_allowed? is gone. Some work on autocomplete - might be working now :-) auto_actions -- can now say auto_actions :write_only # just gives you create, update and destroy auto_actions :read_only # gives you all except the above three Support for scopes on declarative index actions: index_action :scope => :my_scope New method filter_by for easily adding filtering to index actions, e.g. # assuming category and price_range are scopes defined on the current model def index finder = filter_by(:category => params[:category], price_range => [params[:min_price], params[:max_price]) hobo_index finder end The old data_filters stuff is gone. This was based on the "composable query" thing which is gone too (see above). Dependency on classic_pagination is gone. Now uses will_paginate User model Hobo::UserController.user_models is now Hobo::User.user_models New method Hobo::User.default_user_model returns the user model used in various places if no model is specified. Now requires the current password to be provided when changing the password (at the model level and in the related rapid-pages) User.login_attr renamed to User.login_attribute User controller Now includes the rapid_user_pages taglib (these have been separated from the main rapid-pages taglib) New helper: logout_current_user Bundles Support for multiple bundles per plugin -- bundles can now be selective about which models and controllers they include. Adding support for: belongs_to :foo, :polymorphic => :optional Magic option names are now available inside the model and controller *instances* Bundle options with defaults now work with nested option hashes belongs_to in a bundle model can now be given an :alias option - an alias of the (parameterised) belongs_to is created so that the model has a known API Core DRYML tags <wrap> can be given a parameter="..." attribute to wrap the content in a template using the given parameter name. <repeat> can now be used with <else> (i.e. the collection was empty) Rapid tags: general New standardised API for getting metadata from collections #association_name returns th, er, name of the association. If called on a named scope it returns the original association name, not the scope name #member_class returns the (expected) class of items in the array #origin returns the object from which the collection was obtained #origin_attribute returns the name of the attribute from which the collection was obtained So, unless something has changed: collection.origin.send(collection.origin_attribute) == collection This API is made available on all association proxies, regular arrays and will_paginate collections. New taglib - rapid_generics - provides various tags used by the default pages. These tags are designed to work generically with your models, but can also be customised of course. <table> -- the "Edit" link now goes to action="edit" (was linking to the show page) <count> is now better at guessing the label to use, also now supports <count lowercase/> to downcase the label. <clearer> is gone - hooray for overflow: hidden Added do to <you> as in: <you do/> New tag <filter-menu/> creates a form with a <select>. Used for adding menu-based filters to index pages. New tag <comma-list> Rapid tags: editing <editor> now merges params and attributes (e.g. you can add your own css classes) Most ajax controls now just give "Saving..." as the default ajax message. Rapid tags: forms <form> (without an action attribute) now renders nothing if the calculated action is not linkable If you provide action="..." to <form> (i.e. a manual form) the automatic css classes are not added. <delete-button> now renders nothing if the destory action is not linkable <delete-button> now automatically switche to non-in-place delete if the thing being deleted is the top-level context if the page. New tag <select-menu> <remote-method-button> now switches to in-place mode if you give any ajax attribute (e.g. success="...") <after-submit> -- can now do <after-submit go-back> (requires session[:previous_uri]) and <after-submit stay-here> Rapid tags: navigation Now assumes will_paginate style pagination instead of classic_pagination <account-nav> now proivides a link to the account page by default <account-nav> now provides a complete set of parameters for customisation Rapid tags: pages login, signup and account-disabled pages have been moved out to rapid-user-pages simple-layout -- the main-nav parameter is now on a wrapper around <magic-nav> rather than actually on <magic-nav>, so this now works as you'd expect: <main-nav:> --- your nav here --- </main-nav:> aside-layout -- the aside now appears in the output even if it's empty <show-page> -- various improvements and new parameters <permission-denied-page> now sets a body class, and the message can be changed with an attribute. <app-name> is gone -- this is now automatically generated in your application.dryml (you may need to manually add this to existing apps) Rapid tags: plus New tag <change-password-form> === Release 0.7.2 === Migration generator Fixed "no such method table_name" bug Fixed various problems with specific column types, in particular decimal colums were problematic. Model and controller generators: Brought test related files up to date with latest Rails Model controller Fix: now correctly renders pages with validation errors for tag pages (pages with no dryml file) index_action and show_action can now be passed options for Hobo's default actions rather than giving a block. e.g. index_action :foo hobo_index :page_size => 10 end Can now be written index_action :foo, :page_size => 10 Hobo user model generator Added :default => false to administrator field DRYML Polymorphic tags -- looking up the polymorphic tag for an array will now use the 'member_class' of the array if available. Rapid New generic tag <collection>. Used to create type-specific renderings of collections. E.g. you can <def tag="collection" for="Comment"> To customise how an array of comments are displayed. This will get picked up by the default pages. Rapid pages Removed <default-layout/> -- dryml has built in facilities for setting and overriding defaults so this was not needed. Login and signup pages now specify "simple" layout, so e.g. if you redefine <page> to use "aside" layout, then login and signup will still use the simple layout. Various improvements to the default pages <index-page> new params Plugins Changing from hobo_* naming convention to rapid_* Clean theme Many small style improvements Support for aside layout === Release 0.7.1 === Hobo 0.7 is tested against Rails 2.0.1 Adding docs to the repo in /doc, including the beginings of a Hobo tutorial Front controller generator -- improvements to index page (app home page) Migration generator -- fix for situations where a table is being renamed and modified in the same migration. Hobo user controller generator -- no index page for users by default. Hobo models New style for declarting extra metadata on fields / associations. Now part of the field / assoication declaration instead of requiring an additional declaration: set_creator_attr :foo is now: belongs_to :foo, :creator => true Note that :creator => true can now be set on either a belongs_to or a string field. In the latter case the string is set to the login name of the current user. set_login_attr :username is now: username :string, :login => true (within the "fields do" block) Can also write username :string, :login => true, :validate => false to disable the automatic login validations (see hobo/lib/hobo/user.rb) Plus two new ones for fields: :name => true and :description => true. All hobo models have a "recent" scope by default. Added reflection helpers to find which collections are dependent. The permission system can now be used to check for edit permission on the object (rather than individual field) level. If the model defined #can_edit?, that will be used, otherwise #can_update? is called with a nil 'new object'. #same_fields? and #only_changed_fields? now return true without testing anything if the record passed is nil. This is more compatible with the new ability to test for general edit permission on an object. #to_s now uses the declated name field (:name => true) if there is one Hobo user model New class-level declaration set_admin_on_forst_user. Does what it says on the tin. Only use it if your user model defines a boolean field 'administrator' Active Record extensions -- removed dubious #include? optimisation from has_many associations. New plugin feature -- Bundles Bundles are Hobo's equivalent to "appable plugins" or "engines". A plugin provides a bundle, and the app *instantiates* the bundle, possibly more than once in file app/assemble.rb. This is the wrong place to start documenting them but there are some examples in /plugins Hobo controllers Options given to the include_plugin declaration have changed. They are now exactly the same as the attributes taken by DRYML's <include> Hobo model controllers Removed cruft left over from view-layer permissions experiment. Simplified template lookup mechanism and removed inheritence aware search for partials. Added a cache for file-system tests to locate the correct template. This avoids the need to stat files in production mode. Better smarts for where to redirect to after a model is created. Better support for model controllers that handle more than one model. (this is a bit of a strange thing to do but a need for it cropped up in an app than has a single place for users of different types to log in) Hobo user controller "Account not available" is now a separate page (<account-disabled-page>) instead of just a flash message. Fixed occasional missing template bug DRYML DRYML now supports bundle class renaming when defining polymorphic tags Changes to <include> for plugins: <include src="plugin/foo/taglibs/baa"/> becomes <include src="baa" plugin="foo"/> You can also say <include src="foo" bundle="abc"/> which includes a taglib from the bundle's plugin, as well as handling class renames for polymorphic definitions. Fix to allow calling tags with upper-case letters in their names. DRYML core tags <call-tag> now dasherises the tag name passed <partial> is now just a trivial wrapper around render :partial Hobo helpers can_edit? can now be given nil as the field parameter to test for general ability to edit this record (e.g. to decide wether to render an "Edit" link). Also, parameters now default to #this and nil. Renamed create_model to new_for_current_user. Pass a class or association, defaults to #this. New helper #font_models. Returns a list of models that are candidates to appear on the default front page and main nav. Changes to linkable? Subsite is now a named option (:subsite => "admin"), the target of the links defaults to #this and the action defaults to :index for model targets and :show for records. Hobo routing Now automatically updates routes without restarting the server in dev mode (yay!) Site search -- don't search for records that are not linkable Hobo Rapid Clean theme is now the default theme CSS -- small tweaks JavaScript -- Ajax spinner now appears for a minimum time, and has a fade effect. Clean theme -- many improvements Added an ajax option -- :spinner_next_to. Pass the dom id of a node and the spinner will appear near that node. Rapid tag library <field-list> now defaults to <view> not <edit> as the tag for the fields. Also, if the tag is <input>, non-editable fields are skipped (used keep them in but to drop back to views). <card> displays nothing if the object is not viewable. Default card has various improvements. New attribute <type-name dasherize/> Fix: merge-attrs was missing on the belongs_to view <boolean-checkbox-editor> now supports a custom ajax message and configures the ajax spinner to appear near the checkbox. Fix: incorrect use of <ul> in <error-messages> <magic-nav> -- removed serach item, extended to maximum of 6 models Many, many improvements to the default pages <with-fields associations="has_many"> iterates of all has_many relationships Removed require of ruby-debug from fixdryml.task New plugins featuring bundles: rapid_blog, rapid_comments, rapid_images and rapid_tagging. All are work-in-progress. === Release 0.7 === Hobo 0.7 is tested against Rails 1.99.1 (aka Rais 2.0 RC2) DRYML Switched to dashes instead of underscores for tag and attributes names. These are converted to underscores in the underlying ruby code. Unification of tempalte tags and non-template tags. There is now only one type of tag and two different ways to call a tag: <my-tag>content directly inside the tag</my-tag> <my-tag> <a-parameter:>Content inside a named parameter (note the colon)</a-parameter> <another-parameter:>Some more content</another-parameter> </my-tag> Note that these styles cannot be mixed. If there is a parameter inside a tag call, there must be only parameters (and whitespace, which is not output) In the first style, the call is implicitly equivalent to: <my-tag> <default:>content directly inside the tag</default> </my-tag> And by the same token, <tagbody/> is now written: <do param="default"/> The tagbody local variable is gone too. "if tagbody" is now "if all_parameters.default?" and "tagbody.call" is now "all_parameters.default" A rake task hobo:fixdryml has been added which does a pretty good job of converting Hobo 0.6 DRYML source-code to the new style. It will change every file in app/views/**/*.dryml, and keeps a backup copy of app/views in app_views_before_fixdryml. If you pass it CLASS=y and ID=y it will 'dasherize' css classes and IDs too, which is the new Hobo convention. You can also pass DIR=... if you want to point it somewhere other than app/views. It won't fix anything in erb scriptlets, e.g. use of the tagbody local variable. Expect to do some manual fixes after running the task (good job you've got that thorough test suite eh?) The add_classes helper now automatically dasherizes all class names. New helper 'element'. Use in place of Rails' tag and content_tag helper. It dasherizes attributes given as symbols. Migration generator Better support for STI. It no longer wants to generate tables for the subclasses. Still needed: a way of integrating fields declared in the subclasses -- they are currently ignored by the generator. Hobo Rapid In place editing (and Ajax in general) will now provide the form authentication token (CSRF protection) if available. No need to disable protect_from_forgery any more. Stylesheets: Removed list-style: none from hobo_abse.css Javascript: Dasherized all css classes and dom IDs used. Upgraded to latest low_pro.js New theme 'Clean' New helper 'linkable?' can be given a record or class, and tells you if Hobo has a route for it. Only works for 'show' and 'index' actions so far. Tag library \\'/;p <a> now automatically knows not to generate (broken) links to things that are not 'linkable?'. Outputs just the link content instead. We used to have <FieldList> and <field_list>. We now have <field-list> and <labelled-item-list> <UL> is now <ul>, and only has the iteration behaviour if you give a <li:> parameter. Otherwise it's just like a static tag. <Table> is now <table> and only has the special behaviour if you give a 'fields' attribute or '<tr:>' parameter. Otherwise it's just like a static tag. <view> for dates and times no longer break when the context is nil. <count> - unless-none attribute is gone. user if-any <theme-stylesheet> now takes a 'name' attribute <delete-button> 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 <ShowPage> 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/<subsite>/<subsite-name>.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: <def tag="Page" extend_with="navigation"> This encapsulates the alias_method_chain pattern. The tag can make a call to <PageWithoutNavigation> 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 <set user="&@user"/> 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 <default_tagbody/> of the new parameter would incorrectly provide the old tagbody which should have been overridden. hoboParts variable is now set by <hobo_rapid_javascripts> 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 "@<typed-id>" 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 <form> 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) <PermissionDeniedPage> used as the default permission denied response. <NotFoundPage> 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 <wrap> will wrap its content in ther tag specified by tag="..." if when="..." is true. Fix: <unless> -- was behaving like <if> Tag library: Rapid <FieldList> now has params <label> and <view> that wrap every label and view. Also <foo_tag> where "foo" is a field-name, is the actual tag that renders the field (e.g. <view> or <edit>) <nil_view> can be overridden to customise the way Hobo renders nil values. <Table> new attribute 'empty' -- when given the table is rendered even when there are items in the collection. <name> now respects view permission properly <view> now does a #strip to the output <count> -- new attribute if_any - set to true to output nothing if the count is zero. Tag library: Rapid documents The 'document' tags like <section>, <aside> output nothing when the content is blank. Now they can ge given the 'empty' attribute causing the tag to be output even if the content is blank. New tag <sub_heading> Tag library: Rapid forms <hidden_fields> will now not output hidden fields for attributes on new records that are in their default state. <form> now has a default ajax message for creating new objects. <form> now supports forgery protection <input> -- better handling of the 'field with errors' wrapper <input> for passwords now accepts extra html attributes New <input> for enum-strings - a select menu. New <input> for big decimals <remote_method_button> now supports non ajax remote method calls (when no update="..." is given) css classes on buttons renamed from "button_input" to "button" <update_button> now supports confirm="&false" <belongs_to_menu_input> none_message attribute renamed to blank_message Conditions on belongs_to are now observed (only eligible records are in the menu) New <ErrorMessages> template tag - like the error_messages_for helper with added Hobo goodness. Tag library: Rapid navigation <page_nav> now hides without errors if there is no @pages object <nav_item> now ignores nested tags when selecting the current nav item. Tag library: Rapid pages Significant re-factoring of all page tags -- see source :-) <javascript name="a, b, c"> tag - like helper javascript_include_tag New pages <NotFoundPage> and <PermissionDeinedPage> Tag library: Rapid support <TablePlus> various new params === Release 0.6.2 === Specs Moved out of the plugin source into a separate directory in the hierarchy. If you check out hobo/trunk you'll get two directories: hobo and hobo_spec. You can run "rake" from the hobo directory and it should work as long as hobo_spec is along side. Note the hobo_spec tree contains an svn external to edge rails. New rake task dump_fixtures (which really should be nicely namespaced). This will dump the current database into test fixtures. The nice part is that it won't overwrite symbolic names you've given to rows in your fixtures, so you can round-trip with it: rake db:fixtures:load, run up the app and create some new data, rake dump_fixtures. Migration generator Fixed indentation bug in generated code. Now prompts for the name of the generated migration after the generated code is displayed. Better error message for invalid field types declared in models. Tabla theme Fixed reference to non-existent human_type helper. Hobo users Various fixes to the new (in 0.6.1) multiple user model support. If the model name is "User", the routes generated are simply: /login /logout /signup (as opposed to /user_login etc.) The filter "login_required" can now be passed a user model (class), e.g. before_filter {|controller| controller.login_required(Administrator) } The named routes "login", "logout" and "signup" are no longer defined. Instead there are helpers login_url, signup_url and logout_url, all of which are passed a user model (class) as parameter. New declaration 'hobo_user_model' can be used in place of hobo_model and removes the need to include Hobo::AuthenticatedUser. Can be passed the name of the login field, which removes the need to call set_login_attr. Can also be passed a block in which to do validations of the login attr (just as you can with set_login_attr). User models now have a class method login_attr that returns the name of the login attribute, e.g. :username Guest model should now extend Hobo::Guest, which provides #guest (true!) and #super_user (false) User models now inherit #guest? (returns false). No need to define it yourself. Hobo models Optimisation. Where possible we've replaced calls to #respond_to? (which is slow on AR records) with the new class method #has_hobo_method? which is an alias for #respond_to_without_attributes? "fields do" now supports shorthands for common validations validates_uniqueness_of and validates_presence_of, e.g.: fields do name :string, :required, :unique end If you need to change the validation method, just go back to the old way. The creator attribute mechanism is updated to cope with multiple user models. Hobo will not try to set the creator attribute if the expected type is not the same as the type of the logged in user. Various enhancements to composable query blocks MyModel.has_creator? replaced with MyModel.creator_type which returns the expected user class or nil if there is no creator attribute. Fix: def_scope was broken with has_many :through associations. Integration test helpers #logs_in_as updated to cope with multiple user types. Core extensions New method Object._? can be used to avoid an extra test for nil, e.g. string_or_nil._?.length is equivalent to string_or_nil && string_or_nil.length Hobo extensions to HashWithIndifferentAccess fixed to always return indifferent hashes. Hobo controller Fix to #render_tags (problem with part contexts javascript) Fix to include_taglib declaration (was not working in production mode). Hobo model controller Largely re-written handling of http PUT and POST (update & create). The new mechanism is more secure, more featureful and is transactional. If your put/post affects multiple database rows, they will either all happen or none will. See the model_controller_spec for some good examples of what is allowed / possible. def_data_filter is gone. Instead you can declare data filters from within the action methods: def index data_filter :search do |query| name_contains(query) | address_contains(query) end hobo_index end Declare data filters for autocompleters in the same way by giving a block to autocomplete_for #index now supports a "sort" parameter. The value should be <field-name> or <model>.<field-name>. Precede with a '-' to sort in descending order. e.g. http://host/users?sort=-username Provide the :order parameter to hobo_index to disable. The mechanism to call a tag <ShowPage> if there is no show.dryml is extended to work with any action name. So e.g. you can define <FooPage> as an application wide page for any action "foo". Hobo user controller Options can now be given as procs, in which case they are called only when needed and hence have access to things like current_user (e.g. the redirect destination for a logged in user can take into account who the user is) #hobo_login can be given a block -- a place to check if the users account is available. Return false to prevent the user from loggin in. Hobo module #can_view? can now be given dotted field paths. E.g: Hobo.can_view(current_user, post, "author.name") Hobo Rapid Adding low_pro.js (from the UJS project). First step towards complete adoption of unobstrusive JavaScript. Fix to client side of new ajax mechanism. Had problems with not URL encoding part state. New taglib rapid_plus, home of tags with an extra level of functionality. First and only tag: <TablePlus> a table with automatic support for sorting by clicking on column headings, and filtering rows via a search field. <Table> now supports tempalte parameters for each cell when given a 'fields' attribute, e.g. <name_view> <address_view> (<name_cell> might seem like a better name, but we wanted to be compatible with <FieldList> so it's easy to flip back and forth). <name> tag now respects view permission. <a action="new"> now only renders the link if the current user has the required create permission. <view> now supports attribute 'truncate' <view for_type="Date"> now supports a 'format' attribute - a strftime style format string. New tag <restricted_page>. 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". <restricted_page login_required="Administrator"/> New tag <you_have>. 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. <hidden_fields> 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. <form> now sets a scoped variable "in_form" so tags can behave differently when they are inside a form (FieldList does this). <input> for datetime and date now supports the same attributes as the equivalent rails helpers. e.g. you can change the order of the fields. <belongs_to_menu_input> 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 <account_nav> upgraded to cope with multiple user models. Rapid pages: Various new template params made available, including many on login and signup pages. <Page> updated for multiple user models <IndexPage> fix to ajax updating of record count New css classes added to <NewPage> and <EditPage> <error_messages> added to <EditPage> Fix to new link in <ShowCollectionPage> <image> 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"). <set> 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 <LoginPage> and <SignupPage> 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 <Table> 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 <controls> 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. <human_type> is now <type_name> and takes flags @plural and @lowercase <editor> and <input> have better automatic css classes Restored old behaviour where <page_nav/> would display nothing when there's only one page. Finally created <EditPage> Small cleanups in the rapid pages New tag <with_field_names/> used in <Table> to iterate over the column headings. <view> 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. <div part="my_part" part_locals="a, b"> ... </div> (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 - <set_scoped> allows a variable assignment that exists only for the lifetime of the tag-body of <set_scoped/>. 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. <def tag="card" for="User"/>...</def> <def tag="card" for="BlogPost">...</def> call with <card for_type/> 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. <my_param.append>). The only one left is 'replace' which is now written as '<my_param replace>' 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: <def tag="foo">...<tagbody>this is the default</tagbody>...</def> Callers can keep the default: <foo/> replace it <foo>my tagbody</foo> or wrap it in new content: <foo>“<default_tagbody/>”</foo> You can give restore the default tagbody of an element further up the hierarchy using the 'for' attribute. e.g: <foo><baa>“<default_tagbody for="foo"/>”</baa></foo> New feature: restoring replaced template parameters. For example - wrapping a template param in an extra div: <MyTemplate> <my_param replace><div><my_param restore/></div></my_param> </MyTemplate> 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. <def tag="name" for="MyModel">...</def> The <name> 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 <def tag="view" for="isbn"> 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: <show> becomes <view>. <view> is a polymorphic tag, so you can <def tag="view" for="MyClass"> <edit> is gone. Use <editor> if you want a tag that gives an in-place (ajax) editor, and degrades to <view> if the user does not have edit permission. <editor> is a polymorphic tag, so you can <def tag="editor" for="MyClass"> <form_field> is now <input>. 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. <input> is a polymorphic tag, so you can <def tag="input" for="MyClass"> All the special form-field tags tags that ended _field now end _input <table_for> becomes <Table> <ul_for> becomes <UL> <object_form> and <remote_method_form> are now both handled by <form> <object_link> and <new_object_link> are now both handled by <a> <object_table> becomes <FieldList> <display_name> becomes <name> Various small changes to the navigation tags - please see rapid_navigation.dryml Hobo Rapid Javascript Fix: problems with the save button in TinyMCE fighting with the save-on-blur behaviour. Tabla theme Tweaks to application.dryml and the stylesheet for new DRYML Hobo user model generator Doesn't declare the authentication fields anymore, as these have been moved to Hobo::Authenticated user. This is part of the move to supporting multiple user models. Hobo controller & helpers ControllerHelpers are now HoboHelper, and there's a change to the way this is included in both the controller and the view. #render_tags extended to support polymorphic tags #site_search now renders the polymorphic <card> tag for each search result. Hobo module New method Hobo.symbolic_type_name returns a symbol abbreviation for a rich type. e.g. Hobo.symbolic_type_name(Hobo::Text) #=> :text New method Hobo.type_name Hobo.type_name(MyModule::MyClass) #=> "my_module__my_class" Note the double underscore Core Extensions ActiveSupport's HashWithIndifferentAccess is extended to keep it's indifferent access semantics with Hobo's extensions to Hash. === Release 0.6-pre1 === *NOTE* We are now using Edge Rails for all our tests. YMMV with other Rails releases. If you do upgrade tp Edge Rails, you'll need to install classic_pagination too (this dependency will probably go away at some point) hobolib directory (app/views/hobolib) renamed to 'taglibs' DRYML Hobo::DefineTags and def_tag are deprecated - they'll be phased out. Code attributes changed from foo="#baa" to foo="&baa" Changing the context: obj="..." renamed to with="..." attr="..." renamed to field="..." Shorthand syntax <show:authtor.name/> equivalent to <show field="author.name"/> Note that the ':' and field name(s) are optional on the close tag, e.g.: <repeat:comments> ... </repeat> (Be aware that your DRYML is no longer valid XML if you go for this option) <taglib> renamed to <include> part_id="..." renamed to part="..." #{...} is now supported in attributes of static tags (i.e. plain HTML tags) <include> (formerly <taglib>) now supports the 'as' attribute for putting tags in namespaces. <include src="my_taglib"/>, then... <my_tag/> <include src="my_taglib" as="foo"/>, then... <foo.my_tag/> (note that <foo.my_tag/> compiles to simple "foo.my_tag()", i.e. a method call on an object, so you can do other stuff with this if the mood takes you) xattrs="..." renamed to merge_attrs="..." New feature: template tags Parameter tags (<:foo>...</:foo>) are gone. Replaced by template parameters. content_option and replace_option are gone. The 'param' attribute is the new equivalent (part of template tags) <else> can now be used in many places. e.g. after <repeat>, the else content will be used if the repeated collection is empty. Attributes can now have no RHS, e.g. <logo small/> is equivalent to <logo small="&true"/> (note your DRYML is not valid XML if you use this shorthand) #attrs_for can be called for any tag and return the declared attributes on the tag. e.g. attrs_for(:foo) #=> [:a, :b] -- assuming <def tag="foo" attrs="a, b"> New feature: local tags, e.g. <def tag="a"> <def tag="panel">...</def> ... Any call to panel in here, or in the tagbody of the call to <a> will get the local definition. Note that local tags are full closures and have access to state from the containing tag... </def> <set a="&1" b="&2"/> equivalent to <% a = 1; b = 2 %> New feature: polymorphic tag calls. e.g. if the current context is a User <card for_type/> will try to call <user_card/>, falling back on just <card/> if no such tag exists. New feature: control attributes <p if="..."/> as a shorthand for <if q="..."><p/></if> <p unless="..."/> as a shorthand for <unless q="..."><p/></unless> <p repeat="..."/> as a shorthand for <repeat with="..."><p/></repeat> Think of these as the dryml equivalent of the suffix 'if' and 'unless' in Ruby. If you give the attributes a string, it is treated test for a non-blank field, e.g. if="address" is like <if q="&!this.address.blank?"> You can use <else> after tags with these attributes on them. Fix: calling @view methods with a block now works The list of tags considered 'static' (i.e. plain HTML tags) can now be customised by putting your own list (one tag per line) in config/dryml_static_tags.txt Hobo Controllers New directive "include_taglib" allows a specific DRYML taglib to be included in every action on this controller. render_tag now supports custom render options, e.g. render_tag :error_message, { :message => "uh oh" }, { :status => 500 } Options passed to #hobo_index are now also forwarded to #paginated_find, making it easier to change the page size etc. #paginated_find now takes an :association parameter to provide a custom association Fix: :order option to paginated_find ignored in some situations. Hobo controller actions now perform a #hobo_render if you give a response block but the blog does not do a render or a redirect. So e.g. if you just want to update the session you can leave hobo to handle the response Fix: hobo_create now checks for create permission if you pass a custom :this parameter POSTing and PUTing now support boolean values Hobo Models #created_by renamed to #set_creator. This should help avoid name clashes with column names etc. Added field declarations on models. This replaces set_field_type and also supports the migration generator. fields do name :string body :html end Added return_type declaration for setting rich types on model methods, e.g. return_type :html def my_method ... end This allows DRYML to render the correct widget even when the method is returning nil Fix: def_scope was pretty much completely broken RSpec support and a test Rails app (in spec/rails-root) added to the repository. DRYML Core Tags <dynamic_tag/> renamed to <call_tag/> <display_name/> displays "(not available)" if the context is nil show@no_span renamed to show@no_wrapper, and for content such as :html it now generates a div instead of a span. count@unless_none -- nothing output when count is zero (can be followed by an <else>) <join> now uses <display_name> if no tagbody is given. join@with renamed to join@separator DRYML Helpers #param_name_for will strip a trailing '?' if there is one. Hobo Rapid Tags <boolean_field> now also generates a hidden tag with the same name and value '0' like the rails helper. This fixes HTMLs broken idea of how to handle checkboxes (you get a 0 value if the checkbox is not checked, instead of no parameter at all) <object_form> no longer generates hidden fields for created_at and updated_at Hobo::TextileString now includes a monkey-patch to RedCloth Users & Authentication Added: Hobo maintains a login_count attribute if one exists on your user model. Hobo Rapid Javascript Ajax forms now default to not resseting and not refocussing after submission. Fix: ajax behaviour (Hobo.applyEvents) now applied to the result of searches. Fix: Ajax now using encodeURIComponent instead of escape. Fixes problems with foreign characters. Tabla theme Removed <application_logo/> Added missing image plus.png Generators New: hobo_migration generator. Creates fully implemented migrations for you based on field declarations in your models hobo_model and hobo_user_model generators updated accordingly -- they don't generate migrations any more. Routes Routes with ';' have been changed to use '/' as per edge Rails. Permission System Hobo.can_edit? can now handle feild names that end in '?' Hobo Module Hobo.models now skips files whos names don't look like models (e.g. editor backup files) Core Extensions: Add: Enumerable#build_hash (1..3).build_hash {|i| ["#{i} Xs", "X" * i]} => {"1 Xs"=>"X", "3 Xs"=>"XXX", "2 Xs"=>"XX"} Add: Enumerable#map_hash (1..5).map_hash { |x| x**2 } => {5=>25, 1=>1, 2=>4, 3=>9, 4=>16} Add: Hash#- {:a => 1, :b => 2} - [:a] #=> {:b = 2} Add: Hash#& {:a => 1, :b => 2} & [:a] #=> {:a = 2} Documentation Added contributed rdoc to Hobo::AuthenticatedUser (thanks!) === Release 0.5.3 === Core tags Fix: <show> tag was broken - it wasn't displaying the surrounding <span> or any associations <show> now handles all kinds of Numeric types DRYML DRYML Build cache: reloading unchanged DRYML files in dev mode is now *much* faster. Model extensions Fixes to the id_name feature Hobo model controller Fix: :permission_denied_response was not supported on several actions Hobo Rapid Hobo::Rapid::TYPE_NAMES added - a hash that maps classes to names (symbols) that are used when looking for an editor / form field for a given type. Allows you to extend the <edit> tag to support your own types. === Release 0.5.2 === Misuse of classify changed throughout to camelize. Bugs related to certain model names fixed as a result. Added Hobo::LazyHash. If a value is a proc, the proc is called on the first access of that key, and the result of the proc becomes the value. These are used in the new controller customisation mechanism. Hobo Rapid New ajax options reset_form and refocus_form for ajax forms. Default is true toggle: new function like Element.toggle in prototype (Hobo uses the css class 'hidden' instead of an inline 'style' attribute. In place editing: various fixes related to HTML/URL encoding. New option 'fade' to delete button. Pass fade="#false" to supress the fade effect. <hobo_rapid_javascripts> now takes an attribute tiny_mce. Set to true to enable TinyMCE support for html editors. <hobo_rapid_javascripts> within the <page> tag now available as inner-tag 'rapid_javascripts'. e.g. you can do <page rapid_javascripts.tiny_mce="#true"> to enable TinyMCE support. Removed helper current_user_in? Editors now have a css class added automatically: "<class>_<feild>_editor", e.g. "person_name_editor" In place editors now wrap the content in a div if the editor will be a textarea or an html editor (was a span). All the buttons now have automatically added css classes like "delete_person_button", "create_person_button". create_button now uses any passed field values in the check for create permission. object form now has a css class added: either the model class name, or "new_<class>" New tag <remote_method_form> for calling remote methods with parameters, either with a traditional Model Extensions Fix to HasManyAssociation#new (didn't support parameters) Added block queries to has_many associations, e.g. post.comments.find { published = 1 } MyModel[...] equivalent to MyModel.find(...) (Thanks to Jamis Buck's tip on his blog) New feature: defined scopes Field types set by set_field_type are now inherited Model#conditions { ... } generates an sql where clause from a query block. Fix to #subclass_associations with has_many :through Method #changed_fields? to complement #same_fields?. Useful in permission methods. Integration test extensions #visits now can now be given http get parameters #deletes added: bob.deletes(some_object) #calls_method added: bob.calls_method(object, some_method) General extensions #extract_options_from_args! added to Kernel Object#is_a? extended to support multiple args: if foo.is_a?(Symbol, String) _why's metaid added to Object Added Hash#map_hash. e.g. a new hash with all values incremented by 1: my_hash.map_hash {|k, v| v+1} Controller extensions redirect_to can be passed an object, equivalent to redirect_to(object_url(x)), e.g. redirect_to current_user.adverts Model controllers Removed customisation hooks, create_response, invalid_create_response, update_response etc. New mechanism for customising actions. def create hobo_create ...customisation args... end web_method, show_method, and publish_collection declarations are now inherited. Helpers debug can now be passed multiple values you'd like to inspect param_name_for now accepts a string as well as an array for the field path, e.g. param_name_for(current_user, "account.name") Core tags object_link automatically adds a css class "<class>_link", e.g. "person_link" Changed default date formatting to to_s(:long) for dates and times. New tag transpose_and_repeat, useful for those tables when you wish HTML grouped cells by column instead of by row. New tag if_blank Permission system Hobo::Undefined#undefined? renamed to hobo_undefined? can_edit? now works better with boolean fields can_call_<method>? renamed to <method>_callable_by? DRYML Fix: options to inner-tags were leaking through to the HTML output. Debug feature -- if the <def> tag has an attribute hobo_debug_source, the generated ERB source will be output to logger.debug Dryml now reports an error if a part name occurs more than once Inner tag names can now be generated at runtime, this allows e.g. the object_table tag to generate inner-tags on the fly for every editor and label: <object_table fields.name_editor.update="my_part" /> Go read that last one again - it's awesome New rake tasks environments.rake defines tasks like dev, prod, testing so you can e.g.: rake prod db:migrate (thanks to err.the_blog IIRC) === Release 0.5.1 === Fix to model extensions: hobo_user_model generator could not complete because an attempt to access the database before the table exists was made. === Release 0.5 === Tabla theme Changed some heading levels to be more logical - e.g. now use H2 and H3 inside a panel instead of H1 and H2 Various CSS tweaks <page> Upgraded to use inner tags No longer imports public/stylesheets/application.css by default - can easily be added using inner-tags <application_nav> and <application_logo> moved into the theme (were in Rapid) Frontpage generator Page templates modified to use <:intro>, <:main> etc hobo_rapid generator --import-tags option will add two tags to application.dryml: <taglib src="plugins/hobo/tags/rapid"/> <set_theme name="default"/> Plugin initialisation Theme no longer set to default in hobo/init.rb. Instead use <set_theme> in application.dryml Core extentions Enumerable#map_with_index Ajax Mechanism Render parameters (http parameters) are passed in as a hash of requests with numeric keys rather than an array. (e.g. render[1][id]=foo rather than render[][id]=foo Hobo.ajaxRequest (javascript) now displays error messages in an alert box. (Known issue: seems to show these twice for some reason) In-place-editor support extended to allow other parts to be updated at the same time. Automatic mechanism for updating multiple displays of the same field after an in-place-edit In-place-editor for html fields will now use TinyMCE if installed (integrated with Ajax.InPlaceEditor) Select based ajax editor for numbers, suited for small ranges, e.g. 1 to 10 Hobo.removeButton (javascript) now supports updating of other parts along with the removal. Dom attribute "model_id" renamed to "hobo_model_id" Fix to Ajax.InPlaceEditor - no longer removes <p> tags before_ajax hook. This method is called immediately before the ajax response is performed. A chance for the controller to make extra instance variabled available to the part methods. If a custom JS function is specified for an ajax update (render[...][function]=f), this name is no longer camelised - it is called as-is. The object (render[...][object]=...) is now allowed to be nil In-place-editor fields now reset automatically to a preset message when the field is blank (e.g. "click to edit") Core helpers Fix: object_url gives correct urls when the action is a web-method (controller-name/id/method-name) <show> will wrap the displayed content in a <span> with a hobo_model_id. This enables the automatic update of multiple displays of a field value after an ajax edit. <show> uses the new type-system added to Hobo models. The main benefit is that values that don't come directly from AR should display without problem, and more types are supported (e.g. float) <show> supports a format attribute for numbers: <show attr="price" format="%.2f"/> <show> will not display password attributes (e.g. in your model set_field_type :password => :password) New tags <show_belongs_to> and <show_has_many> can be overriden to handle the way these relationships are displayed by <show> display_name moved into core (was in Rapid, but is needed by <show>) display_name uses <show>, so will wrap the name in a span with a hobo_model_id <repeat> supports an 'else' attribute, used when the collection is empty. Debug methods abort_with and debug are now helpers so they are available from views as well as controllers. User Authentication Username validations are customisable - pass a block to set_login_attr and do validations in there. Otherwise default validations are used. Hobo::Controller hobo_ajax_reponse will use @this if no page context is passed Module defined tags Can provide a predicate as a block, e.g. to have a different nav bar onced logged in. def_tag :nav, (proc {logged_in?}) do ... def_tag :nav do ... The tag with no predicate will always take precedence if no predicate is true. If the proc has a single parameter, it is passed the options hash. DRYML Changes to taglib cache system. A list of known HTML tags is defined in lib/hobo/static_tags. These are available as an array by calling Hobo.static_tags. Any tags parsed that are not in here are compiled as method calls. Thus the order of tag definitions is no longer as critical, making it easier to split large taglibs into multiple files. As a result, tag modules no longer need to track defined tags in a module variable. XML comments now passed through to the generated HTML. <set_theme> tag to set current theme. Was previously a configuration variable. This way it is easier to change or disable the theme. New feature - inner tags <def> now supports alias_current attribute, e.g. <def tag="page" alias_current="theme_page"> This overrides the current <page> definition and makes the old one available as <theme_page> <tagbody> supports obj= and attr= at the same time, as with regular tag calls Hobo models New type system. This is the extended type system that allows you to say, e.g. `set_field_type :intro => :html`. Previously this was returned as a symbol from MyModel.field_type(:intro). The new system uses wrapper types (simple subclasses of String), and modified your model to return these. e.g. MyModel.find(:first).intro.class => Hobo::HtmlString There are similar types for textile, markdown, passwords, and text (the text type just denotes a longer string, and is used for the 'text' sql type). Hobo model controller `show_method` renamed to `show_action` New class method `publish_collection`. Any `has_many` collections are published automatically. This method allows custom collections, i.e. model methods that return arrays, to be published also. create action for an STI base-class controller can now be used to create subclass instances by passing the 'type' parameter. update action enhanced to allow a full Hobo ajax-reponse (i.e. part updates) after in-place-edits. Controllers can define a `find_for_show` method to provide a custom instance finder, e.g. a chance to perform eager loading. Association actions now check for permission to view the association owner Model Queries <field>_is predicates now work with belongs_to associations. Hobo Rapid rapid.dryml split up into rapid.dryml, rapid_pages.dryml rapid_editing.dryml and rapid_navigation.dryml New set of tags for creating navigation bars. <no_break> tag replaces spaces with in entire content. <edit> tag customisation - for form fields (i.e. new records), will delegate to one of: has_many_field belongs_to_field string_field textarea_field password_field html_field boolean_field date_field datetime_field integer_field float_field Redfine these to customise forms throughout the app. Similarly, editor fields (i.e. ajax fields for existing records) use: has_many_editor belongs_to_editor string_editor textarea_editor password_editor html_editor boolean_editor datetime_editor date_editor integer_editor float_editor Redefine these to customise ajax editors throughout the app. Note has_many_field and has_many_editor are just placeholders, they are not implemented. <update_button> supports a params attribute, to send extra params along with the HTTP PUT. <delete_button> now supports part updates and use of Hobo.removeButton together. (i.e. you can have the fade effect and also have other parts updated) <object_form> does not create a hidden field for the STI 'type' field. New feature - Composite models Experimental new feature - mapping tags New feature - Predicate dispatch modules === Release 0.4.3 === Front-controller now filters parameter logging so that passwords are not logged. Check if a controller is a Hobo model-controller before installing Hobo routes. DRYML Can now use obj= and attr= on the same tag, so you can e.g. <edit obj="#@this" attr="name"/> (The alternative, <edit obj="@this.name"> would not work as <edit> needs this_field which would be nil) Shorthand obj="page" for obj="#@this" Various fixes and enhancements to the permission system. Things are somewhat experimental and subject to change! Core tags/helpers `viewable` method filters a collection down to objects that are viewable. Hobo Rapid: <new_in_collection_page> now includes belongs_to associations in the form. Cleanup of form field / editor tags <ul_for> and <table_for> now skip non-viewable objects Fix: even/odd cycle in table_for and ul_for was broken with nested lists/tables. Page navigation enhanced to allow URL query parameters to be maintained from page to page. <show_collection_page> now only includes a "New Whatever" link if the collection is a "simple" has_many collection (no conditions, not :through) <object_link> now has a view attribute to link to alternate views of the object (see below: alternate show pages) <object_table> Now allows additional rows to be added by giving a tag-body. skip_fields attribute to remove fields from the table Better support for confirmation dialogues in <delete_button> Tabla theme: Increased width to 800px; Small style enhancements Hobo Module Fix to dom_id for objects in an array that is not an AR association (e.g. an array returned by find(:all)) Support for alternative "show" pages. E.g. to add a "profile" page to a User, add show_method :profile To the UsersController and create app/views/people/profile.dryml. You also get a named route "user_profile" (e.g. you can call user_profile_url(fred) ) (Using Hobo Rapid you can link to these with <object_link view="profile"/>) Fix to template lookup for association pages (e.g. posts/12/comments and posts/12/comments/new) Support for permission class methods (experimental). If you can define permission without access to the object state, you can now do so on the class: def self.viewable_by(viewer, field) false end This helps Hobo in places where there is no object. e.g. in deciding whether or not to present a "New Whatsit" link Fix: pagination was broken on index pages with data-filters. Hobo::ModelController Enhanced to allow updating of date and datetime fields. Dates and date-times can be provided either as strings (Hobo will use Chronic for parsing if it's installed) or hashes with :year, :month, :day etc. keys (as used by the select_date helper). find_by_data_filter renamed to find_with_data_filter and now does a non-filtered find if no filters were given in the request. Added count_with_data_filter Fixes to checking create permission when the post parameters contains related sub-objects. Access to the new page is forbidden if the current user does not have create permission. Hobo::Model New model queries <field>_starts and <field>_ends The <field>_is query will now use an "IS NULL" query if you pass nil. Added support for counts with queries, e.g: User.count { name_starts 't' } Calling `new` on a has_many association (e.g. post.comments.new) has enhanced behaviour for new records (those not in the db). Hobo will try to set up the reciprocal belongs_to association on the created object. This is needed by the permission system when testing can_create? #reverse_reflection will attempt to find the reciprocal belongs_to association from a has_many association. Ajax mechanism Fix when using multiple instances of the same part on the same page (i.e. when a part_id attribute appears in a loop). Fix when the this_field for the part context is an array index. Chronic fix to handle dates like "11th Jan" (it can handle "Jan 11th" and "11 Jan" but not "11th Jan") New feature - Integration testing DSL. Adds an easy to use DSL for integration tests. Fix: search page in IE === Release 0.4.2 === Fix in permission system === Release 0.4.1 === New feature: "web-methods" -- RPC style actions in model-controllers. Including support for ajax responses. New named route "home" to FrontController#index Hobo Rapid: Renamed <object_small> to <object_card> Added support for ajax responses to web-methods Removed <possessive> (too app specific) <object_link> now passes extra options to the generated <a> tag (e.g. class, id) Extra options to <edit> are now passed on to the delegate. Naming of edit controls reworked. <editor> is an ajax editor, <form_field> is a non-ajax form field, <edit> chooses automatically between the two. Other tags renamed too - e.g. <in_place_edit_for_boolean> renamed to <boolean_checkbox_editor> Support for datetime and date selects in form fields (not editors) Added autosubmit option to autocompleters - submits the form as soon as an option is selected. Added confirm option to ajax_updater (wraps call in a JS confirm dialogue) More data types supported by <editor> (formerly in_place_edit) New tag <belongs_to_editor>. Currently just delegates to <belongs_to_menu_editor> but is intended to switch to an autocompleter if there are too many options for a menu. New css classes create_button, update_button, delete_button added to button tags. Image attribute for delete_button for <input type="image"> buttons. Needs implementing on the other buttons (or maybe we should be using css styling only!) New tag: <remote_method_button> <object_form> updated to only add hidden tags for fields that don't appear in the form. hobo_rapid.js Fix: in-place-edit controls were displaying the JavaScript source of an alert message after a validation error. Support for ajax responses to RPC actions. Fix in Hobo.ajaxRequest when no `method` option was given. Hobo.applyEvents can now be given an element or a DOM ID. Hobo.removeButton: changed duration of Fade effect Fix in objectElementFor Re-enabled applyEvents in Hobo.updateElement Tabla theme Various CSS refinements Added account_nav attribute to <page> Added class attribute to page - applied to body tag Disable account nav if no `login_url` route exists hobo_user_model generator Migration Changed `login` column to `username`. Changed to use Hobo migration syntax Model: Uses new `set_login_attr` Plugin initialiser (init.rb) Fixed problem with ordering of requires Eliminated code to load all models at startup (now done on demand in Hobo module) This reduces the footprint of Hobo, e.g. for apps that want only DRYML. ActiveRecord extensions Added HasManyAssociation#new_without_appending. Creates a model with the correct belongs_to association but doesn't add it to the array. Needed for the permission system. Added #member_class to HasManyAssociation and HasManyThroughAssociation - convenience method for proxy_reflection.klass General Ruby extensions Renamed is_in? to in? to conform with ruby-extensions project. Added Module#inheriting_attr_accessor. Creates an attribute accessor that looks in the superclass if the attribute does not exist on self. Should be used on classes (e.g. inside class << self) User Authentication The user model can now override the class-method `password_validations` to customise those. Virtual fields `password` and `password_confirmation` now declared with field type :password. Hobo Rapid will now generate password-edit fields for these. Column used for the user-name is now declared by the user-model class, e.g. class User; set_login_attr :email; end Extracted acts_as_authenticated controller extensions into Hobo::AuthenticationSupport (was in Hobo::Controller) Hobo will manage a last_login_at datetime if such a column exists on the user model. Site-wide search Added message when no results found Remove objects from results that are not viewable by the current_user Hobo Controller Fix: render_tags - hoboParts JavaScript was rendered multiple times Ajax mechanism updated to support RPC actions. Core tags & DRYML helpers Fix: per-request cache of current_user was not working Fix: can_update? was broken Fix: can_view_this? handles non-ActiveRecord objects better can_view_this? delegates to can_view if this_parent or this_field is null (previously an error). Fix: tag_for_object was broken <show> supports more field types <repeat> now sets the model_id attribute on the repeated element. new conditions <unless_blank>, <unless_empty>, <if_can_edit> add_classes split into two methods, one that modifies the hash (add_classes!) and one that generates a new one (add_classes) Made the new object optional on can_update Added a style attribute to <human_type> can be any string method, e.g. pluralize, downcase etc. DRYML Form fields that appear within a DRYML form context are now tracked, so that hidden fields can be automatically added for just those fields that do not appear in the form. Renamed instance variable to current context to @_this. Was clashing with @this page context. Fix: this_type was failing to default to this.class when using the obj="" attribute Renamed method _part_context_js to part_context_js Model Extensions (hobo_model) Renamed set_fields_types to set_field_type Added set_search_columns declaration as a shorthand alternative to defining class method search_columns. e.g. class Foo < ActiveRecord::Base hobo_model set_search_columns :content, :notes end An id_name with the :underscore option no longer returns the name with underscores by default. By default you get the name as it is in the DB, if you call id_name(true) you get it with underscores instead of spaces (e.g. for use in URLs). Added Hobo::Model.set_default_order e.g. class User < ActiveRecord::Base set_default_order "name" end To use: User.find(:all, :order => :default). Default order is used by the hobo_model_controller Model Controller Fix: show-collection action (e.g. post/12/comments) now uniquifies the collection if the :uniq option was given on the has_many declaration. hobo_render now allows the template to be looked for in other classes (e.g. in app/views/other_class) Added web_method declaration for RPC-style actions. e.g. class Users < ApplicationController web_method :reset_password def reset_password new_pw = @this.reset_password hobo_ajax_response(@this, :password => new_pw) end end show action now calls permission_denied unless the current user can view the object. Added customisation hooks create_response, update_response, destroy_response. And for invalid records: invalid_create_response, and invalid_update_response. The default response will only happen if these methods don't do a render or a redirect. Added before filter to prepare for a web_method Template lookup path changed for collections. e.g. /posts/12/comments will now fallback on app/vews/comments/show_in_collection and /posts/12/comments/12 will fallback on app/views/comments/new_in_collection index action respects the model's default_order Model Queries Renamed predicate in_association to is_in Added predicate not_in Added support for model-defined predicates. Any predicate not found will be looked up on the model class. Hobo module Removed guest_user attribute Hobo.models now loads all model classes on demand the first time it is called. Removed parentheses from query in find_by_search (SQLite compatibility) add_routes now adds routes for web methods can_create? uses new_without_appending when passed a has_many association to check if the user is allowed to create an object in that collection. can_edit? returns false for polymorphic associations (for now!) can_view? can now handle AR classes (can view instances of this class?) and associations (can view items in this association?) Added can_call? permission method for web-methods Added Rakefile with rdoc task