« Back to channel list

#RubyOnRails - 24 May 2017

« Back 1 day Forward 1 day »
[00:02:56] Travis-42: has joined #RubyOnRails
[00:07:02] dnewkerk: has left #RubyOnRails: ()
[00:07:44] shilon: hey everyone! I’m using this tutorial as a reference to create relationships. Everything works fine exact I can’t show the follow/unfollow buttons anywhere besides the #show action. Anyone knows how can I make the buttons work on a each loop? Thank you!
[00:09:48] rfoust: has joined #RubyOnRails
[00:10:17] Yzguy: has joined #RubyOnRails
[00:12:47] Scriptonaut: has left #RubyOnRails: ()
[00:18:37] rakm: has joined #RubyOnRails
[00:19:27] aperkins81: has joined #RubyOnRails
[00:21:48] ur5us: has joined #RubyOnRails
[00:36:11] roamingdog: has joined #RubyOnRails
[00:37:16] desnudopenguino: Shilon: how are you handling the follow/unfollow action?
[00:38:58] desnudopenguino: whoops, if you are using form_for @relationship
[00:39:04] desnudopenguino: and in the @show action
[00:39:13] desnudopenguino: woah my irc is out of sync
[00:40:09] desnudopenguino: and the @relationships in the #index action are each the relationship variable, you could do a form_for relationship there I would think
[00:40:33] desnudopenguino: that's just assuming that's how it is set up
[00:45:58] rfoust: has joined #RubyOnRails
[00:49:58] apparition: has joined #RubyOnRails
[00:50:40] planigan: has joined #RubyOnRails
[00:53:06] shilon: desnudopenguino: hey mate! I’m doing exactly as the link i’ve send
[00:53:53] shilon: <%= form_for(current_customer.memberships.build(followed_id: @brand.id), remote: true) do |f| %>
[01:06:12] patarr: has joined #RubyOnRails
[01:16:51] quazimodo: has joined #RubyOnRails
[01:17:06] patarr: has joined #RubyOnRails
[01:20:36] cjhowe: in the first guide, what's the difference between the article_path and articles_path helpers?
[01:21:52] sevenseacat: one is for the show page, showing a single article, one is for the index page, showing multiple articles
[01:24:07] mtkd: has joined #RubyOnRails
[01:33:25] Winter_Foxo: has joined #RubyOnRails
[01:40:57] cjhowe: oh, i see, that makes sense
[01:41:19] cjhowe: has anyone seen this before? for some reason, when my form has errors, it splits up my paragraph element https://gist.github.com/cjhowe7/eb107ebfbe89b0288f63e3b72cd774f4
[01:41:42] cjhowe: i want the error divs to be children of the paragraph, like they are when there are no errors
[01:42:01] sevenseacat: where is that HTML coming from?
[01:43:04] cjhowe: chrome inspect panel
[01:43:48] sevenseacat: I'd check the actual page source
[01:44:55] cjhowe: hmm, yeah, chrome is breaking it
[01:45:25] duderonomy: has joined #RubyOnRails
[01:49:34] aseibert: has joined #RubyOnRails
[01:51:30] Jameser: has joined #RubyOnRails
[01:54:26] Dreamer3: has joined #RubyOnRails
[02:05:46] rfoust: has joined #RubyOnRails
[02:07:07] cjhowe: hmm, it happens in safari too, i think the default rails JS is changing it
[02:08:19] sevenseacat: it's likely happening because divs arent allowed to be in paragraphs of text
[02:10:49] cjhowe: oh, how did you figure that out?
[02:11:01] irishfromua: has joined #RubyOnRails
[02:11:18] patarr: has joined #RubyOnRails
[02:11:21] cjhowe: just from experience or did you read the HTML spec or something?
[02:11:48] sevenseacat: both. experience because ive read the html spec :p
[02:12:24] cjhowe: i guess i'll read the spec sometime
[02:14:56] cjhowe: using divs instead fixed it, thanks!
[02:19:28] bronson: has joined #RubyOnRails
[02:19:41] patarr: has joined #RubyOnRails
[02:26:09] quirkycoders: has joined #RubyOnRails
[02:30:54] roamingdog: has joined #RubyOnRails
[03:04:07] waseem_: has joined #RubyOnRails
[03:11:27] bronson: has joined #RubyOnRails
[03:20:34] agent_white: has joined #RubyOnRails
[03:28:58] andrew9184: has joined #RubyOnRails
[03:32:33] xx00__: has joined #RubyOnRails
[03:39:42] hndk: has joined #RubyOnRails
[04:01:13] xx00__: has joined #RubyOnRails
[04:11:10] cjhowe: has joined #RubyOnRails
[04:16:21] bronson: has joined #RubyOnRails
[04:20:50] bronson: has joined #RubyOnRails
[04:33:43] apparition: has joined #RubyOnRails
[04:51:23] konsolebox: has joined #RubyOnRails
[05:01:15] kristofferR: has joined #RubyOnRails
[05:10:05] patarr: has joined #RubyOnRails
[05:18:14] kt2: has joined #RubyOnRails
[05:26:10] quirkycoders: has joined #RubyOnRails
[05:41:30] Jameser: has joined #RubyOnRails
[05:43:20] cam27: has joined #RubyOnRails
[05:44:37] pusewicz: has joined #RubyOnRails
[06:16:08] defsdoor: has joined #RubyOnRails
[06:21:47] crankharder: has joined #RubyOnRails
[06:23:39] bronson: has joined #RubyOnRails
[06:26:15] DoubleMalt: has joined #RubyOnRails
[06:30:24] Coldblackice: has joined #RubyOnRails
[06:31:28] cjhowe: has joined #RubyOnRails
[06:32:18] cjhowe: has joined #RubyOnRails
[06:33:03] cjhowe: has joined #RubyOnRails
[06:33:53] cjhowe: has joined #RubyOnRails
[06:34:33] cjhowe: has joined #RubyOnRails
[06:35:28] cjhowe: has joined #RubyOnRails
[06:36:16] cjhowe: has joined #RubyOnRails
[06:39:36] AzaToth: has joined #RubyOnRails
[06:42:19] conta: has joined #RubyOnRails
[06:47:09] dionysus69: has joined #RubyOnRails
[06:56:32] srinidhi: has joined #RubyOnRails
[06:56:55] pusewicz: has joined #RubyOnRails
[06:58:37] mdw: has joined #RubyOnRails
[07:06:10] blackmesa: has joined #RubyOnRails
[07:07:22] roamingdog: has joined #RubyOnRails
[07:08:12] roamingdog: has joined #RubyOnRails
[07:08:58] roamingdog: has joined #RubyOnRails
[07:09:47] roamingdog: has joined #RubyOnRails
[07:10:20] brent__: has joined #RubyOnRails
[07:11:06] patarr: has joined #RubyOnRails
[07:20:42] statikowsky: has joined #RubyOnRails
[07:24:04] bronson: has joined #RubyOnRails
[07:34:47] arielserafini: has joined #RubyOnRails
[07:35:19] Jameser: has joined #RubyOnRails
[07:59:14] Matrix9180: has joined #RubyOnRails
[08:02:35] mikecmpbll: has joined #RubyOnRails
[08:03:18] mahloun: has joined #RubyOnRails
[08:04:45] kt2: has joined #RubyOnRails
[08:11:06] roamingdog: has joined #RubyOnRails
[08:11:28] arBmind: has joined #RubyOnRails
[08:12:59] marr: has joined #RubyOnRails
[08:13:17] ltd: has joined #RubyOnRails
[08:18:30] ltd: has joined #RubyOnRails
[08:23:39] ltd: has joined #RubyOnRails
[08:29:36] mdw: has joined #RubyOnRails
[08:33:43] Matrix9180: has joined #RubyOnRails
[08:35:32] acosonic: I will murder myself because of rails routing
[08:38:27] tedwing: has joined #RubyOnRails
[08:50:15] workmad3: has joined #RubyOnRails
[08:50:45] acosonic: has joined #RubyOnRails
[08:50:52] acosonic: anyone here?
[08:51:52] acosonic: say if I have this <%= form_tag({:controller => 'projects_settings', :action => 'edit'}) do %> how would my route for projects_settings controller edit look like?
[08:53:08] tbuehlmann: before answering that: have you considered using form_for and an actual object?
[08:54:23] acosonic: I'm new to rails but I know what you think, so I should have already instanced that object and
[08:54:31] acosonic: form_for would create it?
[08:54:40] acosonic: not sure exactly
[08:55:03] tbuehlmann: you are trying to save an activerecord model, right?
[08:55:57] acosonic: I just want to know how would route look like so I learn routes properly
[08:56:08] lxsameer: has joined #RubyOnRails
[08:56:33] tbuehlmann: I can't help you then, but I can recommend reading http://guides.rubyonrails.org/routing.html
[08:56:59] acosonic: it does not say anything if you have underscore in your controller name
[08:57:44] shilon: has joined #RubyOnRails
[09:00:52] bronson: has joined #RubyOnRails
[09:03:47] DoubleMalt: has joined #RubyOnRails
[09:05:46] tedwing: Generally controller class names are written in camel case, like `ProjectsSettingsController`. Is that the case for your controller?
[09:06:31] acosonic: Yes ProjectsSettingsController and in my routes I wrote resources :project_settings but I keep getting no route
[09:09:30] tedwing: `:projects_settings` or `:project_settings`?
[09:11:49] roamingdog: has joined #RubyOnRails
[09:11:50] patarr: has joined #RubyOnRails
[09:15:39] acosonic: Hm, it should be project settings though, since each project should have its own settings
[09:16:43] acosonic: but currently its projects settings
[09:20:05] acosonic: so how can I figure out which route is
[09:20:09] acosonic: <%= form_tag({:controller => 'projects_settings', :action => 'edit'}) do %>
[09:20:19] acosonic: expecting in routes.rb _
[09:26:16] brent__: has joined #RubyOnRails
[09:26:42] arup_r: has joined #RubyOnRails
[09:26:52] quirkycoders: has joined #RubyOnRails
[09:27:49] tedwing: The route should be created in the `resources` call you mentioned earlier as described in the Rails Guide. Try running `rails routes` in the console to check that the route was defined correctly. Might be useful to post some code if you're still having trouble.
[09:28:04] tedwing: Also, eventually it sounds like a `form_for` would be a good idea
[09:28:52] acosonic: > rails routes Error: Command not recognized
[09:30:16] tedwing: try `bundle exec rails routes` or `bundle exec rake routes`
[09:31:10] workmad3_: has joined #RubyOnRails
[09:31:37] acosonic: hm, it says project settings instead of projects settings
[09:32:33] acosonic: tedwing: thanks
[09:32:42] tedwing: sure thing
[09:32:57] acosonic: I figured there is no point in running bundle exec rake routes, but obviously there is :D
[09:33:31] tedwing: It's a handy sanity check
[09:36:17] srinidhi: has joined #RubyOnRails
[09:45:07] ur5us: has joined #RubyOnRails
[09:46:17] Matrix9180: has joined #RubyOnRails
[09:46:40] zepy_aq_: has joined #RubyOnRails
[09:51:23] mdw: has joined #RubyOnRails
[10:07:02] patarr: has joined #RubyOnRails
[10:07:50] arup_r: has joined #RubyOnRails
[10:12:34] roamingdog: has joined #RubyOnRails
[10:17:45] blackmesa: has joined #RubyOnRails
[10:18:55] liquid-silence: has joined #RubyOnRails
[10:19:35] liquid-silence: what happened to jQuery in rails 5?
[10:19:52] liquid-silence: how are you supposed to render partials from remote calls now?
[10:20:04] liquid-silence: I cannot seem to find documentation on this on rails guides
[10:21:17] quirkycoders: has joined #RubyOnRails
[10:21:59] liquid-silence: should I just re-add jQuery?
[10:22:37] tbuehlmann: either add jQuery or use vanilla js
[10:22:55] liquid-silence: now the question is though
[10:22:58] liquid-silence: why is it removed?
[10:24:09] glasz: has joined #RubyOnRails
[10:24:42] arBmind: has joined #RubyOnRails
[10:25:03] liquid-silence: or is there a different way to render partials?
[10:26:58] liquid-silence: it somehow does not make sense to me
[10:36:35] liquid-silence: damn its quiet in here
[10:42:02] arup_r: liquid-silence: Jquery is optional in Rails 5.1.x, but u can always add it back.. :)
[10:42:14] arup_r: liquid-silence: How are you?
[10:42:28] arup_r: ok tbuehlmann said already.. didn't see it
[10:42:41] kt2: has joined #RubyOnRails
[10:46:23] RemiBa: has joined #RubyOnRails
[10:47:46] tbuehlmann: liquid-silence: https://github.com/rails/rails/issues/25208
[10:51:57] quirkycoders: has joined #RubyOnRails
[10:53:58] meoblast001: has joined #RubyOnRails
[10:55:29] FastJack: has joined #RubyOnRails
[10:57:35] stamina: has joined #RubyOnRails
[11:02:33] bronson: has joined #RubyOnRails
[11:03:25] statikowsky: I'm using webpacker with rails 5.1.1 - when running in development I do not wish to use webpack-dev-server so I disabled it in development.server.yml
[11:04:00] statikowsky: but now I have to run rake webpacker:compile to compile the webpack pack
[11:05:00] arup_r: yeah that make sense.. what is wrong? :)
[11:05:01] statikowsky: is there a way to have webpacker compile assets automatically without running webpack-dev-server or having to manually run rake webpacker:compile
[11:05:22] statikowsky: that is - without running another process?
[11:06:19] arup_r: statikowsky: webpack has a watch option too.. U can enable it.. so that is keeps building when there is a chance
[11:10:46] arup_r: statikowsky: https://webpack.github.io/docs/configuration.html#watch .. inside the config file u need to do watch: true
[11:11:08] statikowsky: arup_r: thanks, I'll try it now
[11:18:08] statikowsky: arup_r: this still requires me to run ./bin/webpack as a separate process? I mean there is no way for me to just run rails -s when using webpack for my js assets and have everything compiled?
[11:19:14] RemiBa: Hi. I'm really not sure what I'm doing wrong to get a MissingAttributeError? https://gist.github.com/RemiBa/1021d242ec2662ae701515a69e277ee1 - Is there anyone who can point me in the right direction?
[11:19:18] arup_r: ok. I don't know that.. I do use 2 diff processes.
[11:20:41] arup_r: RemiBa: use the column name instead
[11:21:41] RemiBa: arup_r: Then I get "unknown attribute 'assigner_client_id' for InstallationClient." on the same line
[11:22:25] RemiBa: Thought it was @current_user.client.id in stead of @current_user.client I had to use, but that do'nst affect it
[11:22:37] RemiBa: Still getting the same error on the same line
[11:23:49] RemiBa: Still my bad!
[11:23:56] RemiBa: Because the column has a different name
[11:24:46] tedwing: Seems like you _have_ to run 2 separate processes for webpack. Webpacker recommends Foreman to simplify the steps (https://github.com/rails/webpacker#binstubs)
[11:25:03] wethu: has joined #RubyOnRails
[11:25:13] RemiBa: arup_r: My own stupid fault (as most of the time :P) - Not my best day so far :s
[11:25:19] arBmind: has joined #RubyOnRails
[11:25:31] arup_r: myself also doing so many typo today :p
[11:25:37] RemiBa: arup_r: Thx for the help, did me see my error :P
[11:25:45] RemiBa: As long as it isn't a semicolo /D
[11:29:04] statikowsky: tedwing: thanks for the clarification
[11:40:15] andywww: has joined #RubyOnRails
[11:42:11] kt: has joined #RubyOnRails
[11:44:16] jonno112: has joined #RubyOnRails
[11:44:23] shotbug: has joined #RubyOnRails
[11:46:06] roamingdog: has joined #RubyOnRails
[11:48:03] dionysus69: has joined #RubyOnRails
[11:50:54] russt: has joined #RubyOnRails
[11:51:06] daemonwrangler: has joined #RubyOnRails
[11:53:25] soahccc: I just tried to work with activejob for the first time... Can someone explain to me why this happens to "cids"? I even tried renaming it but there is some magic I don't get and it drives me crazy... https://gist.github.com/2called-chaos/dcf92f1594190bf01168e239720e54a7
[11:57:33] statikowsky: has joined #RubyOnRails
[12:02:25] jphase: has joined #RubyOnRails
[12:02:32] soahccc: oh my... this indeed it total black magic in the serializer?!? It 100% is just a plain old string but in deserialization it SOMEHOW detects it being a base64 encoded GlobalID and converts it, adding a random character stops that.... wat?
[12:04:42] tbuehlmann: soahccc: why do you have to deal with global ids? if done right, you doesn't touch this internal part
[12:05:45] soahccc: tbuehlmann: I'm just listing cable "handles" (not connections really) and I was about using cable to display them so I put the connection_identifier in there
[12:06:17] soahccc: Basically I did the hello world by listing the cable handles (per user in that case)
[12:07:56] soahccc: so is it basically trying to decode64 + regex matching it in order to detect these strings or what? This totally buffed me since I clearly put a string with "random" characters in and get a total strange and unexpected object back, thats all :)
[12:11:31] am55: has joined #RubyOnRails
[12:14:39] soahccc: It is as if nobody thought about someone wanting a "how many connections am I having" insight, all there is are per process values
[12:17:27] kt: has joined #RubyOnRails
[12:22:56] hashrocket: has joined #RubyOnRails
[12:24:53] User458764: has joined #RubyOnRails
[12:26:21] rfoust: has joined #RubyOnRails
[12:29:41] HoierM_: has joined #RubyOnRails
[12:35:44] tomasm-: has joined #RubyOnRails
[12:36:53] tomasm-: hey is it possible to define a routing concern inside an engine, and have it accessible from within the main routes? i have an engine that is specific to inline editing, etc so I have some routes defined there as a concern. but it's not loaded normally before my global routing
[12:40:04] arup_r: has joined #RubyOnRails
[12:43:20] jonno112: has joined #RubyOnRails
[12:46:50] roamingdog: has joined #RubyOnRails
[12:48:35] rfoust: has joined #RubyOnRails
[12:49:40] arBmind: has joined #RubyOnRails
[13:01:06] romeoh: has joined #RubyOnRails
[13:03:06] jonno112: has joined #RubyOnRails
[13:04:05] francuz: has joined #RubyOnRails
[13:11:50] jphase: has joined #RubyOnRails
[13:14:58] xx00__: has joined #RubyOnRails
[13:15:28] centrx: has joined #RubyOnRails
[13:17:07] noob_on_rails: has joined #RubyOnRails
[13:18:17] francuz: if i plan on using docker for production(still not sure about it), I see that some people use a "not on docker" postgres database(they have docker and postgres installed on the server, and the docker container works with the "global" postgres server, what is the reason for doing that ?
[13:21:17] DoubleMalt: has joined #RubyOnRails
[13:21:29] francuz: also : if anyone has or know of a good dock working with Capistrano(or actually if there is another good deployement system i don't know about, I'd be happy to learn about it), share the link (the more interesting data i have the best it is for me)
[13:21:36] uks: has joined #RubyOnRails
[13:27:27] DLSteve: has joined #RubyOnRails
[13:34:17] xx00__: has joined #RubyOnRails
[13:36:16] fernandomm: has joined #RubyOnRails
[13:42:53] bruce_lee: has joined #RubyOnRails
[13:58:32] xx00__: has joined #RubyOnRails
[14:04:47] noob_on_rails: how can i return usable elastic data from a remote cluster?
[14:05:18] noob_on_rails: i can do it with a perform request and use a query and then Hashie it , but i think there's persistence which helps , but i dont understand how to use it
[14:06:24] cam27: has joined #RubyOnRails
[14:08:11] arup_r: has joined #RubyOnRails
[14:08:39] fryguy: francuz: some people don't like the idea of working with docker volumes for databases, and some feel that the performance impact (which isn't much, but is >0) isn't worth it.
[14:09:03] fryguy: as for capistrano, your first goal should be to go get capistrano-rails and the capistrano plugin for whatever app server you are using, and then work from there
[14:10:28] Papierkorb: francuz: Also, docker containers are throwaways, usually what's in there won't survive for "long". A database is usually expected to survive for a long time, sometimes surpassing the initial applications it was created for.
[14:11:28] Papierkorb: And in the end, containers are there so you as Developer can give a thing to your Admin he can just run and it'll work. Databases are usually already set up, or there's a process for it.
[14:14:44] konsolebox: has joined #RubyOnRails
[14:14:48] francuz: by "long" you mean in the "idea" (applications can exist and be destroyed, where db (and information) should be almost permanent) or also in the concrete application ?
[14:15:20] francuz: rephrasing the question : is it a "bad practice" to use docker for production ?
[14:17:35] Papierkorb: francuz: yeah, application containers are throw-aways: They don't (= should not) store any data, you can easily (even automatically) start more instances or stop running instances, the system doesn't go down in any case. But you can't easily scale a DB, it stores tons of data it needs quick access to, uses tons of memory, etc. - So all benefits you get from containerization barely apply to usual databases
[14:17:36] fryguy: it is not
[14:18:09] Papierkorb: fryguy: Using containerization for your applications is perfectly fine.
[14:18:21] ule: Hey guys.. do you know how can I test schema between 2 models/tables using Minitest?
[14:18:35] fryguy: Papierkorb: right
[14:19:03] ule: Kind of how to test schemas?
[14:19:06] fryguy: it's fine to use for databases too, especially for redundancy in cluster scheduling systems
[14:20:53] francuz: ok, thanks,
[14:30:24] arup_r: has joined #RubyOnRails
[14:41:39] chouhoulis: has joined #RubyOnRails
[14:49:08] shotbug: has joined #RubyOnRails
[14:56:11] roamingdog: has joined #RubyOnRails
[14:57:29] bronson: has joined #RubyOnRails
[14:58:36] rakm: has joined #RubyOnRails
[15:04:52] danguita: has joined #RubyOnRails
[15:09:34] arup_r: has joined #RubyOnRails
[15:10:03] Pumukel: has joined #RubyOnRails
[15:16:20] conta: has joined #RubyOnRails
[15:17:59] creature: has joined #RubyOnRails
[15:19:04] kitsuneyo: has joined #RubyOnRails
[15:19:28] ascarter: has joined #RubyOnRails
[15:23:11] mimico: has joined #RubyOnRails
[15:24:48] ascarter: has joined #RubyOnRails
[15:27:13] patarr: has joined #RubyOnRails
[15:34:23] brent__: has joined #RubyOnRails
[15:43:34] kitsuneyo: has joined #RubyOnRails
[15:44:39] kitsuneyo: has joined #RubyOnRails
[15:45:29] kitsuneyo: has joined #RubyOnRails
[15:46:17] kitsuneyo: has joined #RubyOnRails
[15:47:02] kitsuneyo: has joined #RubyOnRails
[15:47:46] [Butch]: has joined #RubyOnRails
[15:48:23] sloggerkhan: has joined #RubyOnRails
[15:52:15] bronson: has joined #RubyOnRails
[15:52:43] kitsuneyo: has joined #RubyOnRails
[15:55:20] cam27: has joined #RubyOnRails
[15:56:58] roamingdog: has joined #RubyOnRails
[16:08:08] pusewicz_: has joined #RubyOnRails
[16:12:22] arup_r: has joined #RubyOnRails
[16:13:10] hobodave: has joined #RubyOnRails
[16:18:05] Yzguy: has joined #RubyOnRails
[16:25:33] pLaTo0n: has joined #RubyOnRails
[16:27:24] rakm: has joined #RubyOnRails
[16:27:32] bronson: has joined #RubyOnRails
[16:27:50] chouhoulis: has joined #RubyOnRails
[16:28:20] Cache_Money: has joined #RubyOnRails
[16:31:09] armyriad: has joined #RubyOnRails
[16:38:00] cjhowe: has joined #RubyOnRails
[16:51:04] shotbug: has joined #RubyOnRails
[16:53:09] cjhowe: has joined #RubyOnRails
[16:56:43] noob_on_rails: it's been a while since i wrote ruby , how can i route to application.html.erb
[16:57:41] hobodave: has joined #RubyOnRails
[16:57:51] kafloopascope: has joined #RubyOnRails
[16:58:51] tbuehlmann: noob_on_rails: you don't route to views, you route to controller actions which then can render a view
[16:59:19] noob_on_rails: ahh yes but what action is needed to render application.html.erb which is inside the layouts folder
[16:59:37] noob_on_rails: im scratching my head over this , i can't remember how darn
[16:59:44] tbuehlmann: that layout is used per default
[17:00:16] kafloopascope: Hello! I'm on an old 3.x project and am unfortunately not very familiar with the framework or even ruby, but need to debug a problem. A directory needs to be created, but can't with a permissions error. The app is served by nginx/passenger, and the passenger process are run as a particular user which _does_ have write permissions. The directory is created with Dir.mkdir. Is there a way to be sure which (linux) user that operation is being
[17:01:29] noob_on_rails: yes but if i start my rails app i get the "yay"
[17:02:14] bruce_lee: \(^_^)/ @all
[17:02:54] bruce_lee: noob_on_rails: I'm really not an experienced rails-developer
[17:03:07] noob_on_rails: bruce_lee: good for you :)
[17:03:16] bruce_lee: noob_on_rails: uncomment the following line in: config/routes.rb
[17:03:24] bruce_lee: noob_on_rails: # root 'welcome#index'
[17:03:42] tbuehlmann: kafloopascope: you can setup the user with which the rails application is being run in the passenger configuration file. the directive shoule be "PassengerUser <username>"
[17:03:43] bruce_lee: you should get a more detailed error-description
[17:03:51] noob_on_rails: it should be a rails 5.1 thing?
[17:03:56] noob_on_rails: cause it's not in my routes
[17:04:37] kafloopascope: tbuehlmann, I've been using passenger_default_user in the nginx conf, but you think an extra setting in another file might help?
[17:05:05] noob_on_rails: bruce_lee: thas the yay screen tho
[17:06:03] tbuehlmann: kafloopascope: I don't use passenger, so that's just a guess
[17:06:09] damireh: has joined #RubyOnRails
[17:06:47] tbuehlmann: noob_on_rails: the welcome page is the default root page, it's static. if you configure your own root route, it won't show anymore
[17:07:15] noob_on_rails: yes ofc i do agree
[17:07:42] noob_on_rails: the only thing i want is to root route at layouts/application.html.erb
[17:07:56] noob_on_rails: it's a stupid subject which i simply don't remember
[17:08:32] noob_on_rails: but without creating the index action in application controller and creating an appliation folder in views etc
[17:08:44] noob_on_rails: i remember it used to work this way pff
[17:08:47] tbuehlmann: why would you want that?
[17:08:56] mtkd: has joined #RubyOnRails
[17:09:45] Cache_Money: Looking for some advice here: I have a Postgres db which is populated with data from various sources via Python scripts kicked off by cronjobs. I have a Rails app that I use to authenticate users and authorize them to view/download various reports. I fire off a GET request before/after the cronjob runs so that I can visually see which jobs have failed their last run. But what I'd like is to get an email/text when a
[17:09:46] Cache_Money: job starts and doesn't finish in a given amount of time. Any ideas on how I could go about doing this?
[17:11:37] tbuehlmann: Cache_Money: so when a python ssssshhcript starts, send an email and when it doesn't finish in a given time, send an email?
[17:12:14] Cache_Money: tbuehlmann: I only want to get notified by email/text if a job doesn't finish in a given amount of time
[17:12:26] tbuehlmann: and that job is written in python?
[17:13:30] Cache_Money: all of my ETL jobs are in Python. The jobs are kicked off within the Unix crontab. Before & after they run I ping an API endpoint within my Rails app to keep track of their start/finish
[17:14:10] hobodave: Is there a way to modify the ActiveRecord pool size at runtime? (I'm trying to do this for a rails unit test)
[17:14:43] noob_on_rails: tbuehlmann: it's ok im just stupid :D
[17:15:24] Cache_Money: Right now I have to login every morning and check a dashboard to see whether any of my jobs have failed. I'd prefer to be notified, instead of having to remember to check on them. Plus, on the weekends I'd like to forget about it unless I need to re-run the job or debug some error
[17:15:59] tbuehlmann: so you already have some kind of a model that represents a job?
[17:16:30] tbuehlmann: well, give it a datetime and have a background worker checking every other second/minute for jobs with a timestamp in the past. if there is such a job, send a notification
[17:20:17] Cache_Money: tbuehlmann: yeah, I have a Cronjob model. What would I use for that background worker? Another cronjob??
[17:20:44] mdw: has joined #RubyOnRails
[17:22:29] tbuehlmann: a never ending rake task or a background worker library like sidekiq (with sidetiq or sidekiq-scheduler or whatever the cool kids use these days for recurring jobs)
[17:23:30] hobodave: Gah, Class#class_attribute is so horribly broken
[17:23:39] Cache_Money: tbuehlmann: I've never used Sidekiq. How would I kick off a never ending rake task?
[17:24:52] tbuehlmann: in its simplest form? loop { Cronjob.overdue.find_each { |cronjob| send_notification(cronjob) }; sleep 15 }
[17:29:55] Cache_Money: I think I'm going to have a cronjob that runs every 5 minutes, pulls down any Cronjobs that have not finished, check to see if `(Time.now - created_at) > cronjob_duration`, if so, I'll send an email/text. I'll probably just do it in Python since all my other jobs are in Python. The only thing this won't catch is if my server goes down (all ETL jobs will fail and I won't receive any emails) but I can get to that lat
[17:30:08] Cache_Money: tbuehlmann: thanks for letting bounce my ideas off you!
[17:30:47] ResidentBiscuit: has joined #RubyOnRails
[17:30:56] ascarter: has joined #RubyOnRails
[17:31:12] ResidentBiscuit: has joined #RubyOnRails
[17:31:42] ResidentBiscuit: has joined #RubyOnRails
[17:37:32] mtkd: has joined #RubyOnRails
[17:38:24] desnudopenguino: has joined #RubyOnRails
[17:41:49] desnudopenguino: is there a way to blanket prevent a model attribute from being returned in a query (password for example on a user model)?
[17:45:41] Cache_Money: desnudopenguino: where are these queries being run from?
[17:46:17] tbuehlmann: desnudopenguino: you could whitelist the columns you want. blacklisting isn't that easy
[17:46:27] hobodave: matthewd you around?
[17:47:41] desnudopenguino: i'm making the queries in the model
[17:48:44] arup_r: has joined #RubyOnRails
[17:48:58] tbuehlmann: as said, you could SELECT just the columns you need or exclude some with a rather complex query. using postgres, you could also create a view which simply doesn't include the password column
[17:49:00] desnudopenguino: tbuehlmann: ok, i only have a few attribs/columns just don't want the pass getting through/queried all the time.
[17:49:14] tbuehlmann: you could also just not show the password to anyone :)
[17:49:35] desnudopenguino: I'll probably just select specific columns
[17:49:47] mikecmpbll: has joined #RubyOnRails
[17:49:49] Cache_Money: that's what I'd do
[17:50:22] desnudopenguino: haha, i was just curious if rails had a way to do it
[18:06:26] Vircung: has joined #RubyOnRails
[18:06:28] defsdoor: has joined #RubyOnRails
[18:07:06] mordof: has joined #RubyOnRails
[18:07:47] mordof: question about rails 5 and the scope helper in models. i have scope :test, -> (foo) { where( ids: foo ) } expecting foo to be an array
[18:08:28] mordof: when i call TestModel.test([1, 2, 3, 4, 5, 6, 7, 8]) it's complaining that i'm passing it 8 arguments instead of 1
[18:08:43] mordof: do scopes automatically use splat here? rails 4 didn't behave this way and i'm quite confused
[18:08:56] mordof: why would it think i'm passing it 8 arguments... am i doing something wrong?
[18:13:36] cjhowe: has joined #RubyOnRails
[18:17:32] tbuehlmann: mordof: that should work
[18:17:55] mordof: one would think... lol
[18:18:22] mordof: ACTION sets up a completely new model to test it
[18:19:35] mordof: interesting
[18:19:53] mordof: tbuehlmann: my example is wrong. the actual code is scope :test, -> (foo = nil) { where( ids: foo ) }
[18:20:03] mordof: when the = nil default is there, it causes it to do the expanding
[18:20:35] tbuehlmann: um, no it shouldn't
[18:20:55] mordof: i'm gonna set up a pure ruby test for this though
[18:22:48] Vircung: has joined #RubyOnRails
[18:22:56] mordof: :/ a plain lamba literal in the rails console does not exhibit this same behavior.....
[18:23:00] mordof: ACTION tries the test on a different model
[18:24:10] mordof: it blows up in my other model too.. this is really strange
[18:24:48] mordof: i think i need to figure out how scope is calling the lambda to solve this mystery
[18:33:48] mordof: so... i am on rails 5.0.2, maybe it's been fixed already :/
[18:33:53] mordof: maybe that's why rails 5.0.3 is a thing, lol
[18:36:16] tbuehlmann: I think you're doing something wrong
[18:37:28] mordof: the lambda itself works fine - it's when rails calls it that it blows up
[18:37:34] mordof: what could i be doing wrong there?
[18:38:13] tbuehlmann: can you provide a simple rails repo for us to reproduce the behaviour?
[18:39:01] mordof: i always find that a bit tedious to do - was gonna test updating to 5.0.3 first, but sure. i'll try a clean 5.0.2 install and see if the same behavior persists
[18:45:59] gusrub: has joined #RubyOnRails
[18:48:23] duderonomy: has joined #RubyOnRails
[18:50:49] mordof: tbuehlmann: before i set up a new application, i made a clean model and tried it - which didn't blow up.. so it's something to do with the models i tried it on i guess. i have to isolate this before there's even a possibility it's a rails thing to reproduce the behavior
[18:51:08] mordof: so this might take a bit of digging
[18:51:52] jphase: has joined #RubyOnRails
[18:52:10] greengriminal: has joined #RubyOnRails
[18:53:24] dionysus69: has joined #RubyOnRails
[18:54:18] mordof: oh well this is fun
[18:54:44] mordof: all of the testing where it's been exploding has been in the production rails console, but i can't reproduce it at all locally in development *sighs*
[18:54:48] mordof: even more strangeness
[18:55:40] hobodave: mordof JRuby?
[18:56:08] mordof: hmmm i'm using ruby 2.3.1p112 in production - but 2.3.3 locally
[18:56:20] mordof: gonna downgrade (rbenv) to 2.3.1 locally and see if that changes anything
[18:57:55] mordof: hobodave: normal ruby.. if that makes sense
[19:02:25] jdqx: has joined #RubyOnRails
[19:03:59] srinidhi: has joined #RubyOnRails
[19:04:08] renegadeandy: has joined #RubyOnRails
[19:04:16] renegadeandy: has left #RubyOnRails: ()
[19:05:11] mordof: seems like that person is having a great afternoon..
[19:05:45] theunraveler: has joined #RubyOnRails
[19:06:03] agent_white: has joined #RubyOnRails
[19:13:49] gusrub: has joined #RubyOnRails
[19:14:49] gusrub: has joined #RubyOnRails
[19:17:36] rfoust: has joined #RubyOnRails
[19:22:06] Ericx2x: has joined #RubyOnRails
[19:22:23] ascarter: has joined #RubyOnRails
[19:23:40] arup_r: has joined #RubyOnRails
[19:24:06] mordof: confirmed - making a new rails application for testing/reproduction
[19:24:46] mordof: ruby 2.3.1 + rails 5.0.2 or 5.0.3 (none others tested) - scopes on a model with a default argument it splats the argument passed (or at least that's the behavior) so an array passed complains about too many arguments
[19:24:54] mordof: but ruby 2.3.3 does not exhibit this behavior
[19:26:55] mordof: tbuehlmann: do i just paste the link to the repo once it's available in here? or is there a specific place to send it to (rails issues on github is the only place i know of so far)
[19:28:28] andywww: has joined #RubyOnRails
[19:28:51] tbuehlmann: a link to the repo, we might figure it out
[19:29:33] mordof: will be back shortly with a link
[19:30:32] Charliebr73: has joined #RubyOnRails
[19:36:27] tbuehlmann: I could reproduce it
[19:43:32] mordof: hurray reproducable... though it would've been nicer to have it be a "oh it's just a small fix thing".. lol
[19:44:26] mordof: i got pulled away from this for a short bit - still setting up a clean rails app.
[19:44:44] mordof: 'gem install rails' 'rails new' wasn't working.. had to create a gemfile or 'rails' complained like crazy
[19:50:03] unreal: has joined #RubyOnRails
[19:54:25] tbuehlmann: mordof: https://gist.github.com/tbuehlmann/e7002cf709e28241664fe5107f6dfee4
[19:55:43] tbuehlmann: should be this: https://github.com/rails/rails/issues/25654
[19:56:02] Scriptonaut: has joined #RubyOnRails
[19:56:05] tbuehlmann: solution: upgrade your version of ruby
[19:56:59] chouhoulis: has joined #RubyOnRails
[19:57:41] mtkd: has joined #RubyOnRails
[20:00:25] Cache_Money: has joined #RubyOnRails
[20:07:22] Synthead: has joined #RubyOnRails
[20:07:30] Synthead: what the correct semantic naming for a m2m table? say I have the tables "issues" and "comments". would it be "comments_issues"? Then would the model be CommentsIssue?
[20:08:23] arup_r: HABTM has no model.. Only table and that name comes alphabetically sorting order.
[20:09:14] Synthead: right, but I'm looking to make a m2m model that stores attributes about the relationship
[20:09:20] Synthead: via through
[20:09:25] arup_r: so.. yeah Rails will prefer `comments_issues`, but u can give any name.. but pass it join_table: <>..
[20:09:51] Synthead: unless there's a better way :)
[20:10:00] arup_r: HMT is good always :)
[20:10:07] Synthead: ah, good :)
[20:10:15] Synthead: it seems a little hokey to name a model CommentsIssue
[20:10:17] arup_r: yeah rails will name it like CommentsIssue :)
[20:11:10] arup_r: well.. u can name it like the way you want and then inside the model `CommentIssue` say Rails, self.table_name = 'comments_issues'
[20:11:22] arup_r: @Synthead ^
[20:12:06] Synthead: that's an interesting thought
[20:12:17] Synthead: I suppose the plural is a good indicator that it's a m2m
[20:12:26] Synthead: in a smelly way :D
[20:12:31] arup_r: When side step from rails convention, u need to tell Rails which one is Apple.. then Rails know how to eat it :D
[20:12:53] Synthead: I try to use conventions as much as possible
[20:12:57] Synthead: makes it easier to read
[20:13:05] Synthead: I'll go with CommentsIssue
[20:13:08] Synthead: thanks so much!
[20:13:09] arup_r: ok then aceept the naming as it is.. hehe
[20:14:04] arup_r: class User < AR; self.table_name 'foo'; end 😂
[20:15:47] mtkd: has joined #RubyOnRails
[20:19:36] xco: has joined #RubyOnRails
[20:20:18] xco: i changed my rails version in Gemfile from 4.0.0 to 4.1.0 and did “bundle update rails”. why am i getting this? https://gist.github.com/siaw23/bebcd768e2a42a75c09cfdb9b4e39652
[20:21:27] tbuehlmann: xco: https://gist.github.com/siaw23/bebcd768e2a42a75c09cfdb9b4e39652#file-e-txt-L14
[20:22:12] Matrix9180: has joined #RubyOnRails
[20:25:32] dnewkerk: has joined #RubyOnRails
[20:25:47] mordof: tbuehlmann: whoa... thanks for putting that together. i was making a full rails application using the test helper and all that fun stuff, lol. your post is much cleaner than mine
[20:26:06] gusrub: has joined #RubyOnRails
[20:26:07] mordof: also kept getting pulled away from it (at work).. so you beat me to it
[20:31:56] cek: has joined #RubyOnRails
[20:32:11] cek: I'm looking for a way to hackup rails console and have my own methods available
[20:32:31] tbuehlmann: cek: what do you mean?
[20:32:59] cek: somethinlk like ~/.irbrc but for rails console only
[20:34:45] tbuehlmann: for all rails applications or just one specific?
[20:35:08] cek: one specific. I'm able to load console via Rails::CommandsTasks.new(ARGV).run_command!('console') , but that doesn't get me far.
[20:37:48] ascarter: has joined #RubyOnRails
[20:42:05] cjhowe: has joined #RubyOnRails
[20:44:10] cek: was able to hack it together.
[20:44:40] tbuehlmann: cek: I personally have a .pryrc file with just a check for defined?(ActiveRecord) for example
[20:45:36] sloggerkhan: In dev is there a config option for the port Puma runs on in rails 5.x?
[20:45:50] cek: has left #RubyOnRails: ()
[20:46:26] sloggerkhan: Err, not port.
[20:46:59] tbuehlmann: like this? bin/rails server -b 0.0.0.0
[20:47:22] ascarter: has joined #RubyOnRails
[20:47:22] sloggerkhan: Yeah, is there a way to have 0.0.0.0 be part of your config instead of a CLI arg?
[20:49:55] cnk: has joined #RubyOnRails
[20:51:52] mordof: SloggerKhan: yes
[20:52:41] mordof: SloggerKhan: we put this at the top of our application.rb: https://gist.github.com/mordof-work/cc6427761ce8e0df54fe888bd2cc8ff7
[20:52:59] sloggerkhan: thanks mordof!
[20:53:08] mordof: you're welcome
[20:53:12] sloggerkhan: Not huge on it defaulting to 0.0.0.0., ha ha.
[20:53:28] mordof: that was in rails 4, honestly i'm not 100% sure that still applies to rails 5
[20:53:31] mordof: nothing stopped working though, lol
[20:54:14] mordof: it only binds to 127.0.0.1 for mine starting up, so i'm assuming that bit of code still works
[20:54:31] tbuehlmann: you can also add bind 'tcp://0.0.0.0:9292' to your puma.rb file, but strangely enough that just adds another listening in addition to localhost:3000
[20:54:56] brent__: has joined #RubyOnRails
[20:54:56] mordof: yeah - that's why i ended up using the route i pasted, because otherwise it causes multiple listeners
[20:55:06] mordof: this was one that just reconfigures
[20:55:15] tbuehlmann: is it important that you use a config file?
[20:55:51] mordof: it is kinda hacky the way i did it.. lol. really you could just put an alias or another small script to call it for you
[20:55:52] sloggerkhan: Mostly I don't want to be relying on command line.
[20:56:05] mordof: that's the opposite of what i would expect
[20:56:11] mordof: why is that?
[20:56:37] sloggerkhan: Sometimes I'm doing dev work on machines that have public IPs.
[20:57:18] mordof: why does that make you want to avoid using the command line?
[20:57:34] mordof: i understand the whole "don't use 0.0.0.0" thing.. sure
[20:57:52] sloggerkhan: Or rather not public, but not private networks I guess I mean.
[20:58:02] mordof: but... a simple script to call bin/rails -b 127.0.0.1 is not that big a deal really
[20:58:18] mordof: call it rs and it's even shorter to type
[20:58:44] sloggerkhan: true, but if someone's used to typing rails s...
[21:00:24] sloggerkhan: Basically I don't want it accidentally be running on an address that random other people on the network can hit.
[21:00:47] sloggerkhan: If people need to remember a different command to use args, sometime somebody will forget.
[21:01:54] Scriptonaut: has left #RubyOnRails: ()
[21:02:30] ascarter: has joined #RubyOnRails
[21:02:55] mordof: make a small script 'rs' - and include a raise inside rails if it's bound to 0.0.0.0
[21:02:58] mordof: break that habit, lol
[21:03:30] mordof: gives you more capability later if you want to add configuration to it requiring command line stuff, or prep commands, or anything really
[21:03:38] mordof: ACTION shrugs
[21:04:41] mordof: it feels like you should be doing more about locking down your computers access with firewall stuff also.. which would solve the issue too
[21:04:52] mordof: ACTION wanders off to go home
[21:06:25] sloggerkhan: mordof: For a variety of reasons that's not simple. There are firewalls, but there are also an awful lot of users on our side of them.
[21:07:43] sloggerkhan: Also, killing the port conf option in puma.rb and just putting bind seems to solve the double listen.
[21:13:45] ascarter: has joined #RubyOnRails
[21:15:04] gusrub: has joined #RubyOnRails
[21:15:17] ascarter: has joined #RubyOnRails
[21:24:16] ascarter: has joined #RubyOnRails
[21:30:47] Gm4n: has joined #RubyOnRails
[21:32:40] arBmind: has joined #RubyOnRails
[21:33:57] agent_white: has joined #RubyOnRails
[21:36:14] rfoust: has joined #RubyOnRails
[21:42:08] Cache_Money: ActiveRecord sets the created_at and updated_at columns to UTC time, correct?
[21:44:38] xco: has joined #RubyOnRails
[21:44:55] xco: getting Gem::InstallError: liquid requires Ruby version >= 2.1.0. when i’m actually on ruby 2.4 with rvm. ideas?
[21:45:25] fryguy: xco: how are you installing the gem?
[21:45:35] xco: bundle install
[21:45:40] ascarter: has joined #RubyOnRails
[21:45:47] xco: btw just saw that ruby -v is returning ruby 2.0 :(
[21:51:29] statikowsky: has joined #RubyOnRails
[21:53:47] desnudopenguino: well that'll do it!
[21:58:17] xco: maybe there’s something wrong with my bash profile? https://gist.github.com/siaw23/7f012f48d0c30e7ea8f35f3468ec955e can’t seem to make macOS use rvm
[21:59:33] cnk: You should not have to do that 3 times - in fact it might get confused if you do
[22:00:12] cnk: do you have ~/.profile and ~/.bash_profile? if so, why?
[22:06:26] xco: cnk: does it matter which one i remove?
[22:08:54] cnk: not sure
[22:09:12] cnk: do either have stuff that you did not post and need to keep?
[22:09:30] cnk: and is that file really bash_profile.txt or is it .bash_profile
[22:09:49] cnk: the former probably isn't read but the llater one should be
[22:10:35] ule: Hey guys.. I have 2 questions: 1) Is it OK to add private methods inside my Controllers' tests?
[22:11:06] ule: 2) Is there a file that I can place some general methods that is visible to all my controllers' tests?
[22:11:22] ule: I'm using Minitest by the way
[22:11:40] cnk: You could put the general methods on a module and include it where you need it
[22:11:59] cnk: or include it in the setup script that governs minitest
[22:12:54] ule: cnk: you mean test_helper?
[22:12:58] ule: that sounds good
[22:13:39] ule: thanks!!
[22:14:05] rakm: has joined #RubyOnRails
[22:20:10] Ferdroid: has joined #RubyOnRails
[22:31:35] Radar: GOOD MORNING
[22:31:52] desnudopenguino: i have a strange issue with some login functionality. So I have a login page, when I hit the submit button it is passing the data to the server, but getting a 204 back, and not doing anything
[22:40:34] gusrub: has joined #RubyOnRails
[22:42:14] desnudopenguino: byebug is such a nice tool
[22:55:00] dblessing: has joined #RubyOnRails
[22:59:12] Synthead: has joined #RubyOnRails
[23:08:01] roamingdog: has joined #RubyOnRails
[23:36:35] birdstheword: has joined #RubyOnRails
[23:38:16] birdstheword: Hola! I have a quick question I hope someone might have some insight into. I have googled all day trying to figure this out.
[23:39:23] birdstheword: I'm running ruby 2.4.0 and rails 5.0.3. I have a controller that is the root controller and it renders just fine and is shown in the web browser for the FIRST user to access the controller. Any subsequent user never gets and http response, however, puma and the console logs seems to believe it rendered a 200 OK.
[23:53:29] birdstheword: Here's a quick gist with an example of what I am saying: https://gist.github.com/anonymous/9e4fe86f8506d5bfc7fd53f779d99cfa
[23:53:42] bphogan: has joined #RubyOnRails
[23:57:29] shotbug: has joined #RubyOnRails
[23:59:51] ascarter: has joined #RubyOnRails