rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
blacknova has quit [Quit: Connection closed for inactivity]
rvalue has quit [Ping timeout: 260 seconds]
dviola has joined #ruby
oneeyedalien has joined #ruby
oneeyedalien has quit [Ping timeout: 244 seconds]
oneeyedalien has joined #ruby
oneeyedalien has quit [Remote host closed the connection]
rvalue has joined #ruby
gr33n7007h has quit [Quit: WeeChat 4.6.3]
gr33n7007h has joined #ruby
<o0x1eef>
gr33n7007h: Good idea.
gr33n7007h has quit [Quit: WeeChat 4.6.3]
grenierm has quit [Ping timeout: 272 seconds]
andy-turner has joined #ruby
blacknova has joined #ruby
gr33n7007h2 has joined #ruby
gr33n7007h2 has quit [Client Quit]
gr33n7007h has joined #ruby
andy-turner has quit [Read error: Connection reset by peer]
<gr33n7007h>
o0x1eef: 👍
<gr33n7007h>
typing from my shiny new thinkpad x13 gen 5 on arch linux, she's a beauty!
<sweatiest>
Quit typing, you're gonna make it all greasy!
<gr33n7007h>
too late ;)
ua__ has quit [Ping timeout: 265 seconds]
<gr33n7007h>
it's perfect in every way!
ua__ has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
gr33n7007h has quit [Quit: WeeChat 4.6.3]
gr33n7007h has joined #ruby
rvalue has joined #ruby
GreenResponse has joined #ruby
cappy has joined #ruby
jmcantrell has joined #ruby
<o0x1eef>
thinkpad++
infinityfye has joined #ruby
blacknova has quit [Quit: Connection closed for inactivity]
jmcantrell has quit [Ping timeout: 276 seconds]
user71 has joined #ruby
gr33n7007h has quit [Quit: WeeChat 4.6.3]
gr33n7007h has joined #ruby
blacknova has joined #ruby
cappy has quit [Quit: Leaving]
pastelowl has joined #ruby
fantazo has quit [Quit: Lost terminal]
Vonter has joined #ruby
Tempesta_ has quit [Quit: See ya!]
pastelowl has quit [Quit: WeeChat 4.6.3]
Tempesta has joined #ruby
smp_ has joined #ruby
smp has quit [Ping timeout: 272 seconds]
smp_ is now known as smp
chair1 has joined #ruby
user71 has quit [Quit: Leaving]
user71 has joined #ruby
<adam12>
gr33n7007h: Nice!
<adam12>
gr33n7007h: In some ways I miss my Thinkpad.
<adam12>
Tho it was a brick. X230
Vonter has quit [Ping timeout: 268 seconds]
blacknova has quit [Quit: Connection closed for inactivity]
wbooze has quit [Read error: Connection reset by peer]
inline has quit [Read error: Connection reset by peer]
chair26 has joined #ruby
chair1 has quit [Ping timeout: 272 seconds]
chair26 is now known as chair1
szkl has joined #ruby
gr33n7007h has quit [Ping timeout: 260 seconds]
wbooze has joined #ruby
gr33n7007h has joined #ruby
schne1der has joined #ruby
wbooze has quit [Ping timeout: 252 seconds]
wbooze has joined #ruby
blacknova has joined #ruby
wbooze has quit [Read error: Connection reset by peer]
<dorian>
hey question about hash keys: since they can be arbitrary objects, how does key comparison happen? like say i want to implement a cache where the keys are arrays of three sets
<o0x1eef>
IIRC key identity is based on #eql? and #hash methods
<o0x1eef>
So as far as I can tell, when two keys return the same #hash, the #eql? method is called to decide identity, otherwise the #hash method alone determines identity
<dorian>
ah so i assume i won't get burned by a leaky abstraction
<dorian>
i just realized while i was working on this thing, like, ya know, you could just use these parameters *as* the hash keys
<o0x1eef>
Each of your Array objects will have a unique #hash if they're different objects but they would appear as distinct keys. I'm not sure that's what you want. But it should be possible, you can control this behavior with eql?/hash
wbooze has joined #ruby
<o0x1eef>
Ah
<o0x1eef>
[1].hash == [1].hash # true
user71 has quit [Quit: Leaving]
<o0x1eef>
So I think this works how you expect
inline has joined #ruby
Vonter has joined #ruby
schne1der has quit [Ping timeout: 252 seconds]
infinityfye has quit [Read error: Connection reset by peer]
<The_Camel_>
o0x1eef, would you mind explaining something to me?
<The_Camel_>
so, layouts and partials. i get the idea. but it's the introduction of the layout.erb that confuses me.
<The_Camel_>
I get what it does. it acts as, well, the layout, for every other page, and chucks in the header, usually, the footer and then the actual page/content.
<The_Camel_>
o0x1eef, what confuses me is this:
<The_Camel_>
I see examples where the rendering/returning of a template in a controller is done as:
<The_Camel_>
```erb :a_page_name```
<The_Camel_>
First question - how does a webserver know what layout to use for that webpage.
<The_Camel_>
Second question - how does the page itself, know what layout to use.
<The_Camel_>
--- It would NOT have confused me if I saw: ```erb :layout || :a_page_name```
<The_Camel_>
but I don't see that.
<The_Camel_>
and that prompts these two questions.
<The_Camel_>
that || may have been ++ too.
fantazo has joined #ruby
GreenResponse has quit [Quit: Leaving]
<The_Camel_>
Because if I look inside a layout.erb, I see only code to know what header and footer to use. not what content/page.
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
<The_Camel_>
...after some digging, it seems there's like 3 ways of doing it...
<The_Camel_>
some involve actually having every single controller ```erb :layout```, and having a ```@content = ...a_page...``` before it.
<The_Camel_>
injecting the model as an actual full page
<The_Camel_>
and others...
<The_Camel_>
have each individual page use a special @decorate feature.
<The_Camel_>
without a <head>
<The_Camel_>
this is so nasty.
<The_Camel_>
both in ruby and java
OC has joined #ruby
<The_Camel_>
because for me, each page has specific <head> properties I need
<The_Camel_>
I can't have layout.erb handle all possible <head>s
<The_Camel_>
it just won't work!
OC has quit [Quit: Client closed]
<The_Camel_>
so there's a thing called a
<The_Camel_>
"Layout Dialect"
<The_Camel_>
and a "Fragment"
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
<The_Camel_>
I think I finally get it.
<The_Camel_>
In short, I need a layout that gets decorated and overridden.
<The_Camel_>
To substitute per-page specific <head>s
<The_Camel_>
layout:fragment expects an injectable decoration
<The_Camel_>
th:replace substitutes a fragment.
<The_Camel_>
Weird as fuck but it will do.
<The_Camel_>
So
<The_Camel_>
First question answer - how does the webserver know which layout to use? If you use the model to pass in which page to render, just return the layout instead.
<The_Camel_>
Second question answer - hoes does the page itself know which layout to use? It has a property which says it decorates layout X.
msv has quit [Remote host closed the connection]
msv has joined #ruby
msv has quit [Remote host closed the connection]
msv has joined #ruby
chair32 has joined #ruby
chair1 has quit [Ping timeout: 272 seconds]
<The_Camel_>
<title layout:title-pattern="$TITLE - My Site">My Site</title>
<The_Camel_>
Not sure why I'd want a title-pattern.
<The_Camel_>
that stuff would get overriden by each of my pages.
<The_Camel_>
trying to figure out what possible usecase it may have.
cappy has joined #ruby
chair32 is now known as chair1
shiru has joined #ruby
shiru has quit [Remote host closed the connection]