« Back to channel list

#RubyOnRails - 23 October 2018

« Back 1 day Forward 1 day »
[00:28:25] orbyt_: has joined #RubyOnRails
[00:33:54] orbyt_: has joined #RubyOnRails
[00:51:03] cesario: has joined #RubyOnRails
[00:57:06] sevenseacat: has joined #RubyOnRails
[01:11:35] Saukk: has joined #RubyOnRails
[01:59:55] choke: has joined #RubyOnRails
[02:15:56] w0rd-driven: has joined #RubyOnRails
[02:20:29] luckyruby: has joined #RubyOnRails
[02:25:37] Ryanar: has joined #RubyOnRails
[03:02:48] GodFather: has joined #RubyOnRails
[03:09:46] braincrash: has joined #RubyOnRails
[04:20:30] lexileo: has joined #RubyOnRails
[04:20:45] wojnar: has joined #RubyOnRails
[04:32:13] danguita: has joined #RubyOnRails
[04:35:57] whysthatso: has joined #RubyOnRails
[04:57:45] MoritaShinobu: has joined #RubyOnRails
[05:07:34] FastJack: has joined #RubyOnRails
[05:26:57] kapil____: has joined #RubyOnRails
[05:42:52] tuor: has joined #RubyOnRails
[05:47:30] anubhav996: has joined #RubyOnRails
[05:59:17] reber: has joined #RubyOnRails
[06:05:27] drale2k_: has joined #RubyOnRails
[06:25:43] choke: has joined #RubyOnRails
[06:26:28] srinidhi: has joined #RubyOnRails
[06:30:43] sandstrom: has joined #RubyOnRails
[06:48:49] srinidhi: has joined #RubyOnRails
[06:52:50] hd1: has joined #RubyOnRails
[06:53:00] hd1: ACTION grumbles a tad
[06:53:35] hd1: how do I use ActiveRecord::Base#find_by_sql with multiple parameters?
[06:54:21] sevenseacat: what problem are you having?
[07:02:43] wojnar: has joined #RubyOnRails
[07:11:20] hd1: I solved that issue
[07:13:06] hd1: next problem is that the method isn't spitting out json
[07:13:43] dionysus69: has joined #RubyOnRails
[07:14:07] hd1: @places = Note.find_by_sql(query)
[07:14:24] sevenseacat: that isnt supposed to 'spit out json'
[07:14:28] hd1: @places.to_json # spitting blanks
[07:14:50] sevenseacat: what does it define @places as?
[07:14:57] hd1: if I view places, I see data
[07:15:08] hd1: as in the find_by_sql statement
[07:15:15] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[07:15:57] hd1: a few secs, please
[07:19:13] hd1: https://gist.github.com/hasandiwan/c8154e942eb75d90a517d52570f0905d
[07:20:43] sevenseacat: render json: {@places.to_json} that is not the same thing
[07:21:04] sevenseacat: try just render json: @places
[07:24:39] hd1: thanks sevenseacat
[07:28:45] darkhanb: has joined #RubyOnRails
[07:31:42] sandstrom: has joined #RubyOnRails
[07:57:25] lxsameer: has joined #RubyOnRails
[08:04:47] Ergo: has joined #RubyOnRails
[08:04:51] srinidhi: has joined #RubyOnRails
[08:05:45] mikecmpbll: has joined #RubyOnRails
[08:28:34] drale2k_: I would like to be able to get a blog post via ID or via "alias". Alias i a field i generated when the blog post is generated
[08:29:02] drale2k_: what is the best way to tell rails to first try alias and then fallback to ID if the param is not found as an alias
[08:52:50] status402: has joined #RubyOnRails
[08:54:33] tdy: has joined #RubyOnRails
[08:59:36] srinidhi: has joined #RubyOnRails
[08:59:53] snowy: has joined #RubyOnRails
[09:39:22] Jervis_: has joined #RubyOnRails
[10:46:44] whysthatso: has joined #RubyOnRails
[10:54:11] drale2k_: has joined #RubyOnRails
[11:00:52] lankanmon: has joined #RubyOnRails
[11:02:29] whysthatso: has joined #RubyOnRails
[11:02:44] beholders_eye: has joined #RubyOnRails
[11:05:41] pLaTo0n: has joined #RubyOnRails
[11:07:12] tdy: has joined #RubyOnRails
[11:24:48] jsc: has joined #RubyOnRails
[11:28:03] dionysus69: Hey all, would you help me decide whether I should go the Heroku way for scaling or Google Kubernetes Engine platform? My problem is to find simple platform for best price.
[11:28:23] dionysus69: and to more simply solve scaling issue
[11:33:14] kurko_: has joined #RubyOnRails
[11:34:23] blackcross: dionysus69, go with whichever has the lowest intranet, interconnect, and/or (local) latency. For example, AWS latency from their S3 (storage) to their EB (scaling servers) is pretty horrible.
[11:34:56] blackcross: honestly, buying/renting your own barebones and setting them up properly is the best way to go, in my experience
[11:40:50] apparition47: has joined #RubyOnRails
[11:43:23] dionysus69: well, we then will have to provide constant electricity and internet which is not 100% guaranteed in my country :s
[11:44:10] dionysus69: and security too because we are involving monetary transactions
[11:48:43] blackcross: oh, then go with whatever has the lowest intra-network latency between storage and nodes
[11:49:16] blackcross: you can also always just rent a dedicated server from rackmount
[11:50:34] blackcross: i personally use buyvm, best bang for the buck and 500GB DDOS protection
[11:51:44] ldnunes: has joined #RubyOnRails
[11:52:55] blackcross: buy you may not want to bother with all the security and setup, so i'll check Google Kubernetes Engine vs heroku for u
[11:58:06] blackcross: dionysus69: go with heroku
[12:01:24] srinidhi: has joined #RubyOnRails
[12:02:22] status402: has joined #RubyOnRails
[12:05:38] zorp: has joined #RubyOnRails
[12:06:32] lexileo: has joined #RubyOnRails
[12:11:20] platoon23: has joined #RubyOnRails
[12:22:49] kapil____: has joined #RubyOnRails
[12:33:13] status402: has joined #RubyOnRails
[12:35:41] IanMalcolm: has joined #RubyOnRails
[12:37:47] status402: has joined #RubyOnRails
[12:39:04] srinidhi: has joined #RubyOnRails
[12:42:39] hadifarnoud: has joined #RubyOnRails
[12:43:02] Puffball: has joined #RubyOnRails
[12:50:13] thejamespinto: has joined #RubyOnRails
[12:51:44] nzst: has joined #RubyOnRails
[12:55:34] snowy: has joined #RubyOnRails
[13:06:49] f-mer: has joined #RubyOnRails
[13:12:32] mostlybadfly: has joined #RubyOnRails
[13:13:23] drale2k_: has joined #RubyOnRails
[13:13:54] jottr: has joined #RubyOnRails
[13:16:24] dionysus69: blackcross: thank you, since moving an app to docker isnt that complicated I will make both setups and make them work for a month, see which requires lower complexity, price and ability to scale
[13:16:51] dionysus69: typo*:P docker = heroku
[13:17:12] dionysus69: I was just reading about running dockerized rails app on heroku
[13:21:13] Psy-Q: i don't understand how a block passed to authenticate_or_request_with_http_basic would work. when i return false inside it, it counts as successful authentication. but the examples seem to just compare usernames/passwords which would return true and pass the auth test, no? why doesn't false fail it?
[13:22:34] tdy: has joined #RubyOnRails
[13:23:57] Jervis_: has joined #RubyOnRails
[13:29:43] snowy: has joined #RubyOnRails
[13:29:44] drale2k_: has joined #RubyOnRails
[13:35:42] Puffball: has joined #RubyOnRails
[13:37:11] nzst: Psy-Q: share your code
[13:41:48] Psy-Q: https://gitlab.zhdk.ch/snippets/7 the token part works, not the basic part
[13:41:51] jlebrech: has joined #RubyOnRails
[13:44:23] nzst: are you sure you're hitting l6 of the code?
[13:44:37] jlebrech: i have an angularjs/rails app which when I redirect_to puts in the /#!/ anchor tag when I redirect. how do that clear that out. tried login_path(anchor: 'logged_out') but nil and blank redirect using the original anchors.
[13:45:34] nzst: Psy-Q: i'd remove that begin/rescue block for starters and just return false to see if that's the actual problem
[13:46:08] Psy-Q: nzst: problem is i have a general catch-all for RecordNotFound in the application controller, so that'll trigger on any unfound user
[13:46:36] Psy-Q: i will check if it's hitting l6, i had a binding.pry there earlier and i think it was called
[13:46:59] Psy-Q: yes, it's triggering that, i'm in pry on l6 now
[13:48:02] Psy-Q: i can remove the catch-all and the rescue to test
[13:49:27] Psy-Q: if i simply return false from that block (no other code in it) it still lets all requests through, seems to ignore the basic authentication so i'm probably using this wrong
[13:49:27] ss942: has joined #RubyOnRails
[13:54:25] status402: has joined #RubyOnRails
[13:56:42] ss942: has left #RubyOnRails: ()
[14:02:01] Psy-Q: but all the examples i find and the source suggest you just return false or true, that's all, that's it
[14:09:10] Saukk: has joined #RubyOnRails
[14:11:07] Psy-Q: this also just gives true: ActiveSupport::SecurityUtils.secure_compare("foo", "foo") & ActiveSupport::SecurityUtils.secure_compare("bar", "bar")
[14:25:06] orbyt_: has joined #RubyOnRails
[14:28:53] LiftLeft: has joined #RubyOnRails
[14:35:45] Puffball: has joined #RubyOnRails
[14:39:50] snowy: has joined #RubyOnRails
[14:46:05] IanMalcolm: has joined #RubyOnRails
[14:57:40] Aces1up: has joined #RubyOnRails
[14:58:06] Aces1up: can someone help me with some association model issues I am having? have posted code here : https://paste.ofcode.org/XuBbAx3Jq2g6RQxCQkFY6E
[14:58:30] Aces1up: trying to create a has_many association but keep getting errros.
[14:58:37] sandstrom: has joined #RubyOnRails
[15:01:00] tdy: has joined #RubyOnRails
[15:06:49] conta1: has joined #RubyOnRails
[15:06:50] Solaris444: has joined #RubyOnRails
[15:08:16] Solaris444: New to Rails here, and having a little trouble. I'm getting the following error 'No route matches [POST] "/business/customers/new"'
[15:09:11] fryguy: that seems like it's probably the wrong url to be POSTing to, assuming you are doing normal REST routes, you'd be GETting that (if you expect to see a form), or POSTing to /business/customers if you have already filled out the form and are actually trying to create the record
[15:09:18] Solaris444: I'm unsure why, because as far as I can tell, my controller should be sending POST for new users to #create
[15:09:27] jlebrech: rake routes
[15:11:13] Solaris444: pulling it up now.
[15:11:25] neomindryan: has joined #RubyOnRails
[15:11:35] jlebrech: resources :business do; resources :customers do; post :new, on: member; end; end
[15:11:52] jlebrech: something like that with newlines instead of ;
[15:12:19] fryguy: that is not the right way to be solving this problem
[15:16:22] Solaris444: https://pastebin.com/0d9Uf1Gi
[15:17:30] fryguy: lines 25 and 26 verified what I said above
[15:17:51] Solaris444: https://pastebin.com/CQJtVHE2
[15:18:08] Solaris444: ok fryguy, checking
[15:18:37] Linell: has joined #RubyOnRails
[15:19:31] Solaris444: fryguy: I followed the ruby on rails tutorial.. shouldn't I be automatically redirected to create when trying to post?
[15:19:54] jlebrech: i think you have to post to business_customers_path
[15:20:08] jlebrech: not new_business_customer_path
[15:20:26] jlebrech: new_business_customer_path is for the blank form
[15:20:52] Solaris444: I thought I was doing that?
[15:21:09] Solaris444: I mean, I fill out the forum at /business/customers/new...
[15:21:21] fryguy: and then where does the form post to?
[15:21:26] Solaris444: when I submit the form, how does Rails know where to go?
[15:21:32] fryguy: you specify it in the form tag
[15:22:17] Solaris444: https://pastebin.com/X2x1TjW2
[15:22:42] Solaris444: Oh, is that in the view?
[15:23:45] Solaris444: https://pastebin.com/KMrXg91k
[15:23:49] Solaris444: That's the view there.
[15:23:56] Linell: I'm having trouble making Warden's redirect! method work, and would really appreciate some help.
[15:23:59] Linell: https://gist.github.com/Linell/a2bf7b0d52ce2132e99673e4bd607ce7
[15:24:01] Solaris444: So, my error is there...
[15:24:06] Linell: I'm sure it's something I'm overlooking, just not sure what.
[15:24:17] Solaris444: what should I have in that form?
[15:24:50] Solaris444: By the way, fryguy, jlebrech... thank you. :) This is my first rails app, and I have been stumped!
[15:26:02] Solaris444: What do I need to change in the view I just linked?
[15:31:00] tdy: has joined #RubyOnRails
[15:35:29] nzst: Linell: do you have any docs on #redirect! ?
[15:36:08] nzst: oh, found the docs https://www.rubydoc.info/github/hassox/warden/Warden%2FStrategies%2FBase:redirect!
[15:36:11] Linell: nzst: pretty much just this https://www.rubydoc.info/github/hassox/warden/Warden%2FStrategies%2FBase:redirect!
[15:36:16] Linell: good timing
[15:36:41] Linell: In an older app we have it just worksā„¢ but it's several years old and padrino, not rails
[15:37:02] Linell: and I can't find any configuration stuff that seems remotely related /shrug
[15:37:49] jlebrech: i have a question about redirect_to how do i stop redirecting copying the url#anchor to the next location?
[15:44:43] dbugger_: has joined #RubyOnRails
[15:48:43] ivanskie: has joined #RubyOnRails
[15:51:59] nzst: jlebrech: can you add `anchor: ''` in the redirect_to?
[15:52:21] nzst: or nil or something
[15:53:42] jlebrech: anchor nil or '', doesn't work. but a string works and it's my current solution
[15:56:23] kurko_: has joined #RubyOnRails
[15:59:07] SteenJobs: has joined #RubyOnRails
[16:01:02] srinidhi: has joined #RubyOnRails
[16:04:11] thejamespinto: nzst: you cannot do that on redirect_to() You can do that on the root_path method
[16:05:04] thejamespinto: nzst: here's everything you need to know https://api.rubyonrails.org/classes/ActionDispatch/Routing/UrlFor.html#method-i-url_for
[16:06:47] thejamespinto: app.root_path anchor: 'nzst-should-study-view-helpers' => "/#nzst-should-study-view-helpers"
[16:06:58] davidh38: has joined #RubyOnRails
[16:07:14] GodFather: has joined #RubyOnRails
[16:07:33] nzst: thejamespinto: don't be rude, it wasn't even my original question, i was just trying to help jlebrech.
[16:07:58] nzst: thanks for sharing anyway
[16:08:27] thejamespinto: nzst: I'm sorry. I always have relax mode on when I'm answering casual questions
[16:08:43] nzst: Linell: stumped me too, I can't find much other than a line in the source about having to throw a :warden symbol. My only guess is to throw the :warden and then in the catch try the redirect!
[16:08:50] thejamespinto: Sometimes I may come accross as rude
[16:09:39] nzst: thejamespinto: it's okay, I just don't want to be told I should study something
[16:10:57] thejamespinto: nzst: we all should! Discipline is the bridge to Freedom
[16:11:36] thejamespinto: BTW, I just learned I can add option :script_name to it and change the entire URL. šŸ˜
[16:22:43] Aherin: has joined #RubyOnRails
[16:25:43] srinidhi: has joined #RubyOnRails
[16:26:48] mfunkmann: has joined #RubyOnRails
[16:27:23] IanMalcolm: has joined #RubyOnRails
[16:27:42] kurko_: has joined #RubyOnRails
[16:28:36] mfunkmann: Hey folks, I would like to create a rails application to run offline in conjunction with Electron ... are there any resources out there from people who already did something similar?
[16:31:07] gavit: has joined #RubyOnRails
[16:35:12] orbyt_: mfunkmann What's your use case?
[16:37:08] mfunkmann: orbyt_: small desktop app with database and some pdf exporting features
[16:37:25] kurko__: has joined #RubyOnRails
[16:38:27] Skull0Inc: has joined #RubyOnRails
[16:38:31] mfunkmann: orbyt_: I thought about using opal, but it seems that there aren't many gems supported yet? and I want to avoid writing Javascript
[16:38:50] orbyt_: Electron is node
[16:38:50] orbyt_: so you're out of luck there
[16:39:15] orbyt_: Why is Rails needed at all?
[16:39:17] Skull0Inc: Just saw your reference of Opal ...I just came across this today : https://hyperstack.org
[16:44:12] lupine: doesn't work without JS :/
[16:45:15] havenwood: mfunkmann: I've embedded a Sinatra app in a macOS app before. I'm not sure how sane it is. :P
[16:45:30] Skull0Inc: Is this the place to ask about how people feel about rails development with so much JS / React stuff looking to take over?
[16:45:51] mfunkmann: havenwood: Wow, I am all ears! :D
[16:46:14] darkhanb: has joined #RubyOnRails
[16:46:39] GodFather: has joined #RubyOnRails
[16:48:39] srinidhi: has joined #RubyOnRails
[16:49:24] havenwood: mfunkmann: It was a long time ago, and I can't share the thing it ended up being, but here's a public minimal example from 2012: https://github.com/havenwood/sinatra-dot-app
[16:49:51] havenwood: mfunkmann: I question my own sanity looking at this: https://github.com/havenwood/sinatra-dot-app/blob/master/Sinatra.app/Contents/MacOS/app.sh#L7
[16:50:27] havenwood: mfunkmann: Instead of embedding Sinatra, I had the app install Sinatra itself. >.>
[16:50:36] mfunkmann: havenwood: Haha thank you, it's still helpful
[16:54:45] srinidhi: has joined #RubyOnRails
[16:57:20] mfunkmann: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[17:03:36] GodFather: has joined #RubyOnRails
[17:05:27] onkelhotte: has joined #RubyOnRails
[17:08:46] dbugger__: has joined #RubyOnRails
[17:14:01] davidh38: has joined #RubyOnRails
[17:17:26] jetchisel: has joined #RubyOnRails
[17:19:48] ephemer0l_: has joined #RubyOnRails
[17:22:48] IanMalcolm: has joined #RubyOnRails
[17:24:20] IanMalcolm: has joined #RubyOnRails
[17:26:03] Linell: nzst: thatks for trying, anyway /shrug
[17:27:44] IanMalcolm: has joined #RubyOnRails
[17:29:13] mikecmpbll: has joined #RubyOnRails
[17:32:22] wojnar: has joined #RubyOnRails
[17:33:18] mangold: has joined #RubyOnRails
[17:44:11] maryo: has joined #RubyOnRails
[17:44:48] davidh38: has joined #RubyOnRails
[17:45:10] conta1: has joined #RubyOnRails
[17:50:58] nzst: has left #RubyOnRails: ("Using Circe, the loveliest of all IRC clients")
[18:01:09] snowy: has joined #RubyOnRails
[18:02:52] maryo: has joined #RubyOnRails
[18:08:50] hd1: has joined #RubyOnRails
[18:10:02] sonOfRa: has joined #RubyOnRails
[18:10:31] GodFather_: has joined #RubyOnRails
[18:14:14] IanMalcolm: has joined #RubyOnRails
[18:15:02] IanMalcolm: has joined #RubyOnRails
[18:16:05] IanMalcolm: has joined #RubyOnRails
[18:16:56] hd1: ACTION wipes out his gemset
[18:17:21] IanMalcolm: has joined #RubyOnRails
[18:26:36] Linell: has left #RubyOnRails: ()
[18:32:44] IanMalcolm: has joined #RubyOnRails
[18:35:36] whysthatso: has joined #RubyOnRails
[18:37:33] IanMalcolm: has joined #RubyOnRails
[18:38:27] IanMalcolm: has joined #RubyOnRails
[18:41:46] sandstrom: has joined #RubyOnRails
[19:01:40] sameerynho: has joined #RubyOnRails
[19:09:53] snowy: has joined #RubyOnRails
[19:18:30] dogweather: has joined #RubyOnRails
[19:38:02] dogweather: has joined #RubyOnRails
[19:44:28] srinidhi: has joined #RubyOnRails
[19:47:34] snowy: has joined #RubyOnRails
[19:50:03] gambl0re: has joined #RubyOnRails
[19:53:15] eckhardt_: has joined #RubyOnRails
[19:55:59] voolik: has joined #RubyOnRails
[19:58:13] kurko_: has joined #RubyOnRails
[20:04:37] akosednar: has joined #RubyOnRails
[20:06:49] voolik: has joined #RubyOnRails
[20:29:43] davidh38: has joined #RubyOnRails
[20:34:42] SteenJobs: has joined #RubyOnRails
[20:38:03] mangold: has joined #RubyOnRails
[20:42:39] kurko_: has joined #RubyOnRails
[21:02:33] SteenJobs: has joined #RubyOnRails
[21:11:25] eddof13: has joined #RubyOnRails
[21:23:40] davidh38: has joined #RubyOnRails
[21:37:28] pharma_joe: has joined #RubyOnRails
[22:17:49] SteenJobs: has joined #RubyOnRails
[22:20:53] pharma_joe: has joined #RubyOnRails
[23:07:15] choke: has joined #RubyOnRails
[23:10:06] eddof13: has joined #RubyOnRails
[23:14:14] eckhardt_: has joined #RubyOnRails
[23:18:13] jetchisel: has joined #RubyOnRails
[23:22:43] nexraf1: has joined #RubyOnRails
[23:45:54] dnewkerk: has joined #RubyOnRails
[23:52:16] orbyt_: has joined #RubyOnRails