<t4nk410>
Hello, i have a question. I'm writing a rails application. I have this class: http://pastebin.com/0uCMhzr7. if i call the name or lastname method in my view, i get a NoMethodError in StaticPages#filters: undefined method `size' for nil:NilClass
<jhass>
so preferably store firstname and lastname separately, if that's not possible, do something like def name; @name.split("/").first || "(no firstname found)"; end; def lastname; @name.split("/").last || "(no lastname)"; end
<jhass>
that'll yield the same thing for both methods if the @name is non-empty and doesn't contain a "/" though
<jhass>
replace .last by [1] to return it in name as firstname
<jhass>
btw. you can replace your id method with attr_reader :id
michd is now known as MichD
toastynerd has joined #ruby-lang
<t4nk410>
than you
<t4nk410>
thank*
<t4nk410>
but i do not really see why my solution does not work
<jhass>
because split on an empty string returns an empty array and first on an empty array returns nil
<jhass>
on which you can't call size
robmiller has joined #ruby-lang
<t4nk410>
i see
MichD is now known as michd
michd has quit [Quit: Bai!]
toastynerd has quit [Ping timeout: 252 seconds]
franzip has joined #ruby-lang
yfeldblum has quit [Ping timeout: 276 seconds]
michd has joined #ruby-lang
thomasxie has joined #ruby-lang
dingus_khan has joined #ruby-lang
Atttwww has quit [Ping timeout: 276 seconds]
dingus_khan has quit [Ping timeout: 264 seconds]
robmiller has quit [Quit: Leaving.]
kitak has joined #ruby-lang
snsei has joined #ruby-lang
yfeldblum has joined #ruby-lang
alex-quiterio has joined #ruby-lang
benlovell has joined #ruby-lang
snsei has quit [Ping timeout: 240 seconds]
yfeldblum has quit [Ping timeout: 240 seconds]
ur5us has quit [Remote host closed the connection]
junkmechanic_ has joined #ruby-lang
thomasxie has quit [Quit: Leaving.]
alex-quiterio has quit [Quit: Leaving.]
nofxx_ has quit [Ping timeout: 252 seconds]
robmiller has joined #ruby-lang
toretore has joined #ruby-lang
toastynerd has joined #ruby-lang
mikecmpbll has quit [Quit: i've nodded off.]
frobrob has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby-lang
toastynerd has quit [Ping timeout: 265 seconds]
frobrob has joined #ruby-lang
spuk has joined #ruby-lang
cored has joined #ruby-lang
bubodlack has quit [Read error: Connection reset by peer]
simono has joined #ruby-lang
mr-foobar has quit [Read error: Connection reset by peer]
bubodlack has joined #ruby-lang
mr-foobar has joined #ruby-lang
bubodlack has quit [Read error: Connection reset by peer]
bubodlack has joined #ruby-lang
sarkyniin has quit [Ping timeout: 276 seconds]
dingus_khan has joined #ruby-lang
bubodlac has joined #ruby-lang
robmiller has quit [Quit: Leaving.]
bubodlack has quit [Ping timeout: 240 seconds]
woollyams has joined #ruby-lang
dingus_khan has quit [Ping timeout: 252 seconds]
t4nk410 has quit [Quit: Page closed]
stayarrr has joined #ruby-lang
cored has quit [Ping timeout: 265 seconds]
woollyams has quit [Ping timeout: 252 seconds]
cnivolle has joined #ruby-lang
benlovell has quit [Ping timeout: 240 seconds]
phansch has quit [Quit: WeeChat 0.4.3]
kyb3r_ has joined #ruby-lang
postmodern has quit [Quit: Leaving]
GBrawl has quit [Quit: Computer has gone to sleep.]
GBrawl has joined #ruby-lang
ur5us has joined #ruby-lang
Miphix has quit [Quit: Leaving]
toastynerd has joined #ruby-lang
robmiller has joined #ruby-lang
robmiller has quit [Client Quit]
toastynerd has quit [Read error: No route to host]
toastynerd has joined #ruby-lang
ur5us has quit [Ping timeout: 240 seconds]
bubodlack has joined #ruby-lang
bubodlac has quit [Ping timeout: 252 seconds]
toastynerd has quit [Ping timeout: 258 seconds]
banister has joined #ruby-lang
GBrawl has quit [Quit: Computer has gone to sleep.]
snsei has joined #ruby-lang
bubodlack is now known as bubodlack|away
Miphix has joined #ruby-lang
Miphix has quit [Remote host closed the connection]
Miphix has joined #ruby-lang
snsei has quit [Remote host closed the connection]
snsei has joined #ruby-lang
snsei has quit [Remote host closed the connection]
snsei has joined #ruby-lang
snsei has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
kyb3r_ has quit [Quit: Leaving]
snsei has joined #ruby-lang
davs has joined #ruby-lang
yfeldblum has quit [Ping timeout: 252 seconds]
davs has quit [Client Quit]
Burgestrand has joined #ruby-lang
frobrob has quit [Ping timeout: 264 seconds]
snsei has quit [Ping timeout: 252 seconds]
stamina has quit [Quit: WeeChat 0.4.3]
alex-quiterio has joined #ruby-lang
diegoviola has joined #ruby-lang
chouhoulis has joined #ruby-lang
alex-quiterio has quit [Quit: Leaving.]
bubodlack|away is now known as bubodlack
toastynerd has joined #ruby-lang
matp has joined #ruby-lang
bubodlac has joined #ruby-lang
bubodlack has quit [Ping timeout: 276 seconds]
toastynerd has quit [Ping timeout: 252 seconds]
bubodlac is now known as bubodlack
stayarrr has quit [Quit: Leaving...]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dingus_khan has joined #ruby-lang
havenwood has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
dingus_khan has quit [Ping timeout: 258 seconds]
Silex has quit [Ping timeout: 240 seconds]
Silex has joined #ruby-lang
ascarter_ has joined #ruby-lang
ascarter_ has quit [Client Quit]
ascarter_ has joined #ruby-lang
ascarter_ has quit [Client Quit]
ascarter_ has joined #ruby-lang
ascarter_ has quit [Read error: Connection reset by peer]
sarkyniin has joined #ruby-lang
GBrawl has joined #ruby-lang
diegoviola has quit [Quit: WeeChat 0.4.3]
joast has quit [Quit: Leaving.]
GBrawl has quit [Ping timeout: 276 seconds]
banister has joined #ruby-lang
omosoj has joined #ruby-lang
simono has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<roelof_>
centrx: when I try with a second arugument and without I see that things are sorted the right way
omosoj has joined #ruby-lang
GBrawl has joined #ruby-lang
yfeldblum has joined #ruby-lang
sheperson has quit [Ping timeout: 265 seconds]
sheperson_ has joined #ruby-lang
shinnya has quit [Ping timeout: 264 seconds]
yfeldblum has quit [Ping timeout: 240 seconds]
<centrx>
roelof_, It is definitely possible it is just a bug in CodeAcademy
<roelof_>
centrx: There is something with the if then. If I delete it , the error message is also gone
<centrx>
roelof_, Your code seems to follow the instructions
postmodern has joined #ruby-lang
<centrx>
Maybe you are submitting it for an earlier question in the sequence accidentally, before the question about the if-statement with reverse?
<centrx>
(or maybe it thinks you are)
<roelof_>
Not that I aware of it
<roelof_>
centrx: I will fill in a bug report on that and I hope that its get solved soon . Then I can work on and learn ruby
<roelof_>
thanks for the help
<centrx>
Great!
hellome has quit [Ping timeout: 240 seconds]
<centrx>
roelof_, Is there no way to skip ahead in CodeAcademy, since it flags your answer for this question as "wrong"?
<roelof_>
centrx: I found a way. just choose the next assignment . I can now begin at Hashes and symbols
funnel has quit [Ping timeout: 252 seconds]
<centrx>
Excellent, those are very useful and interesting
dmitrykorotkov has quit [Ping timeout: 252 seconds]
<roelof_>
centrx: they begin with things that are already discussed in earlier lessons
alex-quiterio has quit [Quit: Leaving.]
jsullivandigs has joined #ruby-lang
simono has joined #ruby-lang
<centrx>
roelof_, A Hash is an implementation of a data structure called a "hash table". You might be interested in reading about that too, or maybe later (Wikipedia article on it looks okay).
diegoviola has joined #ruby-lang
toastynerd has joined #ruby-lang
freedrull has quit [Ping timeout: 252 seconds]
phansch has joined #ruby-lang
freedrull has joined #ruby-lang
toastynerd has quit [Ping timeout: 264 seconds]
saarinen has joined #ruby-lang
phansch has quit [Client Quit]
jsullivandigs has quit [Remote host closed the connection]
funnel has joined #ruby-lang
diegoviola has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby-lang
vjacob has quit [Ping timeout: 258 seconds]
GBrawl has quit [Quit: Computer has gone to sleep.]
GBrawl_ has joined #ruby-lang
chouhoulis has quit [Ping timeout: 258 seconds]
banister has joined #ruby-lang
achiu has joined #ruby-lang
snsei has joined #ruby-lang
BucOder has joined #ruby-lang
roelof_ has quit [Quit: Page closed]
x0f has quit [Ping timeout: 276 seconds]
dingus_khan has joined #ruby-lang
marcdel has joined #ruby-lang
sandbags has joined #ruby-lang
marcdel_ has joined #ruby-lang
x0f has joined #ruby-lang
marcdel has quit [Ping timeout: 265 seconds]
dingus_khan has quit [Ping timeout: 265 seconds]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yfeldblum has joined #ruby-lang
|jemc| has joined #ruby-lang
jsullivandigs has joined #ruby-lang
yfeldblum has quit [Ping timeout: 276 seconds]
jsullivandigs has quit [Remote host closed the connection]
jsullivandigs has joined #ruby-lang
sharpmachine has joined #ruby-lang
<sharpmachine>
hi
<centrx>
hi
lolmaus has quit [Ping timeout: 240 seconds]
<sharpmachine>
I'm new to IRC
<sharpmachine>
This is like old school chat...nice!
<sharpmachine>
So if I have questions about Ruby, I just ask here?
sheperson_ has quit [Ping timeout: 276 seconds]
snsei has quit [Remote host closed the connection]
<jhass>
yep
lolmaus has joined #ruby-lang
<sharpmachine>
awesome!
<jhass>
and stay around a while, sometimes it may take one or two hours until somebody who knows the answer has time and sees it
<sharpmachine>
okay, cool. Thanks.
sheperson has joined #ruby-lang
jsullivandigs has quit [Ping timeout: 240 seconds]
snsei has joined #ruby-lang
snsei has quit [Remote host closed the connection]
saarinen has quit [Quit: saarinen]
bubodlack has quit [Ping timeout: 260 seconds]
<centrx>
sharpmachine, Also there is a second Ruby channel on Freenode, #ruby , which is sometimes more active than this one
<centrx>
Welcome to IRC!
<sharpmachine>
Ahh, perfect. Thanks for the heads up centrx, and thanks for the welcome
sheperson has quit [Ping timeout: 265 seconds]
toastynerd has joined #ruby-lang
enebo has joined #ruby-lang
danijoo_ has quit [Read error: Connection reset by peer]
DanishMan has joined #ruby-lang
danijoo has joined #ruby-lang
junkmechanic_ has quit [Ping timeout: 240 seconds]
toastynerd has quit [Ping timeout: 252 seconds]
BucOder has quit [Quit: Computer has gone to sleep.]
toastynerd has joined #ruby-lang
omosoj has quit [Ping timeout: 258 seconds]
snsei has joined #ruby-lang
amclain has joined #ruby-lang
dingus_khan has joined #ruby-lang
snsei has quit [Remote host closed the connection]
ghg has joined #ruby-lang
dingus_khan has quit [Ping timeout: 265 seconds]
ghg has quit [Ping timeout: 258 seconds]
dRbiG has left #ruby-lang ["Off"]
BucOder has joined #ruby-lang
snsei has joined #ruby-lang
Cakey has joined #ruby-lang
snsei has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
snsei has joined #ruby-lang
axv has joined #ruby-lang
BucOder has quit [Ping timeout: 258 seconds]
axv has left #ruby-lang [#ruby-lang]
marcdel_ has quit []
BucOder has joined #ruby-lang
sandbags has quit []
yfeldblum has quit [Ping timeout: 276 seconds]
enebo has quit [Quit: enebo]
snsei has quit [Ping timeout: 276 seconds]
ayonkhan has joined #ruby-lang
yatish27 has joined #ruby-lang
BucOder has quit [Ping timeout: 252 seconds]
banister has joined #ruby-lang
mistym has joined #ruby-lang
arooni-mobile has joined #ruby-lang
shinnya has joined #ruby-lang
thmzlt has joined #ruby-lang
arooni-mobile has quit [Ping timeout: 245 seconds]
alex-quiterio has joined #ruby-lang
thmzlt has quit [Client Quit]
alex-quiterio has quit [Client Quit]
snsei has joined #ruby-lang
snsei has quit [Remote host closed the connection]
fezziwig has quit [Remote host closed the connection]
dingus_khan has quit [Remote host closed the connection]
fezziwig has joined #ruby-lang
jsullivandigs has quit [Remote host closed the connection]
jsullivandigs has joined #ruby-lang
fezziwig has quit [Remote host closed the connection]
fezziwig has joined #ruby-lang
dingus_khan has joined #ruby-lang
diegoviola has quit [Quit: WeeChat 0.4.3]
toastynerd has joined #ruby-lang
marcdel has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
lolmaus has quit [Ping timeout: 252 seconds]
toastynerd has joined #ruby-lang
fezziwig has quit [Remote host closed the connection]
marcdel has quit [Client Quit]
pskosinski has quit [Ping timeout: 272 seconds]
fezziwig has joined #ruby-lang
fezziwig has quit [Remote host closed the connection]
dingus_khan has quit [Remote host closed the connection]
lolmaus has joined #ruby-lang
yfeldblum has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
yfeldblu_ has joined #ruby-lang
mistym has joined #ruby-lang
mykoweb has joined #ruby-lang
Nexus_x1 has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
matp has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
sharpmachine has quit [Ping timeout: 264 seconds]
sharpmachine has joined #ruby-lang
dorei has joined #ruby-lang
mykoweb has quit [Read error: No route to host]
mykoweb has joined #ruby-lang
yfeldblu_ has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
toretore has quit [Quit: This computer has gone to sleep]
yfeldblu_ has joined #ruby-lang
yfeldblum has quit [Ping timeout: 252 seconds]
jhass is now known as jhass|off
jsullivandigs has quit [Remote host closed the connection]
Olipro has quit [Ping timeout: 246 seconds]
enebo has quit [Quit: enebo]
sharpmachine has quit [Remote host closed the connection]
Olipro has joined #ruby-lang
kyb3r_ has quit [Ping timeout: 276 seconds]
dingus_khan has joined #ruby-lang
Olipro has quit [Ping timeout: 246 seconds]
kyb3r_ has joined #ruby-lang
rckernel has quit [Quit: rckernel]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby-lang
noob101 has joined #ruby-lang
ur5us has quit [Read error: Connection reset by peer]
<noob101>
Hello, I am new to this channel. This is my very first time being here.
<noob101>
Is this a nice channel?
devgiant has quit [Quit: Leaving]
<centrx>
hi
<centrx>
Yes, this is a nice channel, I thought #ruby was nice too though
ur5us_ has joined #ruby-lang
<centrx>
This channel is generally less active than the other one, but is also the official channel linked from the Ruby website, and has a somewhat different crowd
<noob101>
WAAAAH!
<noob101>
I know you! >:(
ur5us_ has quit [Read error: No route to host]
<centrx>
I didn't know I made such an evil impression :)
ur5us has joined #ruby-lang
<noob101>
LOL! I know you though. I was expecting a greeting from another person.
<noob101>
Maybe I'll stay with ruby, no one said hi to me but you..
dingus_khan has quit [Remote host closed the connection]
dingus_khan has joined #ruby-lang
yfeldblu_ has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
Hytosys has joined #ruby-lang
symm- has quit [Quit: Leaving...]
mistym has quit [Remote host closed the connection]
yfeldblu_ has joined #ruby-lang
Nexus_x1 has quit [Quit: Computer has gone to sleep.]