On Feb 4, 2010, at 11:57 AM, tomPorter wrote:

In a boilerplate Hobo app, once a user fills in data on the new Foo
page and presses 'Create Foo' it returns to the Foo index page.  Ditto
for 'Save Foo' on an edit Foo page.

- Can I change the routing so that I go to back to a new Foo page?
(This is to simplify bulk entry of new Foo's)

- Can I still make the Edit Foo page return to Foo index after
clicking on Save Foo?

There's two ways to handle this: do a redirect within the controller action, or add an after-submit tag to the form to tell Hobo to do the redirect for you.

The former:

def create
  hobo_create do
    redirect_to 'someplace' if this.valid?
  end
end

(similarly for update actions)

The latter: (in new.dryml)

<form>
  ...
  <after-submit uri="someplace" />
</form>

Note in the above that it's URI, not URL. That's bitten me more than once...

On a less-customized page, you can also get the same effect using <after-field-list:> and so on.

--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