havenwood changed the topic of #ruby to: Ruby 3.3.0, 3.2.2, 3.1.4 https://www.ruby-lang.org | Rules https://ruby-community.com | Logs https://libera.irclog.whitequark.org/ruby
szkl has joined #ruby
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
xlymian has quit [Ping timeout: 260 seconds]
jenrzzz_ has quit [Ping timeout: 256 seconds]
xlymian has joined #ruby
jenrzzz_ has joined #ruby
xlymian has quit [Ping timeout: 260 seconds]
jenrzzz_ has quit [Ping timeout: 252 seconds]
xlymian has joined #ruby
xlymian has quit [Ping timeout: 240 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 256 seconds]
jenrzzz_ has joined #ruby
xlymian has joined #ruby
m_antis has quit [Ping timeout: 256 seconds]
jenrzzz_ has quit [Ping timeout: 245 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 245 seconds]
jenrzzz_ has joined #ruby
r3m has quit [Quit: WeeChat 4.2.0-dev]
jenrzzz_ has quit [Ping timeout: 256 seconds]
ua_ has quit [Ping timeout: 245 seconds]
ua_ has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
szkl has quit [Quit: Connection closed for inactivity]
JamesB192 has quit [Quit: No Ping reply in 180 seconds.]
JamesB192 has joined #ruby
smp has quit [Ping timeout: 252 seconds]
ua_ has quit [Ping timeout: 252 seconds]
ua_ has joined #ruby
smp has joined #ruby
jenrzzz has joined #ruby
asio has quit [Ping timeout: 252 seconds]
asio has joined #ruby
r3m has joined #ruby
brokkoli_origin has quit [Ping timeout: 256 seconds]
brokkoli_origin has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
<ih8u> adam12, ox1eef_: thank you, the :multi_public plugin turned out to be the perfect tool for that job
fercell_ has joined #ruby
fercell has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
Paris has joined #ruby
jenrzzz has joined #ruby
jenrzzz_ has quit [Ping timeout: 268 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
m_antis has joined #ruby
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
xlymian has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz_ has quit [Ping timeout: 256 seconds]
Paris has quit [Remote host closed the connection]
Paris has joined #ruby
xlymian has joined #ruby
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz_ has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
_ht has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz_ has quit [Ping timeout: 256 seconds]
Paris has quit [Remote host closed the connection]
jenrzzz has joined #ruby
CRISPR has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
CRISPR has quit [Quit: WeeChat 3.8]
xlymian has quit [Ping timeout: 260 seconds]
xlymian has joined #ruby
xlymian has quit [Ping timeout: 260 seconds]
xlymian has joined #ruby
xlymian has quit [Ping timeout: 260 seconds]
sam113101 has quit [Quit: WeeChat 4.1.1]
_ht has quit [Remote host closed the connection]
xlymian has joined #ruby
xlymian has quit [Ping timeout: 260 seconds]
xlymian has joined #ruby
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
teclator has joined #ruby
schne1der has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
Paris has joined #ruby
sam113101 has joined #ruby
Paris has quit [Remote host closed the connection]
Paris has joined #ruby
Paris has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
xHire has left #ruby [#ruby]
jenrzzz has quit [Ping timeout: 264 seconds]
xlymian has quit [Ping timeout: 240 seconds]
Paris has joined #ruby
Paris has quit [Ping timeout: 246 seconds]
Linux_Kerio has joined #ruby
xlymian has joined #ruby
xlymian has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
xlymian has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
xlymian has quit [Ping timeout: 260 seconds]
Paris has joined #ruby
xlymian has joined #ruby
xlymian has quit [Ping timeout: 260 seconds]
szkl has joined #ruby
TomyWork has joined #ruby
xlymian has joined #ruby
Paris has quit [Ping timeout: 252 seconds]
schne1der has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
schne1der has joined #ruby
xlymian has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
nmollerup has quit [Remote host closed the connection]
nmollerup has joined #ruby
xlymian has joined #ruby
xlymian has quit [Ping timeout: 260 seconds]
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
mark22k has quit [Quit: Ping timeout (120 seconds)]
mark22k has joined #ruby
xlymian has joined #ruby
xlymian has quit [Ping timeout: 245 seconds]
xlymian has joined #ruby
Vonter has quit [Ping timeout: 260 seconds]
Vonter has joined #ruby
infinityfye has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
dalan03822833 has quit [Quit: dalan03822833]
dalan03822833 has joined #ruby
graywolf has joined #ruby
Paris has joined #ruby
infinity_fye has joined #ruby
infinityfye has quit [Killed (NickServ (GHOST command used by infinity_fye))]
infinity_fye is now known as infinityfye
Paris has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
JamesB192 has left #ruby [https://quassel-irc.org - Chat comfortably. Anywhere.]
xlymian has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
brokkoli_origin has quit [Remote host closed the connection]
brokkoli_origin has joined #ruby
xlymian has joined #ruby
xlymian has quit [Ping timeout: 260 seconds]
xlymian has joined #ruby
xlymian has quit [Ping timeout: 240 seconds]
xlymian has joined #ruby
xlymian has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
xlymian has joined #ruby
jenrzzz has joined #ruby
user23 has joined #ruby
Paris has joined #ruby
Paris has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 252 seconds]
Paris has joined #ruby
Paris has quit [Remote host closed the connection]
Paris has joined #ruby
user23 has quit [Remote host closed the connection]
Paris has quit [Remote host closed the connection]
Vonter has quit [Ping timeout: 255 seconds]
Vonter has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
Festive_Derg is now known as A_Dragon
Vonter has quit [Ping timeout: 240 seconds]
Vonter has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
egality_ has quit [Remote host closed the connection]
xdminsy has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 245 seconds]
xdminsy has joined #ruby
myappie has quit [Ping timeout: 240 seconds]
desnudopenguino has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
szkl has quit [Quit: Connection closed for inactivity]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
wryish has quit [Quit: %blank%]
jenrzzz has joined #ruby
wryish has joined #ruby
Rovanion has quit [Ping timeout: 252 seconds]
Rovanion has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
Guest48 has joined #ruby
Guest48 has quit [Client Quit]
jenrzzz has joined #ruby
_ht has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
Paris has joined #ruby
rvalue has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
rvalue has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
Paris has quit [Remote host closed the connection]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
ionface has joined #ruby
jenrzzz has joined #ruby
Req has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
Req has quit [Ping timeout: 245 seconds]
Req has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
Vetheon has joined #ruby
Vetheon has joined #ruby
Vetheon has quit [Changing host]
<Vetheon> If anyone is familiar with Sinatra, I'm trying to pass a set of data fetched from a DB from the backend to the JS on the frontend to draw a chart with it. I'm getting the right response out of everything until I'm trying to actually use the data. When logging to the browser console, it shows the data is null, but when looking at the response in the Network tab, it shows that it's properly returning the
<Vetheon> data. Any ideas? Let me know what code/logs you need to see and I'll pastebin them up for you
<ox1eef_> Vetheon: Do you obtain the data with window.fetch ? Is it JSON ? Do you: fetch(...).then((res) => res.json()) ?
cek has joined #ruby
jenrzzz has joined #ruby
<Vetheon> so, the Sinatra backend fetches the data from the database: (main.rb) https://pastebin.com/f4xJHCRH Then it should get passed to the ERB template partial: (_overall_network_status.erb) https://pastebin.com/giQ1NqFk which is where the JS should get it, and where the problem is [I think?]: (overall_network_status.js): https://pastebin.com/qB8qQn96
<ruby[bot]> Vetheon: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<Vetheon> Well sorry bot, I don't trust Github and don't know a better pastebin.
jenrzzz has quit [Ping timeout: 252 seconds]
ionface has quit []
xdminsy has quit [Ping timeout: 260 seconds]
<Vetheon> If pastebin is really that bad, I've found a better place for it: (overall_network_status.js) https://snippet.host/pryteg (_overall_network_status.erb) https://snippet.host/eotqme and (main.rb) https://snippet.host/mtypcb
dagamant has joined #ruby
<ox1eef_> Are you sure the JSON is in the format: {'data' => ...} ? It seems that key does not exist.
<Vetheon> I mean, it potentially doesn't I suppose. I guess in the database it doesn't have a key like that, so in the converted object it wouldn't either
<Vetheon> If that's really the problem, I'm gonna fricken break my own toe off man
<ox1eef_> I would guess that might be it.
<Vetheon> Alright, here's my potential fix: https://snippet.host/uazpjr
<Vetheon> Testy test time
<Vetheon> Ok, so I'm still running into the same issue. It's strange, the Sinatra logs prove the object exists, and is now formatted properly. However, in the browser console it says: Current Status Data: null overall_network_status.js:4:13Historical Status Data: null overall_network_status.js:5:13
<Vetheon> Which means the JS still isn't getting the data
<ox1eef_> Log the then after res.json(), eg: console.log(currentStatus)
<ox1eef_> And, don't forget to update the JSON route. You have upodated HTML AFAICT.
<Vetheon> Oh yeah, I'm just silly, the JSON object still isn't formatted properly: https://snippet.host/ujeguo
jenrzzz has joined #ruby
<ox1eef_> {'data' => result} should do it.
<Vetheon> So, the JSON object is formatted properly now. Here's a breakdown: https://snippet.host/uqqxqo
jenrzzz has quit [Ping timeout: 260 seconds]
<Vetheon> The overall problem here is that the JS isn't getting the data, which means my charts aren't drawing. It was working fine before I tried to implement an auto-refresh mechanism so you don't need to refresh the page to get new data
jenrzzz has joined #ruby
<ox1eef_> So you throw an error, which means the data key is still not right ? I think you want to update DataFetcher class, so that you return {'data' => result}.
dagamant has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
<Vetheon> mkay let me try that
Req has quit [Ping timeout: 260 seconds]
<Vetheon> Alright, here's my implementation of the fix: https://snippet.host/tjgokb
<Vetheon> Testing now
Req has joined #ruby
<Vetheon> Results including Browser and Sinatra logs: https://snippet.host/pkzegr
<Vetheon> Still the same issue
szkl has joined #ruby
<Vetheon> I've been banging my head against this issue for like 3 hours. I have no idea what's going on
<ox1eef_> Can you check the network tab, and see what the response body is?
Req has quit [Ping timeout: 256 seconds]
<Vetheon> This is the response body from the network tab: https://snippet.host/tuqarq
<ox1eef_> So that looks right. Try to remove the guard that throws an error. You can also add: console.log(currentStatus).
<ox1eef_> Under this line is the best place to debug: const currentStatus = responseData.data; ... or before it.
<Vetheon> Yep, just ran the test. Putting the results in a paste. One sec
<Vetheon> Results: https://snippet.host/corxii
<ox1eef_> When the array is empty, return early rather than throw. Now I question whether it is the change you made to the HTML view which is the problem. That worked before, right ? But indeed, it seems one problem is solved, and now there is a different one.
<Vetheon> Yeah, everything worked properly before. Basically, it was all working, and pulling from the database properly. Then I changed to refresh the data on a cycle without the user needing to refresh the page manually. Which means AJAX nonsense. Which is when everything broke.
<Vetheon> This is the partial where the charts are loaded from: https://snippet.host/eotqme and this is layout.erb file: https://snippet.host/unftbb
<ox1eef_> Sorry. Have to go AFK for a bit. Back in 20m or less.
<Vetheon> No problem, I'll be here still trying to solve the issue lol
jenrzzz has quit [Ping timeout: 276 seconds]
<adam12> Vetheon: What happens if you use `<%==` instead of `<%=`?
<adam12> (inside your `<script>` tag)
Linux_Kerio has quit [Ping timeout: 245 seconds]
Vetheon has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
EternalSunshine has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
_ht has quit [Remote host closed the connection]
jenrzzz has joined #ruby
brw has quit [Quit: The Lounge - https://thelounge.chat]
brw has joined #ruby
a51 has quit [Quit: WeeChat 4.1.2]
jenrzzz has quit [Ping timeout: 252 seconds]
a51 has joined #ruby
egality has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
Vetheon has joined #ruby
<Vetheon> No idea if my prev messages sent or not... but in synopsis. Tried to use <%== instead of <%=, no change. Starting to consider just making a external API for it
xlymian has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
<Vetheon> Well, time to reboot. Kernel updates yayyyy
Vetheon has left #ruby [#ruby]
infinityfye has quit [Read error: Connection reset by peer]
EternalSunshine has quit [Quit: WeeChat 4.1.2]
schne1der has quit [Quit: schne1der]
passbe has joined #ruby
<weaksauc_> seems like it could be some kind of rendering an empty array based on the second array object being spit out
c10l has quit [Remote host closed the connection]
c10l has joined #ruby
reset has quit [Quit: reset]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
cek has quit [Quit: Connection closed for inactivity]
matoro has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
matoro has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
Linux_Kerio has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]