frequently asked questions and misunderstandings.

53 views
Skip to first unread message

Bryan Larsen

unread,
Mar 7, 2012, 10:15:04 PM3/7/12
to Hobo Users
As I mentioned off-hand in an answer to Bob's question, it would be
nice to have a document called "frequently asked questions and
misunderstandings". Let's use this thread to suggest questions and
solicit volunteers to answer them.

1) What's the difference between a tag invocation without a colon,
with a colon on the end of the tag name and with a colon in the middle
of the tag name.

2) Why doesn't Hobo throw an error for an undefined parameter?

3) How come I can't mix parameter and non-parameter tags?

other questions? Anybody want to volunteer to answer some of these?

cheers,
Bryan

JezC

unread,
Mar 8, 2012, 4:35:32 AM3/8/12
to Hobo Users
Questions:

J1/ What's a good development environment? - Webrick, Unicorn, etc?
And a basic Gemfile (e.g. conditionally include ruby-debug, switch
Rack to 1.2.4 (or am I alone in getting crashes when I use 1.2.5?))
with all the core bits, and a commented section with the "extras" like
the jquery stuff that Bryan has published. So... "install rvm, install
ruby 1.9.2, update gem, install rails 3.0.11, install hobo 1.3, edit
Gemfile, run bundle install, set gemset... now you can start to make
new hobo projects". "add jquery, add ..." and now you can tackle some
more complex projects. And the regular set of checks on ruby version,
gem version, gems, rails versions, hobo versions; how to keep up to
date and how to freeze for production environments.

J2/ Are there any editors that cope with DRYML? e.g. TextMate/emacs/vi
etc?

J3/ What about security? After the latest mass assignment kerfuffle,
what needs to be done to make Hobo resistant to simple attack?

J4/ What's a good development cycle? e.g. As I was learning, I've
found that it paid to do a 'hobo g migration' pretty much anytime I'd
changed a file. Eventually I've worked out when I *should* do a "hobo
g migration", but I wasn't doing it enough to start with and that
caused silly problems.

J5/ What do you need to know about Rails to get started, and where do
you find out more about Rails (and why you'll need to do so)?

J6/ What real websites have been put together with Hobo?

J7/ What's the difference between Datamapper and Hobo Fields, and can
I use both?

J8/ Can Hobo work with legacy databases, and how?

J9/ How do I pass back an extra field from a form?

That's my group of questions :)

I think I can now answer your question 1, in simple language. I can
answer some of the questions I've raised, I think... I can probably
write reasonably useful answers to J9, possibly J1, J4. The other
questions are partly my experience, and I've been introducing a few
other people to Hobo and have been listening to their problems...

Document? Or is this really another web app, with a summary page?
Preferably with community voting a la the stackoverflow type models?

Cheers, JeremyC.

kevinpfromnm

unread,
Mar 9, 2012, 6:54:44 PM3/9/12
to hobo...@googlegroups.com

1)
  • tag-name  -> call tag of name 'tag-name'
  • tag-name: -> parameter tag, contents/attributes passed to the parameter 'tag-name' (if defined) of the parent tag.
  • tag-name:something -> this is a regular tag call with a context change.  set 'this' to whatever is returned by executing 'something' on 'this' (whatever the context is before the tag.
    <parent-tag> # this = context1 here
      <tag-call:something /> # this = context1.something inside this tag-call, this_parent = context1, this_field = :something
    </parent-tag> # this = context1
2) I think of the parameters as a hash of info passed to the parent tag method.  just like ruby, invalid option names often get silently dropped.  This may or not be the case behind the scenes but think it's a nice simple way of remembering.

3) When you have non-parameter tags in a tag call, you're basically giving the parent a bunch of info in an ordered fashion, a single blob of text as an example.  parameter tags, are more like a hash with the parameter name being the key, and the content wrapped being the value.  putting the two together provides 1) a problem of figuring out how to order things, what goes where etc. and 2) a whole slew of potential for cryptic bugs when the rules run across something unexpected.  If you must, use the default parameter for the stuff you'd want in non-parameter tags with a word of warning - this can cause weird behavior as sometimes the default tag wraps other parameters.

Bryan Larsen

unread,
Mar 11, 2012, 5:26:23 PM3/11/12
to hobo...@googlegroups.com
another one:

what's a good DRYML editor?

nXml. the default XML mode for emacs is way too heavy. It works best
with a schema, and dislikes how Hobo uses colons for its own purposes
rather than for namespacing. For emacs users, I recommend xml-lite:
http://dogbiscuit.org/mdub/software/xml-lite.el

Here's my .emacs:

(require 'xml-lite)
(set-variable 'xml-lite-indent-offset 2)
(add-to-list 'auto-mode-alist '("\\.dryml$" . xml-lite-mode))

What other editors have an XML mode that works with DRYML?

Bryan

kevinpfromnm

unread,
Mar 11, 2012, 6:01:11 PM3/11/12
to hobo...@googlegroups.com
I use vim with rails vim and Dr. Nics hobo plugins.  Nice thing about vi/vim is it's available on just about any *nix system plus works in a console so you can have a familiar editor env if you have to view your code on a server through ssh.

Owen

unread,
Mar 11, 2012, 7:14:51 PM3/11/12
to Hobo Users
J8/ Nothing special about Hobo working with legacy databases -
anything that Activerecord can do...

Also, Hobo adds the intelligence of adding the indexes you will need
on foreign keys to improve performance, and is aware that Oracle has a
limit on column and index name lengths.

For the most common "legacy" database connectors, see:

http://groups.google.com/group/rails-sqlserver-adapter

http://groups.google.com/group/oracle-enhanced

J6/ Hobocentral is not keeping up with "Hobo in the Wild", but you
might want to see:

http://portal.nifa.usda.gov

The portal and several of the applications behind the portal use Hobo.


-Owen

Peter Booth

unread,
Mar 21, 2012, 9:56:22 AM3/21/12
to hobo...@googlegroups.com, Hobo Users
J5 what do you need to know about rails?

A lot more than you might think. The weird thing about learning rails thru hobo is taking hoboisms for granted and then wondering how the "regular" rails coders manage.

I found three things useful:
1. Rails cast podcasts- they're typically five or ten minutes on one concept
2. The rails website
3. Books:
Enterprise Rails
Ruby Best Practices
Rails Antipatterns
Design patterns in ruby
Well Grounded Rubyist


Sent from my iPhone

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

Bryan Larsen

unread,
Mar 22, 2012, 2:52:32 PM3/22/12
to hobo...@googlegroups.com
I've got everything except this last update pushed to a new manual
page on the Hobo 1.4 cookbook:

http://cookbook-1.4.hobocentral.net/manual/faq

So everybody please click on the "edit this page" link and help us out!

I hope nobody minds me using questions and/or answers, I wasn't sure
what the best way to give credit was. Feel free to edit the page and
take credit for your answers.

Bryan

Reply all
Reply to author
Forward
0 new messages