[tpm] Playing with Dancer (beginner assistance required)

J. Bobby Lopez jbl at jbldata.com
Wed Apr 6 13:11:56 PDT 2011


Alright, so I got as far as setting up a couple of routes to return
serialized JSON provided the input is correct.

So far, so good.

Now, I'm trying to handle forms.. so far I I'm using HTML::FormFu, and it
seems to flow well with the templates.

The question I have now is, how do I utilize the JSON api routes I've
created from a form.

For example, say I have '/api/1.0/component/input' which returns serialized
JSON.

Now lets say I have '/ui/1.0/form1' which provides an HTML form for the user
to submit something.

Once I retrieve the parameters, how do I use it to make a request to the
'component' api above.

Some code might be helpful, see here:
http://pastebin.jbldata.com/m66912508


-Bobby


On Tue, Mar 29, 2011 at 1:10 PM, J. Bobby Lopez <jbl at jbldata.com> wrote:

> Understood.. I thought it was the other way around (config.yml overrides
> development.yml).  Logging works now, thanks!
>
>
> On Tue, Mar 29, 2011 at 1:07 PM, Dave Doyle <dave.s.doyle at gmail.com>wrote:
>
>> Okay, stuff in the development.yaml will override stuff in config.yml (the
>> intent is so you can have difference loggers, log levels, etc for
>> production/dev) so it's going to change the logger to a console logger so
>> you should see it directly in the output (not sure why you don't). You can
>> try yanking the log stuff out of config.yml and change the development.yml
>> to logger to "file".  It should then log to log/development.log.
>>  --
>> dave.s.doyle at gmail.com
>>
>>
>> On Tue, Mar 29, 2011 at 1:01 PM, J. Bobby Lopez <jbl at jbldata.com> wrote:
>>
>>> Hey Dave,
>>>
>>> I just added two lines to the default config.yml:
>>> logger: 'file'
>>> log: 'core'
>>>
>>> I'm running the app via ./bin/app.pl, yes.
>>>
>>> Didn't modify development.yml, but see that it is the following:
>>>
>>> logger: "console"
>>> log: "core"
>>> warnings: 1
>>> show_errors: 1
>>> auto_reload: 0
>>>
>>> On Tue, Mar 29, 2011 at 12:51 PM, Dave Doyle <dave.s.doyle at gmail.com>wrote:
>>>
>>>> 1) How are you running the app?  Just perl bin/app.pl?
>>>> 2) Can you post the contents of config.yml and
>>>> environments/development.yml? ( less passwordy-bits of course)
>>>>
>>>> Thanks,
>>>> D
>>>> --
>>>> dave.s.doyle at gmail.com
>>>>
>>>>
>>>> On Tue, Mar 29, 2011 at 12:44 PM, J. Bobby Lopez <jbl at jbldata.com>wrote:
>>>>
>>>>> So I started playing with Dancer, and am trying to figure out how to
>>>>> enable logging.
>>>>>
>>>>> I've seen the Dancer Cookbook, and saw the Dancer::Config stuff:
>>>>>
>>>>> Dancer::Config::setting('appdir',$appdir);
>>>>> Dancer::Config::load();
>>>>>
>>>>> And I added the 'logger' and 'log' items to the config.yml file, but
>>>>> when I try to use a simple debug statement, such as:
>>>>>
>>>>> debug "hey it's me";
>>>>>
>>>>> It doesn't log to the console or any log file.  No log file is created
>>>>> in the appdir/.
>>>>>
>>>>> What am I missing?
>>>>>
>>>>> Thanks,
>>>>> -Bobby
>>>>>
>>>>> _______________________________________________
>>>>> toronto-pm mailing list
>>>>> toronto-pm at pm.org
>>>>> http://mail.pm.org/mailman/listinfo/toronto-pm
>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20110406/6dad38c3/attachment.html>


More information about the toronto-pm mailing list