On Apr 7, 2011, at 4:10 AM, Paul Hannah wrote:

> Hi,
> 
> I'm only a few weeks into Hobo, but I've managed to get pretty much
> everything I want into an app I'm putting together except for what is
> the last major step.
> 
> It's basically a messaging site, with a few wrinkles.  I want an
> 'InterestingMessages' page (i.e.
> http://the.site.url/InterestingMessages) that will display the
> messages collection but sort and filter them by a number of criteria.
> 
> My (failed but tantalisingly close) attempt has gone as follows:
> 
> * Added the following lines:
>  * app/controllers/messages_controller.rb:  def interesting; end

Hobo is magical, but not *that* magical. :) You'll need to get the ball rolling 
in that action, typically with something like:

def interesting
  hobo_index
end

>  * config/routes.rb:  map.mymessages 'mymessages', :controller =>
> 'messages', :action => 'interesting'
> 
> * Copy the index-page definition from the messages section from
> pages.dryml into views/messages/interesting.dryml
> 
> * Edit the def to be: <def tag="interesting-page">   (i.e. rename and
> remove for="Message")
> 
> * Call <interesting-page/>

I'd recommend just expanding the index-page definition manually, if you plan on 
modifying it extensively. To do this, here's a checklist:

- remove the def wrapper entirely

- remove any 'merge' or 'merge-params' or 'merge-attrs' attributes; they won't 
do anything useful here

- unnamed parameters (tags like this: <a param />) can be deleted; named 
parameters (like this: <a param="something" />) should be changed to class 
attributes, as they may be used by the theme styles (so <a param="something" /> 
becomes <a class="something" />).

This will streamline the process, and avoid some of the weird bugs we've seen 
when defining tags in view files.

--Matt Jones


-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to