IOWA again

Discussion in 'Ruby' started by Mark Probert, Sep 9, 2004.

  1. Mark Probert

    Mark Probert Guest

    Hi,

    Another IOWA issue but more likely, a "me" issue.

    I have a header than contains the code:

    Logged in as: @user<br/>


    I have a LeftNav panel that includes

    def foo_page
    '/foo' # mapfile.conf --> /foo: Run::Foo
    end


    'foo' includes the LeftNav and the header. However, I am not sure of how
    to pass @user via the LeftNav. If I change LeftNav to:

    def foo_page
    newPage = page_named("Run::Foo")
    newPage.user = @user
    yield newPage
    end


    I get an error

    <a href="
    no block given
    (eval):39:in `credit_page'


    Any ideas on how to pass the @user to the LeftNav?

    BTW, @user is correctly defined and available LeftNav.

    Many thanks,

    --
    -mark. (probertm @ acm dot org)
    Mark Probert, Sep 9, 2004
    #1
    1. Advertising

  2. Mark Probert

    Kirk Haines Guest

    On Fri, 10 Sep 2004 06:55:04 +0900, Mark Probert wrote

    > I have a LeftNav panel that includes
    >
    > def foo_page
    > '/foo' # mapfile.conf --> /foo: Run::Foo
    > end
    >
    > 'foo' includes the LeftNav and the header. However, I am not sure
    > of how to pass @user via the LeftNav. If I change LeftNav to:
    >
    > def foo_page
    > newPage = page_named("Run::Foo")
    > newPage.user = @user
    > yield newPage
    > end
    >
    > I get an error
    >
    > <a href="
    > no block given
    > (eval):39:in `credit_page'
    >
    > Any ideas on how to pass the @user to the LeftNav?


    Yeah. You can see an example of this in the webrick demo. However, your
    snippet of code up there is exactly what you want.

    foo_page() should create the new page, assign @user to it, and then yield
    it, exactly as you are doing.

    The change you need to make is in your HTML:

    Instead of this:

    <a href="@foo_page">Goto foo</a>

    you want this:

    <a oid="foo_page">Goto Foo</a>



    Make sense?


    Kirk Haines
    Kirk Haines, Sep 9, 2004
    #2
    1. Advertising

  3. Mark Probert

    Mark Probert Guest

    Hi, Kirk.

    "Kirk Haines" <> wrote:
    >
    > <a oid="foo_page">Goto Foo</a>
    >
    > Make sense?
    >

    Got it. Thanks.

    BTW, you mentioned once before but I can't find the reference.
    awake() is triggered on page initialisation. What is triggered
    each time the page is referenced?


    --
    -mark. (probertm @ acm dot org)
    Mark Probert, Sep 10, 2004
    #3
  4. Mark Probert

    David Naseby Guest

    David Naseby, Sep 10, 2004
    #4
  5. Mark Probert

    Mark Probert Guest

    Mark Probert, Sep 10, 2004
    #5
  6. Mark Probert

    Kirk Haines Guest

    On Fri, 10 Sep 2004 08:55:03 +0900, Mark Probert wrote
    > Hi, Kirk.
    >
    > "Kirk Haines" <> wrote:
    > >
    > > <a oid="foo_page">Goto Foo</a>
    > >
    > > Make sense?
    > >

    > Got it. Thanks.
    >
    > BTW, you mentioned once before but I can't find the reference.
    > awake() is triggered on page initialisation. What is triggered
    > each time the page is referenced?


    That would be setup().


    Thanks,


    Kirk Haines
    Kirk Haines, Sep 10, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Driscoll

    Iowa Python User's Group

    Mike Driscoll, Aug 22, 2008, in forum: Python
    Replies:
    0
    Views:
    255
    Mike Driscoll
    Aug 22, 2008
  2. Mike Driscoll

    Iowa Python Users Group - First Meeting

    Mike Driscoll, Sep 9, 2008, in forum: Python
    Replies:
    0
    Views:
    199
    Mike Driscoll
    Sep 9, 2008
  3. Mike Driscoll
    Replies:
    0
    Views:
    198
    Mike Driscoll
    Oct 26, 2008
  4. Mike Driscoll
    Replies:
    0
    Views:
    295
    Mike Driscoll
    Nov 27, 2008
  5. Mike Driscoll
    Replies:
    1
    Views:
    265
    Mike Driscoll
    Jan 1, 2009
Loading...

Share This Page