The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2013-12-13

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:11 jberger_ joined #mojo
00:38 Lee joined #mojo
00:38 sawtooth joined #mojo
00:55 Lee joined #mojo
01:04 laouji joined #mojo
01:17 Lee joined #mojo
01:36 russum joined #mojo
01:40 damaya joined #mojo
01:42 ka2u joined #mojo
01:43 damaya Hi all, I am wanting to loop through a non-blocking request. So, I have this my $delay = Mojo::IOLoop->delay(sub{ my ($delay,$titles) = @_; for my $title (@titles) { for my $titties (@{title}) { ... } } });
01:44 damaya So, my question: Is there an easier way to get at that without having two for loops?
01:53 d4rkie joined #mojo
01:58 damaya Basically I'm just trying to avoid this nested for loop.
01:58 damaya maybe flatten the array
02:07 btyler joined #mojo
02:19 russum left #mojo
02:25 Janos joined #mojo
02:25 Janos hello, starting with mojo here, question, does the public directory gets exported by default ? if yes, what's the route to access it ?
02:27 jnbek^dt joined #mojo
02:29 damaya I am new to it as well. However, I've been using the public directory for static files, such as css, js, images, an so on.
02:29 damaya From my templates in template/ directory, I then access them with 'css/style.css', or 'js/script.js'
02:32 Lee joined #mojo
02:33 Janos well i'm starting the server with `morbo script/myapp` and then go to http://localhost:3000/public/index.html and it says page not found, what url do you use to get your static content ?
02:33 damaya Hm, so let's say I have a route for '/' and that route points to 'templates/index.html.ep'... when I go to http://localhost:3000 in my browser, I see index.html.ep
02:34 damaya I wonder maybe if you just move index.html from public/ to templates/ and then from there your '/' route loads index.html.ep ?
02:34 damaya Ah, and make it have the .ep extension as well
02:35 Janos where do you put your css ?
02:35 damaya Though, if it is static, not sure it makes sense to use Mojolicious at all, unless you're just using it for hypnotoad.
02:35 damaya I put my css in public/css
02:35 damaya my html files in templates/ (with the .ep at the end).
02:36 damaya if you do a 'mojo generate app Blah' you can see the directory structure of a full app
02:36 Janos correct that is what i did
02:36 Janos and how do you reference the css in the view/template ?
02:36 damaya OK, so then css in public/ and html files in templates/, and then routes render the corresponding html file
02:37 damaya just as if it were in the root of your webserver
02:37 Janos ok so href="/css/mycss.css" ?
02:37 damaya without the first /
02:37 Janos ok let me try that
02:37 damaya so, css/mycss.css
02:37 damaya wait, one second, lemme make sure
02:37 damaya yeah, that's how I am doing it
02:38 Janos yup that works, everything it finds in public it exports it under / instead of under /public, kk got it now, thanks a lot
02:39 damaya no problem, glad I could help.
02:46 duncanthrax joined #mojo
02:52 russum joined #mojo
02:52 russum left #mojo
03:05 dabudabu Janos: http://localhost:3000/index.html
03:15 d4rkie joined #mojo
03:34 laouji_ joined #mojo
03:37 rafl left #mojo
04:07 Janos got another question here, how can i have a route that does not have an action, it only renders it's default template ? docs says it's possible but does not say how
04:08 preflex_ joined #mojo
04:09 bpmedley $r->get('/')->to(controller => 'Index', action => 'slash');  <-- Might try something like that.
04:09 bpmedley I think it will render index/slash.html.ep
04:14 Janos bpmedley, yup that works thanks
04:14 bpmedley Glad to help
04:14 bpmedley What are you working on?
04:55 tianon you can also just do ->to('index#slash'), btw
05:01 ka2u joined #mojo
05:06 laouji joined #mojo
05:15 russum joined #mojo
05:40 keedi joined #mojo
05:52 laouji joined #mojo
05:59 Lee joined #mojo
06:20 btyler_ joined #mojo
06:21 batman HAPPY BIRTHDAY MARCUS!!!! :)
06:26 beyondcreed joined #mojo
06:52 duncanthrax joined #mojo
06:59 rem_lex|pivo joined #mojo
07:00 Tiger joined #mojo
07:15 mire__ joined #mojo
07:24 Tiger joined #mojo
07:29 ka2u joined #mojo
07:39 Vandal joined #mojo
07:42 laouji_ joined #mojo
07:43 ladnaV joined #mojo
07:47 Lucas1 joined #mojo
07:58 rem_lex joined #mojo
08:09 nicolaas joined #mojo
08:09 trone joined #mojo
08:17 dod joined #mojo
08:19 laouji joined #mojo
08:28 marcus batman: thanks :)
08:29 batman have you gotten any cake?
08:30 marcus Not yet.
08:30 marcus There will be cake this evening at home tho
08:30 marcus and burritos
08:30 purl burritos are the spice of lunch
08:30 marcus And then depeche mode concert
08:32 abqar joined #mojo
08:45 dod joined #mojo
08:47 batman that sound good :)
08:47 batman +s
08:47 batman wish you the best mr.
08:49 tudorconstantin joined #mojo
09:01 Lee joined #mojo
09:10 themage joined #mojo
09:41 Farow joined #mojo
09:57 punter joined #mojo
10:13 Lee joined #mojo
10:14 laouji_ joined #mojo
10:24 arthas joined #mojo
10:37 omega happy bday indeed :)
11:02 fhelmber_ joined #mojo
11:04 laouji joined #mojo
11:07 mjb152 joined #mojo
11:08 mjb152 hi, I'm using Mojolicious::Plugin::Authentication , and I wondered if there was a way to get a list of currently logged in users, otherwise is there a nice trick to do that ?   or should I store it when they login, and handle it when they logout or timeout ?
11:13 hellyna joined #mojo
11:14 laouji_ joined #mojo
11:15 hellyna Hello. I got a question: can you add_check() to the existing validation object in your app? ie $app->validation. or must you make a new one?
11:21 basiliscos joined #mojo
11:22 batman mjb152: you need to store that in a backend, unless you're out of control :)
11:22 batman hellyna: you _should_ add_check() on the existing object imo
11:24 mjb152 not out of control just yet , catching timed out sessions might be tricky though ?
11:26 batman mjb152: depends on the storage
11:26 batman super easy with redis: just set the timeout on "insert"
11:26 batman if sql or something similar: store the timeout with the session data and validate the timeout on retrieval
11:26 basiliscos joined #mojo
11:27 hellyna batman: how do  i do that? add_check method exist in Validator object, ... not Validation object. how do i get the validator object?
11:27 hellyna (maybe i should do a dumper on the object to see what are its innards)
11:28 batman hellyna: $app->validator->add_check() https://metacpan.org/pod/Mojolicious#validator
11:29 batman hellyna: call it on app() (if lite app) or $self in startup()
11:32 bjakubski joined #mojo
11:33 mjb152 I'll investigate that, thanks v much
11:33 batman v..? kids these days :(
11:33 batman saving bandwidth mjb152? ;)
11:34 mjb152 :-)  that made me laugh.  I'm in non verbose mode.
11:34 batman :D
11:35 batman yr wlcm
11:36 mjb152 I've been trying to choose a framework for a while now, dancer, catalyast etc,  and I've got to say I'm very happy I chose Mojolicious. Amazingly powerful and very easy to use once you put a bit of time learning the basics.
11:37 hrupp joined #mojo
11:39 batman mjb152: word.
11:39 batman mjb152: i would say catalyst is...outdated and bloated
11:39 batman and i just don't get dancer. that's why i'm here :)
11:39 batman + marcus convinced me way back...
11:39 batman marcus: thanks for that!
11:42 mjb152 nobody convinced me, it jut seemed the obvious choice.    installed on a lower cost cloud server with nginx and it's super cool to manage.
11:43 basiliscos joined #mojo
11:46 batman sweet :)
11:50 basiliscos joined #mojo
12:00 hellyna batman: thanks. sorry i was cooking :)
12:00 batman yeah! you better stop cooper hellyna!
12:00 batman ;)
12:01 batman oops! wonder how "cooper" got there...
12:08 mfocuz joined #mojo
12:13 dotandimmest_ joined #mojo
12:15 sri marcus: happy birthday!
12:15 purl happy birthday is, like, for (('to you', 'dear '.shift)[0,0,1,0]) { print "Happy birthday $_" }
12:16 dotandimmest joined #mojo
12:17 dotandimmest joined #mojo
12:23 denis_boyun_ joined #mojo
12:25 nicomen joined #mojo
12:34 hellyna batman: sorry i was eating. haha.
12:34 batman hehe
12:34 hellyna batman: is there any specified format i must shape the sub i am throwing in add_check?
12:35 hellyna because i am getting tons of errors. but yes app->validator works
12:37 batman hellyna: https://metacpan.org/pod/release/MRAMBERG/Mojolicious-4.60/lib/Mojolicious/Guides/Rendering.pod#Adding-form-validation-checks
12:38 dotan joined #mojo
12:41 basiliscos1 joined #mojo
12:42 hellyna batman: thanks! didn't know the docs has it. or rather i did a search and nothing relevant came up. maybe google didn't crawl the site good enough yet.
12:43 hellyna sigh i feel stupid getting stuck at this for hours. haha.
12:43 batman good thing you stopped feeling stupid and asked for help :)
12:48 ver joined #mojo
12:51 hellyna batman: It says: A true value may be used to pass along additional information which can then be retrieved with "error" in Mojolicious::Validator::Validation.
12:52 hellyna Does that mean I return an array? Sorry I am new to perl too. You can return an array right?
12:53 batman you can return anything in perl: list, refs, scalar, objects, ...
12:53 hellyna oh
12:53 hellyna wait
12:53 hellyna i think i misread the line
12:53 hellyna so it actually means, return the error message which is at the same time a true value.
12:57 batman sound right
12:57 batman +s
13:34 dsteinbrunner joined #mojo
13:55 btyler joined #mojo
14:07 dvinciguerra joined #mojo
14:18 sh4 joined #mojo
14:18 rem_lex|pivo joined #mojo
14:31 jberger joined #mojo
14:31 sh4 joined #mojo
14:31 dvinciguerra joined #mojo
14:31 ver joined #mojo
14:31 hrupp joined #mojo
14:31 bjakubski joined #mojo
14:31 hellyna joined #mojo
14:31 fhelmber_ joined #mojo
14:31 arthas joined #mojo
14:31 Farow joined #mojo
14:31 tudorconstantin joined #mojo
14:31 dod joined #mojo
14:31 nicolaas joined #mojo
14:31 Lucas1 joined #mojo
14:31 ladnaV joined #mojo
14:31 Tiger joined #mojo
14:31 duncanthrax joined #mojo
14:31 preflex joined #mojo
14:31 d4rkie joined #mojo
14:31 jnbek^dt joined #mojo
14:31 damaya joined #mojo
14:31 sawtooth joined #mojo
14:31 marty joined #mojo
14:31 mtths joined #mojo
14:31 Mike-PerlRecruiter_ joined #mojo
14:31 robinsmidsrod joined #mojo
14:31 cfedde joined #mojo
14:31 Dandre joined #mojo
14:31 jamesw joined #mojo
14:31 espent joined #mojo
14:31 Adura joined #mojo
14:31 zackiv31 joined #mojo
14:31 Foxcool joined #mojo
14:31 alnewkirk joined #mojo
14:31 bpmedley joined #mojo
14:31 tholen42 joined #mojo
14:31 genio joined #mojo
14:31 webart joined #mojo
14:31 memowe joined #mojo
14:31 Kulag joined #mojo
14:31 zacts joined #mojo
14:31 purl joined #mojo
14:31 stephan48 joined #mojo
14:31 augensalat joined #mojo
14:31 Gedge joined #mojo
14:31 sycobuny1 joined #mojo
14:31 crab joined #mojo
14:31 dabudabu joined #mojo
14:31 avenj joined #mojo
14:31 groundnuty joined #mojo
14:31 mikegrb joined #mojo
14:31 caeles joined #mojo
14:31 __mkrull joined #mojo
14:31 Mikey joined #mojo
14:31 Jonis joined #mojo
14:31 jan joined #mojo
14:31 ivan joined #mojo
14:31 tardisx joined #mojo
14:31 gabiruh joined #mojo
14:31 Andreas joined #mojo
14:31 HtbaaPi joined #mojo
14:31 bc547 joined #mojo
14:31 garu joined #mojo
14:31 al joined #mojo
14:31 xtetsuji joined #mojo
14:31 jovial_chat joined #mojo
14:31 batman joined #mojo
14:31 hesperaux joined #mojo
14:31 Bender joined #mojo
14:31 plu joined #mojo
14:31 mgrimes joined #mojo
14:31 davido joined #mojo
14:31 chansen joined #mojo
14:31 d^_^b joined #mojo
14:31 ascent joined #mojo
14:31 cosimo joined #mojo
14:31 tianon joined #mojo
14:31 Kundun joined #mojo
14:31 inokenty joined #mojo
14:31 sivoais joined #mojo
14:31 bayashi joined #mojo
14:31 mattp joined #mojo
14:31 sjn joined #mojo
14:31 bobkare joined #mojo
14:31 Mad_Dud- joined #mojo
14:31 marcus joined #mojo
14:31 howitdo joined #mojo
14:31 yko joined #mojo
14:31 bjoernfan joined #mojo
14:31 jzawodn joined #mojo
14:31 kwa joined #mojo
14:31 elvis joined #mojo
14:31 cottoo joined #mojo
14:31 akiym joined #mojo
14:31 bd joined #mojo
14:31 moritz joined #mojo
14:31 DaTa joined #mojo
14:31 omega joined #mojo
14:31 suy_ joined #mojo
14:31 Zmodem joined #mojo
14:31 lestrrat joined #mojo
14:31 stokachu joined #mojo
14:31 hrupp jberger: can you release App::MojoSlides::MoreTagHelpers as Mojolicious::Plugin::MoreTagHelpers or similar ?
14:32 jberger I probably could
14:32 hrupp would be great but no hurry
14:32 jberger I didn't put a lot of effort into which tags to wrap etc
14:33 jberger Would you like to?
14:33 hrupp Yes I like
14:33 jberger Then I could just have mojoslides depend on yours
14:33 hrupp :)
14:34 hrupp I'm going to do so this weekend...
14:34 jberger Cool
14:35 jberger I'm not sure when I would have had time
14:42 d4rkie_ joined #mojo
14:45 mire__ joined #mojo
14:45 bluescreen joined #mojo
14:47 btyler joined #mojo
14:47 cfedde joined #mojo
14:55 asarch joined #mojo
14:56 d4rkie joined #mojo
15:10 meshl joined #mojo
15:19 Farow|2 joined #mojo
15:52 bluescreen_ joined #mojo
16:01 denisboyun joined #mojo
16:03 Janos joined #mojo
16:41 hummeleBop joined #mojo
16:55 denisboyun joined #mojo
17:10 rem_lex joined #mojo
17:10 denis_boyun_ joined #mojo
17:14 diegok joined #mojo
17:15 tianon joined #mojo
17:24 basiliscos joined #mojo
17:26 mfocuz joined #mojo
17:28 arpadszasz joined #mojo
17:29 zivester joined #mojo
17:30 nic joined #mojo
17:38 denisboyun joined #mojo
17:59 beyondcreed joined #mojo
18:41 Farow joined #mojo
19:03 fhelmbe__ joined #mojo
19:04 meshl joined #mojo
19:10 Mike-PerlRecruiter_ joined #mojo
19:12 dod joined #mojo
19:19 dotan joined #mojo
19:36 dotan joined #mojo
19:42 mire__ joined #mojo
20:01 punter joined #mojo
20:14 Farow joined #mojo
20:56 dotan joined #mojo
21:13 rem_lex|pivo joined #mojo
21:44 trone joined #mojo
22:18 billruppert joined #mojo
22:19 dotan joined #mojo
22:48 beyondcreed joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary