Where is hobo_edit?

25 views
Skip to first unread message

Donald R. Ziesig

unread,
Nov 23, 2011, 12:01:47 PM11/23/11
to Hobo Users
Hi All!

I am trying to populate a header on all pages by using
application_controller methods as in:

def show
populate_header
end

def new
populate_header
end

def create
populate_header
end

and the following methods in the various model controllers:

def create
super
hobo_create
end

def new
super
hobo_new
end

def show
super
hobo_show
end

The above work properly.

When I try to do the same for the edit page, I get various errors

application_controller:

def edit
populate_header
end

model controller:

def edit
super
hobo_edit ### doesn't exist
end

or

def edit
super ### renders empty page (goes to application_controller's edit)
end

What am I missing? I need to intercept the edit invocation before the
page is rendered, just like the show, create, new and index pages. Is
that possible? Something must be populating @this from the record being
edited, where is that done?

Thanks,

Don Z.

Bryan Larsen

unread,
Nov 23, 2011, 1:01:26 PM11/23/11
to hobo...@googlegroups.com
edit uses 'hobo_show'.

cheers,
Bryan

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

Donald R. Ziesig

unread,
Nov 23, 2011, 1:43:43 PM11/23/11
to hobo...@googlegroups.com
Thanks Bryan,

It works just like it should now.

Shouldn't this show up in the docs somewhere (I searched for hours)
since it is not quite obvious ;-) ?

Don Z.

Owen Dall

unread,
Nov 23, 2011, 2:33:53 PM11/23/11
to hobo...@googlegroups.com, vasht...@barquin.com
We'll have Brian Absetz add that to the book--he is going through all the tutorials, and we should find a place for this.

On Wed, Nov 23, 2011 at 12:01 PM, Donald R. Ziesig <don...@ziesig.org> wrote:
--
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+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.




--
-Owen
 
Owen Dall, Chief Systems Architect
Barquin International

Bryan Larsen

unread,
Nov 23, 2011, 2:43:20 PM11/23/11
to hobo...@googlegroups.com
In fact, the manual says this: "There is a similar hobo_* method for
each of the basic actions: hobo_new, hobo_index, etc."

So it was lying to you. It seems to me that in this case it's better
to change the code than the manual, so I did this:

https://github.com/tablatom/hobo/commit/fb95a84b4bae7a5ad923955ed92fc6272d63cc33

It's off in a development branch, so it won't help you yet, but it
should help the next guy to encounter the problem.

Bryan

Owen Dall

unread,
Nov 23, 2011, 3:41:26 PM11/23/11
to hobo...@googlegroups.com
Thanks, Bryan...

kevinpfromnm

unread,
Nov 23, 2011, 4:02:46 PM11/23/11
to hobo...@googlegroups.com
FYI: since you already got it working kinda a moot point but something like this would be a good candidate for a before filter.   before_filter on rails docs

Donald R. Ziesig

unread,
Nov 25, 2011, 1:13:31 PM11/25/11
to hobo...@googlegroups.com
Thanks all for the help on this one. Adding the hobo_edit to the code
so it it consistent with the documentation will surely save others from
the frustration that I encountered.

Even thought I got it working, I will have enough additional instances
before the app is done that I am refactoring with Kevin's elegant
solution. (I keep forgetting that underlying hobo is the entire set of
RoR features).

For those of you to whom this applies, I hope all had a happy Thanksgiving,.

Don Z.

Reply all
Reply to author
Forward
0 new messages