Excuse me for jumping in here, I just did this the other day so it is
still fresh...

The way I like to make changes like this is doing it in small steps.

Start with a working Hobo default model controller setup, nothing
custom yet.

Redefine the index page with index.dryml something like "Hello World"
for starters, refreshing the browser for that web page would then show
a white blank screens that says "Hello World"

Then replace that with "<index-page></index-page>" in index.dryml,
refresh the page and should be back to the default hobo index page.

Now lets try and do something with the controller code at this point
index should not be defined in the controller so lets define one:

  def index
    @cdrs = nil   # notice it is @cdrs plural
  end

The nil should break it so refreshing the page will be white nothing.
Then change it to this:

  def index
    @cdrs = find_or_paginate(Cdr, {})
  end

That should get a page back looking like the default hobo page.

At this point start customizing in the dyml with

 <heading: replace>
My new heading here
</heading:>

And refresh the browser to see if that takes.

You could then start adding your own @myvars in the controller code
and referencing them in the index.dryml to create the custom index
page you want.

I've found that it is much easier and less frustrating to take it just
one little step at a time always checking to see if things are still
working,

Hope that helps.

Brett



On Aug 24, 8:40 am, MichelV69 <[email protected]> wrote:
> On Aug 24, 11:31 am, Matt Jones <[email protected]> wrote:> Why are you 
> calling find_instance? You don't appear to use the result,  
> > and it's not going to work for an index action anyways (it essentially  
> > calls Cdr.find(params[:id]) in this case, which will clearly fail).
>
> > The "page not found" is the result of Rails catching the  
> > RecordNotFound exception and displaying a 404 error page.
>
> > --Matt Jones
>
>   Hi, Matt.  I'm doing it, because I inferred from the Agility
> tutorial that I had to.  If I don't do that, I just get a blank page;
> nothing renders at all.  Not even the menus.
>
>   Thank-you for explaining what the error means.  Can you point me in
> the right direction of what I -should- be doing to replace the index
> page for a given MVC trio?  I'm sure I won't be the only new comer
> trying to do this as part of a project.
--~--~---------~--~----~------------~-------~--~----~
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