bvdw has quit [Read error: Connection reset by peer]
bvdw4 has joined #ruby
bvdw4 is now known as bvdw
mwlang has quit [Quit: mwlang]
davidw has quit [Ping timeout: 272 seconds]
Inoperable has joined #ruby
buckworst has joined #ruby
bvdw has quit [Quit: bvdw]
poontangmessiah has quit [Ping timeout: 256 seconds]
Inoperable has quit [Quit: All your buffer are belong to us!]
Inoperable has joined #ruby
bvdw has joined #ruby
davidw has joined #ruby
<leitz>
Getting back to work on some old projects. Trying to split my brain into stuff for work (perl), and stuff for me.
<leitz>
Spent most of December bed-ridden. Now doing "gem update"; it's taking a while. :)
evdubs has quit [Quit: Leaving]
drincruz has quit [Ping timeout: 256 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
ewanchic has joined #ruby
jaequery has quit [Remote host closed the connection]
markopasha has quit [Remote host closed the connection]
<ewanchic>
? I'm creating a gem module 'Freight' that inherts class CLI < Thor. How would I test a private method? expects {Freight::CLI.send(:some_private_method) }.to ?
leitz has quit [Quit: Leaving]
<al2o3-cr>
ewanchic: yup! that's one way.
<ewanchic>
al2o3-cr: I keep getting undefined error.
<ewanchic>
al2o3-cr: I keep getting undefined method 'some_private_method' error.
evdubs has joined #ruby
davidw has quit [Ping timeout: 272 seconds]
<al2o3-cr>
ewanchic: pastebin actual code
wildtrees has quit [Quit: Leaving]
<ewanchic>
al2o3-cr: hmm, it's spread across 2-4 files...but is there a way push my code up to a temp repo. the project is very tiny right now.
<ewanchic>
al2o3-cr: Or, I could messy up my public repo for now too.
ur5us has quit [Ping timeout: 256 seconds]
<ewanchic>
al2o3-cr: you know...hold on.. I can git it for you...
<al2o3-cr>
ewanchic: do you want header and footer to be singleton methods?
gnufr33d0m has joined #ruby
<ewanchic>
al2o3-cr: ...hold on a minute...
<al2o3-cr>
ok
gnufr33d0m has quit [Excess Flood]
<ewanchic>
al2o3-cr: ....I'm not sure how to answer that. 'footer', should be private. But when I started separating methods for Thor, I had to keep structuring them in this format.
<ewanchic>
al2o3-cr: I admit, I'm diving more into Ruby now than Rails, so I'm a bit ignorant/rusty to the terminology. I think I know what I'm talking about...but I probably don't.
<al2o3-cr>
then to test; expect { Frieght::CLI.new.send :some_private_method }.to ... new here creates an instance of Freight::CLI
<ewanchic>
al2o3-cr: BTW, I have a much larger and fuller gem (but still incomplete right now). and I'm just little by little copying code pieces into here to "start from scratch" and nail down the rspec tests as I should.
<ewanchic>
al2o3-cr: ok, let me try that...I think I was close but it still didn't work...hold on...
<al2o3-cr>
yeah, take baby steps.
cnsvc has quit [Remote host closed the connection]
cnsvc has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
ur5us has joined #ruby
drincruz has joined #ruby
<ewanchic>
al2o3-cr: Ok, I was close. I tried to @fr8 = Freight::CLI.new, and then @fr8.send :footer, but it failed becuase I forgot to wrap the first line in a before do/end. Thanks a lot. Baby steps for sure.
<al2o3-cr>
ewanchic: np, good luck with your gem ;)
<ewanchic>
al2o3-cr: Oh man, that feel so good. Thank you.
drincruz has quit [Ping timeout: 268 seconds]
fig-le-deunch has quit [Read error: Connection reset by peer]
fig-le-deunch has joined #ruby
Mrgoose845701915 has quit [Quit: Ping timeout (120 seconds)]
Mrgoose845701915 has joined #ruby
fig-le-deunch has quit [Client Quit]
fig-le-deunch has joined #ruby
spectra has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
drincruz has joined #ruby
gnufr33d0m has quit [Remote host closed the connection]
spectra has joined #ruby
gnufr33d0m has joined #ruby
duderonomy has joined #ruby
gendarme has joined #ruby
gnufr33d0m has quit [Remote host closed the connection]
<ratah>
Apart from NodeBB requiring JavaScript for its front-end, which in itself is a huge security risk -- while Thredded is fully functional without. Any thoughts?
<lmat>
"...churns out a modified dictionary!" I actually did expect it to modify the dictionary, but not by changing the root object. I thought .permit would trim elements that shouldn't be in there (which it does), and .require would not modify params at all if everything's okay, or raise an exception if something's missing.
TzilTzal has quit [Quit: Leaving.]
chalkmonster has quit [Quit: WeeChat 2.7]
conta1 has joined #ruby
conta1 has quit [Client Quit]
meinside has quit [Quit: Connection closed for inactivity]
grr12314 has quit [Remote host closed the connection]
SeepingN has joined #ruby
<lmat>
Okay, I think I'm ready to post a cogent question...sort of ^_^
<lmat>
My UserController has params.require(:user).permit(:id, :name) That means I'm expecting params that look like this: { user: { id: 1, name: 'steve' } } right?
<lmat>
So if I get params like this: {id: 1, name: 'steve'} it won't work. The error is "param is missing or the value is empty: user", right?
<havenwood>
lmat: yup
fercell has quit [Quit: WeeChat 2.7]
turbo_choo has quit [Ping timeout: 240 seconds]
<lmat>
havenwood: When I user = User.find_by(email: params[:email]); redirect_to user; it's passing params like {id: 1}
ttoocs has quit [Ping timeout: 240 seconds]
freshmaker666 has quit [Quit: ZNC 1.7.2 - https://znc.in]
freshmaker666 has joined #ruby
freshmaker666 has joined #ruby
<lmat>
How do I get it to pass {user: {id: 1} } instead?
<lmat>
I tried this: redirect_to user, params: {user: user.id} but when I follow_redirect! the redirect is to /users/1 and since the route is /users/:id, I'm only getting params {id: 1}. This all makes sense...but how do I make it work? ^_^
spacesuitdiver has joined #ruby
chalkmonster has joined #ruby
spacesuitdiver has quit [Remote host closed the connection]
spacesuitdiver has joined #ruby
<lmat>
My first response would be to remove .require(:user) . That's no good though because another controller extends this one.
<lmat>
(that other controller is invoice, and probably many others)
<lmat>
So, when an invoice is requested, :id is set to the invoice ID, but when the user controller checks for the current user, the :id is an invoice ID! So checking for the user goes sideways.
poontangmessiah has joined #ruby
<lmat>
Seems like the best way then is to require params like this: { user: {id:1}, invoice: {id:1} }
jinie_ has joined #ruby
jinie has quit [Ping timeout: 272 seconds]
jinie_ is now known as jinie
claudiuinberlin has joined #ruby
johnny56_ has joined #ruby
johnny56 has quit [Ping timeout: 240 seconds]
Helenah has quit [Read error: Connection reset by peer]
Helenah has joined #ruby
poontangmessiah has quit [Quit: WeeChat 2.7]
davidw has joined #ruby
davidw has quit [Changing host]
davidw has joined #ruby
<lmat>
havenwood: GOT IT! \o/ my redirect_to needed to look like this: redirect_to users_path(user, params: {user: { id: user.id} })
<lmat>
I had done redirect_to user, params: {user: {id: user.id} } but that wasn't any good.
renich has joined #ruby
<lmat>
Well, that was close. That was taking me to the index action. I needed the show action, so this works; redirect_to user_path(user, params: {user: { id: user.id} })
impermanence14 has joined #ruby
impermanence14 has quit [Remote host closed the connection]
impermanence98 has joined #ruby
impermanence98 has quit [Remote host closed the connection]
<lmat>
win 1
mikecmpbll has quit [Quit: inabit. zz.]
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
Helenah has quit [Ping timeout: 272 seconds]
conta1 has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta1 has quit [Client Quit]
leitz has joined #ruby
ellcs has quit [Ping timeout: 272 seconds]
oncall-pokemon has joined #ruby
Helenah has joined #ruby
<leitz>
Anyone know if there's a way to remove a gem from RubyGems?
s3nd1v0g1us has joined #ruby
zlogan has quit [Remote host closed the connection]
<mikdusan>
havenwood: thanks I'll try working with OptionParser::Officious. I have a front-end parser to one or more backends and am interested in pass-thru whatever is not picked off by front, with out resorting to '--' handling
jaequery has quit [Ping timeout: 240 seconds]
mikdusan has left #ruby ["WeeChat 2.5"]
renich has joined #ruby
hiroaki has joined #ruby
fphilipe has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<leitz>
What readline file does irb require? Using CentOS 7, and readline worked the other day; prior to a gem update.
fphilipe has quit [Ping timeout: 268 seconds]
wildtrees has quit [Remote host closed the connection]
fphilipe has joined #ruby
wildtrees has joined #ruby
jaequery has joined #ruby
ChmEarl has joined #ruby
<dStromboli>
Hey all, I'm working on setting the CSS for a partiular HTML element, and I found an answer but I'm not quite sure what I'm looking at. This goes in the .haml file: %th{:class => @title_header}
<dStromboli>
I know that @title_header is a controller variable, but what's the deal with :class, and why's it in brackets? I'd appreciate an API page link or something similar because I'm having a hard time figuring out what to search. Many thanks.
jaequery has quit [Ping timeout: 256 seconds]
s2013 has joined #ruby
zapata has quit [Quit: WeeChat 2.7]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
john2496 has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
cd has joined #ruby
sergioro has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
teej has joined #ruby
ratah has quit []
cthulchu has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
<havenwood>
dStromboli: `:class` is a Symbol, and it's used here as the key for a Hash.
<havenwood>
dStromboli: You could write it: file: %th{class: @title_header}
schne1der has quit [Ping timeout: 272 seconds]
<dStromboli>
Where's the hashmap defined?
<havenwood>
dStromboli: class: @title_header
<dStromboli>
havenwood: Oh, gotcha. Thanks.
ratah has joined #ruby
<ratah>
That feeling when you realize you've learned in the Rails Guide the hard way
<ratah>
Should have just read the guides in the first place :)
<ratah>
Helenah: or what?
<ratah>
Helenah: hey what was your soundcloud again?
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oncall-pokemon has quit [Quit: Connection closed for inactivity]
im0nde has joined #ruby
im0nde_ has quit [Ping timeout: 256 seconds]
impermanence has quit [Remote host closed the connection]
pwnd_nsfw has quit [Read error: Connection reset by peer]
<ratah>
* that feeling when you realize you've learned something the hard way, that you realize you could have learned through the rails guide the easy way
<ratah>
yeah that's it
<ratah>
man i wish english was my first language
<ratah>
unfortunately ruby is my first language :D
<ratah>
* that feeling when you realize you've learned something the hard way that you could have learned through the rails guides the easy way