06:59
<khaase>
anybody awake?
07:03
<* shift>
is kind of around.
07:05
<khaase>
how long does it usually take till people comment on submitted patches? i.e. how do i get peoples attention?
07:10
<harryv>
khaase: open a ticket in lighthouse
07:11
<harryv>
.. oh, you already have.
07:11
<harryv>
I need to renew my domain so I get all these damn mails :D
07:11
<khaase>
it's not an old ticket or something. just wanted to poke around to get things moving.
07:12
<khaase>
harryv: but yeah, i did that.
07:14
<cypher23>
khaase, depends. rtomayko or sr usually look at them, and I guess it depends on their workload
07:15
<khaase>
cypher23: okay. that's sort of an answer i was looking for.
07:15
<cypher23>
you can poke/ask them when they're around in here
07:16
<khaase>
as i was not really sure who is like "in charge" now
07:16
<cypher23>
Not sure if there's such a thing as a core team w/ sinatra, but bmizerany did most of the inital work (and still commits stuff), and rtomayko and sr do most of the current development
08:11
<giskard>
hi guys how can i retrive the IP that makes a connect from sinatra?
08:15
<harryv>
giskard: request.ip
08:16
<giskard>
so easy? thanks
10:23
<neonski>
hey good morning / afternoon / evening everyone
10:23
<neonski>
am having issues receiving application/json content type on a POST
10:23
<cypher23>
generic greetings to you too!
10:24
<neonski>
you never know what time zone ppl are in eh
10:25
<neonski>
essentially request.POST returns nothing
10:25
<cypher23>
request.body is also empty?
10:25
<neonski>
i am making the query via rest-client, resource.post( payload, :content_type => "application/json" )
10:26
<cypher23>
neonski, I have a similar app, I just do a `data = request.body.read'
10:27
<neonski>
i'll try that right now. it seems that Rack::Request is trying to make sense of what's in the body
10:27
<neonski>
probably expecting form data
10:28
<neonski>
hey that worked perfectly. awesome, thanks cypher23
10:31
<cypher23>
and yes, Rack::Request#POST expects a form post
10:31
<cypher23>
not a 'generic' (or whatever it is called) POST from e.g. RestClient
10:35
<neonski>
that'd be something interesting to add to rack, maybe.. to handle content_type => "application/json"
10:35
<neonski>
and return a hash
10:35
<neonski>
dunno if it's a common case but we tend to do a lot with json around here
10:39
<cypher23>
neonski, well, you could monkey-patch it in (or into Sinatra's Request class)
10:42
<neonski>
for sure yes...
10:48
<neonski>
cypher23: i'm still a ruby noob - is there an easy way in ruby to do "aspect oriented" programming? i would simply like to wrap certain methods when i'm in debug mode, for example
10:49
<neonski>
i'm used to doing that in javascript a lot (and currying, etc... )
11:29
bradgonesurfing joined
12:11
<namelessjon>
neonski: I think there's a middleware to do json conversion automagically
12:11
<namelessjon>
neonski: Possibly in rack-contrib
13:32
<SeanLazer>
Does anyone know what it means when my app tells me "Not Found" on every URL in production (using Apache + Passenger and Sinatra 1.0)
13:32
<SeanLazer>
The same actions work fine on my local machine
14:00
<neonski>
SeanLazer: do you mean for routes you have defined, or static files?
14:00
<SeanLazer>
neonski: Defined routes, static files still load
14:01
<neonski>
you have :set the root of the application in your rackup file?
14:01
<neonski>
(or in your app or whatever)
14:01
<SeanLazer>
no i have not
14:01
<SeanLazer>
set :root, '/' ?
14:02
<neonski>
usually i would use set :root, File.dirame(__FILE)
14:02
<neonski>
usually i would use set :root, File.dirname(__FILE)
14:02
<neonski>
uhh __FILE__
14:03
<neonski>
you can set :app_file also
14:03
<neonski>
to your main .rb file
14:03
<SeanLazer>
a ha, ok i'll give that a try
14:05
<SeanLazer>
not in my config file?
14:06
<SeanLazer>
setting it in my main app.rb file still gives me "Not Found"
14:06
<SeanLazer>
and setting it in config.ru gives me a passenger error
14:06
<SeanLazer>
saying no such whatever _FILE_
14:08
<neonski>
you would do it in your main app.rb file
14:08
<neonski>
it's __FILE__
14:08
<neonski>
if you still get not found, something else is wrong
14:08
<neonski>
have you looked at the apache error log?
14:27
<Craig`>
can someone assist me? this is my code: hey guys, can someone help me with sinatra? here is my code:
http://pastie.org/874410 .. I tried to visit the URI commented in the code, but I get a 404 message saying, "Sinatra doesn't know this ditty." can you tell me where I'm going wrong please?
14:40
<atmos>
Craig`: the /v/ portion is why it's 404ing
14:40
<Craig`>
why is that?
14:40
<Craig`>
basically all I'm wanting to do is get the end part of the URI, and then go to fukung.net/whatever
14:41
<Craig`>
righto, thanks.
16:18
<tibaza`>
Hi everyone! I think I'm missing something really basic...
16:18
<tibaza`>
How do you nest views into a layout so that they don't step on each other?
16:19
<tibaza`>
Let me explain: I have two divs, the first is a form, and the second is for the results of a post on that form.
16:20
<tibaza`>
So the second is rendered after the post.
16:20
<tibaza`>
It seems whatever I try that second div wipes out the first when it renders.
16:21
<tibaza`>
There is a "yield" in the layout.haml file. But how do I get the first view to render into the second div?
16:21
<tibaza`>
Does that make sense?
16:22
<Tuplanolla>
You need to send the whole webpage to the client both times.
16:22
<Tuplanolla>
Unless of course you use some messy AJAX hack.
16:23
<tibaza`>
So both views should have essentially the same content?
16:25
<johnny>
you should send a view that contains 2 partial views..
16:25
<neonski>
jquery supports a kind of partial system using .load...
16:25
<neonski>
you can pass in a selector to only load part of the resulting page, for example
16:25
<neonski>
otherwise with sinatra, you have to roll your own partial "system"
16:26
<atmos>
tibaza`: you probably want :layout => false
16:28
<tibaza`>
atmos: that would be for the second view?
16:29
<atmos>
yeah, or inside of the first view
16:29
<atmos>
if it's a search result that you wnt inserted into the dom then you'll need to send back a document w/o the layout and use JS or something to add the html
16:31
<tibaza`>
So pass the JS in as the second view?
16:35
<tibaza`>
Tuplanolla: I just tried using the "whole webpage" method you describe. Seems to work. I thought I had tried this before and got a nasty "flash" as it reloaded. But now it doesn't... hmm.
16:35
<tibaza`>
I'll try a jquery option, since that is probably less "heavy".
16:51
<Tuplanolla>
It's likely to be slower and mostly unsupported, tibaza.
16:52
<johnny>
mostly unsupported? by who?
16:53
<Tuplanolla>
By browsers.
16:53
<Tuplanolla>
And many people keep JS turned off.
17:00
<johnny>
most people have js turned on
17:00
<johnny>
almost the same amount of people have js turned on.. as have flash installed
17:00
<johnny>
if you look at the number of people who use gmail and google maps
17:01
<johnny>
then you must have js on
17:04
<tibaza`>
Thanks guys. I use a lot of jquery,so I'll go with a combined effort. See, I knew it was basic! :-)
19:57
<grandy>
hello, anyone have any ideas for how to have my current_user method not query the db each time it's called?
19:57
<grandy>
(it is a helper method)
19:59
<namelessjon>
grandy: I assume it pulls the id from the session?
19:59
<grandy>
namelessjon, yep
19:59
<namelessjon>
grandy: def current_user; @user ||= User.get(session[:id]); end or so.
20:00
<grandy>
i am doing that but it still queries multiple times, oddly
20:00
<namelessjon>
grandy: Does the user exist?
20:01
<grandy>
namelessjon, hah that is the problem :) doh
20:02
<grandy>
namelessjon, can you think of a way to avoid the queries? I guess not since there is no way to know which call is the last ...
20:03
<namelessjon>
grandy: You could always make a AnonCoward object which quacks like a User?
20:03
<namelessjon>
grandy: Then, if you actually log in, explicitly set @user
20:03
<grandy>
namelessjon, ahh ok interesting
20:44
aaroninfidel_ joined
20:50
haruki_zaemon joined
20:56
<haruki_zaemon>
I'm using Rack:RelativeRedirect but that doesn't seem to add the context path either
20:56
<johnny>
sinatra doensn't have such a thing..
20:58
<haruki_zaemon>
johnny: right, I figured it was probably a rack thing after I asked the question
20:58
<haruki_zaemon>
might go ask the rack guys
21:00
<haruki_zaemon>
thanks
23:14
bradgonesurfing joined