=== 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?. Usef