« Back to channel list

#RubyOnRails - 15 February 2016

« Back 1 day Forward 1 day »
[00:01:24] eljimmy: has joined #RubyOnRails
[00:01:48] Devalo: has joined #RubyOnRails
[00:02:34] stannard: has joined #RubyOnRails
[00:06:08] unl0ckd: has joined #RubyOnRails
[00:16:12] rhizome: more an angular question tbh
[00:25:53] _Tariq: has joined #RubyOnRails
[00:27:14] _Tariq: has joined #RubyOnRails
[00:29:06] jtong: has joined #RubyOnRails
[00:30:50] maesitos: has joined #RubyOnRails
[00:30:58] pjammer: has joined #RubyOnRails
[00:31:24] blackmesa: has joined #RubyOnRails
[00:33:12] superlou: has joined #RubyOnRails
[00:35:18] benlieb: has joined #RubyOnRails
[00:36:07] _Tariq: has joined #RubyOnRails
[00:39:42] alex88: has joined #RubyOnRails
[00:42:07] sevenseacat: has joined #RubyOnRails
[00:42:48] Radar: ACTION opens gist, sees angular, flees in terror
[00:42:50] Radar: droptone: !gist-usage
[00:42:50] helpa: droptone: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[00:43:18] Radar: droptone: Formatting the Gist as advised by that guide will make it easier for people to grok your code. Please do it.
[00:46:11] jtong: has joined #RubyOnRails
[00:47:02] SteenJobs: what do you guys use if you need fake/sample images in your apps? i???ve used Faker in the past, but ideally i want randomly sized images.
[00:48:19] rhizome: uh, there's that cat one
[00:48:32] rhizome: does faker do images?
[00:48:38] Radar: https://placekitten.com/
[00:49:11] Radar: faker does not do images
[00:49:27] juddey: has joined #RubyOnRails
[00:49:45] rhizome: i know it does a lot more now that it did when i started using it
[00:50:09] SteenJobs: Faker does ???avatars??? from robohash
[00:51:01] SteenJobs: so you can use faker, you just have to specifiy the image dimensions???same with placekitten, so seems like i can just use faker and just generate x number of images of varied sizes
[00:51:37] RegulationD: has joined #RubyOnRails
[00:51:52] roshanavand: has joined #RubyOnRails
[01:00:37] rgtk: has joined #RubyOnRails
[01:00:37] maesitos: has joined #RubyOnRails
[01:01:12] ZerGabriel: has joined #RubyOnRails
[01:02:26] rgtk: has joined #RubyOnRails
[01:02:30] maesitos: has joined #RubyOnRails
[01:04:21] rgtk: has joined #RubyOnRails
[01:04:24] maesitos: has joined #RubyOnRails
[01:06:16] rgtk: has joined #RubyOnRails
[01:06:18] maesitos: has joined #RubyOnRails
[01:06:41] roshanavand: has joined #RubyOnRails
[01:07:50] quazimodo: has joined #RubyOnRails
[01:08:08] maesitos_: has joined #RubyOnRails
[01:08:12] rgtk: has joined #RubyOnRails
[01:10:02] rgtk: has joined #RubyOnRails
[01:10:02] maesitos_: has joined #RubyOnRails
[01:10:53] tmoore: has joined #RubyOnRails
[01:11:04] baweaver: has joined #RubyOnRails
[01:11:54] maesitos: has joined #RubyOnRails
[01:11:59] rgtk: has joined #RubyOnRails
[01:13:48] maesitos: has joined #RubyOnRails
[01:13:52] rgtk: has joined #RubyOnRails
[01:15:44] maesitos: has joined #RubyOnRails
[01:17:16] asahi: has joined #RubyOnRails
[01:17:38] maesitos: has joined #RubyOnRails
[01:19:05] underplank: has joined #RubyOnRails
[01:19:27] maesitos: has joined #RubyOnRails
[01:19:36] underplank: Quick question. If i use the Model.select(???Some random string???) will active record sanitize that string?
[01:20:17] rgtk: has joined #RubyOnRails
[01:21:22] maesitos: has joined #RubyOnRails
[01:23:12] maesitos: has joined #RubyOnRails
[01:23:14] oded: has joined #RubyOnRails
[01:24:05] Spami: has joined #RubyOnRails
[01:24:29] rgtk_: has joined #RubyOnRails
[01:25:06] maesitos: has joined #RubyOnRails
[01:25:32] smathy: has joined #RubyOnRails
[01:26:58] maesitos: has joined #RubyOnRails
[01:28:34] pwnd_nsfw: underplank, I don't believe so
[01:28:51] maesitos: has joined #RubyOnRails
[01:29:10] underplank: pwnd_nsfw: whats the easiest way to get ActiveRecord to sanitize a String? I???ve seen ActiveRecord::base.sanitize()
[01:30:47] maesitos_: has joined #RubyOnRails
[01:30:53] blackmesa: has joined #RubyOnRails
[01:32:41] maesitos: has joined #RubyOnRails
[01:33:02] rgtk: has joined #RubyOnRails
[01:34:32] maesitos: has joined #RubyOnRails
[01:35:58] nickjj_: has joined #RubyOnRails
[01:36:27] maesitos: has joined #RubyOnRails
[01:37:09] rgtk_: has joined #RubyOnRails
[01:38:18] maesitos: has joined #RubyOnRails
[01:38:54] barhum2013: has joined #RubyOnRails
[01:40:14] maesitos: has joined #RubyOnRails
[01:41:15] rgtk: has joined #RubyOnRails
[01:41:28] smathy: underplank, !xy
[01:41:28] helpa: underplank: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[01:42:00] goodcodeguy: has joined #RubyOnRails
[01:42:05] maesitos: has joined #RubyOnRails
[01:44:01] maesitos_: has joined #RubyOnRails
[01:44:22] underplank: helpa: good feedback. My specific problem is that I need to use Postgresqls specific syntax ???DISTINCT ON (column)??? in multple queries. So I construct the select as a string, dynamically joining the other columns in the model into the select portion of the query. I then use that string that I???ve constructed to feed into a Model.select function call. And after that add some more .where() filters on for good effect. I wa
[01:44:22] underplank: select string to make it safe.
[01:44:30] takokat: has joined #RubyOnRails
[01:45:04] underplank: That has lead me to want to know what function I should use to sanitize a string.
[01:45:21] underplank: If there is another way to do this, im happy to find out.
[01:45:25] rgtk_: has joined #RubyOnRails
[01:45:52] maesitos: has joined #RubyOnRails
[01:46:26] smathy: underplank, keep going, one more level up. Explain the problem you're trying to solve with this DISTINCT ON stuff.
[01:47:43] maesitos: has joined #RubyOnRails
[01:49:08] underplank: I have a set of objects. Each object is represented by several version in the DB. I would like to select a set of objects, only selecting the latest versions of each. This is what DISTINCT ON gets me.
[01:49:13] JoshGlzBrk: has joined #RubyOnRails
[01:49:35] rgtk: has joined #RubyOnRails
[01:49:36] maesitos: has joined #RubyOnRails
[01:51:30] maesitos_: has joined #RubyOnRails
[01:53:23] maesitos: has joined #RubyOnRails
[01:53:42] rgtk_: has joined #RubyOnRails
[01:54:40] takokat: I want to mount a Sinatra app within my Rails app by using "mount" in my routes. The Sinatra app I want to add has its own directory structure and multiple files. Where can I put the source code of the Sinatra app within my Rails directory structure for "best practices"?
[01:55:18] maesitos_: has joined #RubyOnRails
[01:57:09] maesitos: has joined #RubyOnRails
[01:57:14] DmitryBochkarev: has joined #RubyOnRails
[01:57:47] rgtk: has joined #RubyOnRails
[01:59:06] maesitos: has joined #RubyOnRails
[02:00:55] maesitos: has joined #RubyOnRails
[02:01:57] rgtk: has joined #RubyOnRails
[02:02:50] viiralvx: has joined #RubyOnRails
[02:02:52] maesitos: has joined #RubyOnRails
[02:03:01] Spami: has joined #RubyOnRails
[02:04:45] maesitos: has joined #RubyOnRails
[02:04:59] fedexo: has joined #RubyOnRails
[02:05:30] Technodrome: has joined #RubyOnRails
[02:05:46] Technodrome: can i have some style sheets only load on certain paths ?
[02:06:02] rgtk_: has joined #RubyOnRails
[02:06:16] SteenJobs: has anyone used masonry/isotope to dynamically create a grid for images of varied size?
[02:06:36] maesitos: has joined #RubyOnRails
[02:08:35] maesitos_: has joined #RubyOnRails
[02:09:23] braian: has joined #RubyOnRails
[02:09:38] underplank: has joined #RubyOnRails
[02:10:22] maesitos: has joined #RubyOnRails
[02:12:17] maesitos: has joined #RubyOnRails
[02:13:23] stannard: has joined #RubyOnRails
[02:14:08] maesitos: has joined #RubyOnRails
[02:14:36] rgtk: has joined #RubyOnRails
[02:16:04] maesitos: has joined #RubyOnRails
[02:16:42] y2mq37: has joined #RubyOnRails
[02:17:55] maesitos: has joined #RubyOnRails
[02:18:04] codesoda: has joined #RubyOnRails
[02:18:36] rgtk: has joined #RubyOnRails
[02:19:40] Spami: has joined #RubyOnRails
[02:19:48] maesitos: has joined #RubyOnRails
[02:20:05] Technodrome: anyone? can assets be limited to the resources they are to target?
[02:20:14] arBmind: has joined #RubyOnRails
[02:20:21] Technodrome: i dont want active admin taking over my bootstrap theme on the front end, which it currently is doing just that
[02:20:24] sevenseacat: Technodrome: i dont think that makes sense to do.
[02:20:35] sevenseacat: you can have multiple manifests, yes
[02:20:51] Technodrome: i active admin working, only issue is, active admin styles are bleeding to my main site
[02:20:58] Technodrome: or other resources or whatever you want to call them
[02:21:15] Technodrome: how can i make so those style sheets only load on active admin controllers
[02:21:26] Devalo: has joined #RubyOnRails
[02:21:40] sevenseacat: you may want to use a different manifest for your frontend, that doesnt load the activeadmin stylesheets
[02:21:41] maesitos: has joined #RubyOnRails
[02:21:42] codesoda: @Technodrome: check your application.css
[02:22:27] Technodrome: yes what about it
[02:22:40] codesoda: does it say active admin anywhere?
[02:22:43] Technodrome: i mean i want the style sheets there loaded, but only on those controllers
[02:22:46] rgtk_: has joined #RubyOnRails
[02:23:08] Hans267: has joined #RubyOnRails
[02:23:18] Technodrome: just the require . and the require tree
[02:23:39] maesitos: has joined #RubyOnRails
[02:24:14] codesoda: @Technodrome I don't think require_tree should be pulling in active admin, but try remove it and see if you skip the active admin files
[02:24:16] Technodrome: codesoda in the directory there is a active_admin.css
[02:24:36] codesoda: you shouldn't have any active admin css files, they come from the gem
[02:25:05] Technodrome: well that's interesting, i'm guessing it got added in the install
[02:25:27] _Tariq: has joined #RubyOnRails
[02:25:31] maesitos: has joined #RubyOnRails
[02:25:34] mickey_mouse: has joined #RubyOnRails
[02:25:35] Technodrome: same with scaffolds.scss , that gets added application wide as well, rather than per controller, but i guess that is normal?
[02:25:49] codesoda: perhaps you added it because you were getting a pre-compilation error with active admin?
[02:26:05] Technodrome: create app/assets/javascripts/active_admin.js.coffee
[02:26:06] Technodrome: create app/assets/stylesheets/active_admin.scss
[02:26:29] Technodrome: rails generate active_admin:install this added it
[02:26:51] codesoda: might be the latest version/s of active admin that do that, I avoid it
[02:27:16] rgtk: has joined #RubyOnRails
[02:27:20] Technodrome: when i remove it, it removes the style sheet from the backend
[02:27:24] maesitos: has joined #RubyOnRails
[02:27:32] codesoda: i just checked an old project, you are correct
[02:28:03] codesoda: so make a folder for your normal assets, then require that as a tree
[02:28:15] codesoda: app/assets/stylesheets/app
[02:28:31] codesoda: then in application.scss just require_tree app
[02:29:16] maesitos: has joined #RubyOnRails
[02:29:57] Technodrome: i got it , i just moved it into vendor style sheets, and it loads file now codesoda
[02:30:28] Technodrome: it looks like i could have removed the require tree . though
[02:31:01] Technodrome: codesoda how would putting it in a directory and then requireing it change anything though?
[02:31:07] Technodrome: wouldn't it still get loaded on every request?
[02:31:08] rgtk: has joined #RubyOnRails
[02:31:12] maesitos: has joined #RubyOnRails
[02:31:40] codesoda: nah, you will using 2 seperate stylesheets
[02:31:55] codesoda: application.scss shouldn't pull in active admin styles
[02:32:05] Technodrome: so what will load the active admin styles then?
[02:32:09] codesoda: and activeadmin should only pull in activeadmin
[02:32:20] Technodrome: when / where does it pull that in at?
[02:32:37] Technodrome: so it will just create the html link tag, and pull it in like that?
[02:32:48] Technodrome: rather than every page load having it?
[02:32:52] Technodrome: i see, stupid question
[02:32:58] codesoda: it is probably expecting it to end up in /assets/active_admin.(css/js)
[02:32:59] xnp70: has joined #RubyOnRails
[02:33:05] maesitos: has joined #RubyOnRails
[02:33:06] Technodrome: i was thinking that maybe active admin wouldn't pull it in, and relied on some other automatic mechanism
[02:33:23] codesoda: which vendor/assets or app/assets/(stylesheets/javascripts) would solve
[02:33:27] Technodrome: i just moved it to vendor stylesheets, and it works fine with no code change
[02:33:48] Technodrome: but yes i see what you mean
[02:33:56] codesoda: that will work, but vendoring a stylesheet is normally a different process
[02:34:09] codesoda: i'd recommend a folder and leave active admin where it was
[02:34:27] codesoda: so if you upgrade active admin, you can just rake install again to update it
[02:34:29] Technodrome: but still, how would active admin know about the new location for the css file? , does the rails server just know all available css files that are in that directory and below?
[02:34:50] Technodrome: i see whats happening here i think
[02:34:54] codesoda: sprockets will build css files and put them in /assets after bundle assets
[02:34:58] maesitos: has joined #RubyOnRails
[02:35:14] rgtk_: has joined #RubyOnRails
[02:35:27] Technodrome: yes, it knows about all css files under assets/stylesheets right?
[02:35:47] Technodrome: the application.css , is just what gets loaded in the head
[02:35:55] codesoda: You should check out http://guides.rubyonrails.org/asset_pipeline.html#asset-organization
[02:36:04] hcnewsom: has joined #RubyOnRails
[02:36:10] Technodrome: so when active admin says load active_admin.css , its in the css array or however its done
[02:36:28] codesoda: it loads that css file, but that will be the compiled version of the file
[02:36:35] Technodrome: i was confusing the require . and require tree with loading / recognizing
[02:36:51] maesitos_: has joined #RubyOnRails
[02:36:59] Technodrome: hence why it can find it in the vendor, because the css file name gets added to some array so it knows where to find it
[02:37:13] Technodrome: yet it doesn't get loaded on each load because its not in the application.css
[02:37:26] codesoda: once you deploy to a server, this will probably break
[02:37:48] codesoda: as @sevenseacat suggested, you'll need a seperate manifest
[02:38:14] codesoda: (and add it to the list of manifests to be compiled)
[02:38:44] maesitos: has joined #RubyOnRails
[02:38:49] Technodrome: because when not in prod it just compiles everything right?
[02:39:02] codesoda: something like that
[02:39:13] Technodrome: similar to how java j2ee apps work
[02:39:34] SteenJobs: has joined #RubyOnRails
[02:39:34] Technodrome: can auto detect many files, but when in prod wants them specified
[02:40:05] Technodrome: i've been using rails for a while, but i normally don't install active admin, and every other app the styles have not conflicted, so never had to worry about it
[02:40:38] maesitos: has joined #RubyOnRails
[02:40:38] codesoda: there is definately a lot of little magical things that kick your butt the first time you experience them
[02:42:31] maesitos_: has joined #RubyOnRails
[02:43:20] Technodrome: how about scaffolds.scss , do you mostly just let that get loaded in the top level application.scss ?
[02:43:47] Technodrome: its not conflicting really, but again, would be nice if it loaded per controller
[02:44:26] maesitos: has joined #RubyOnRails
[02:46:18] maesitos: has joined #RubyOnRails
[02:46:36] hardtail: has joined #RubyOnRails
[02:48:10] maesitos_: has joined #RubyOnRails
[02:48:12] rgtk: has joined #RubyOnRails
[02:50:05] maesitos: has joined #RubyOnRails
[02:51:58] maesitos: has joined #RubyOnRails
[02:51:59] Technodrome: also when i do a get 'something' => 'something#new' , my scaffold redirect breaks, and actually the /something/id breaks as well , why would that be, how would a simple get method for routing break the route for somethings/id , i thought it would have no effect
[02:52:24] Radar: Technodrome: full context of config/routes.rb. I'm guessing you're putting that new route underneath a resources :something call.
[02:52:27] RegulationD: has joined #RubyOnRails
[02:52:40] Radar: Whoops, missed "please" in that first sentence.
[02:52:49] hardtail: has joined #RubyOnRails
[02:53:48] maesitos: has joined #RubyOnRails
[02:54:23] hardtail: has joined #RubyOnRails
[02:55:43] maesitos: has joined #RubyOnRails
[02:56:50] rgtk: has joined #RubyOnRails
[02:57:33] maesitos: has joined #RubyOnRails
[02:58:08] Technodrome: Radar devise_for :admin_users, ActiveAdmin::Devise.config
[02:58:08] Technodrome: ActiveAdmin.routes(self)
[02:58:09] Technodrome: get 'contact' => 'contacts#new'
[02:58:09] Technodrome: resources :contacts
[02:58:28] bronson: has joined #RubyOnRails
[02:58:41] Technodrome: now on that scaffold, when i click "create" , it will just do contact.2 then contact.3 , its not redirecting to the show method
[02:59:27] maesitos: has joined #RubyOnRails
[02:59:32] eikood: has joined #RubyOnRails
[02:59:46] codesoda: you are using the wrong route
[02:59:52] oded_: has joined #RubyOnRails
[03:00:10] codesoda: probably using contacts_path, instead of contact_path(contact)
[03:00:30] Technodrome: its the default scaffold
[03:00:44] underplank: has joined #RubyOnRails
[03:00:57] rgtk_: has joined #RubyOnRails
[03:01:01] codesoda: are you trampling the route though?
[03:01:10] Technodrome: i am using new_contact_path from the menu
[03:01:22] maesitos: has joined #RubyOnRails
[03:01:36] codesoda: did you add this? get 'contact' => 'contacts#new'
[03:01:55] rogue_koder: has joined #RubyOnRails
[03:02:18] Technodrome: and it seems like once i do , it removes my show path
[03:02:39] Technodrome: show update etc no longer have a path anymore when looking at the routes
[03:03:14] codesoda: I'm confused, is this within active admin, or unrelated
[03:03:18] maesitos_: has joined #RubyOnRails
[03:03:34] Radar: !activeadmin
[03:03:34] helpa: *makes a cross with fingers and says a prayer*
[03:03:46] Technodrome: codesoda unrelated sorry about that :)
[03:03:47] codesoda: @radar lolz
[03:03:51] Radar: Technodrome: !gist next time
[03:03:51] helpa: Technodrome: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[03:03:59] Radar: Technodrome: Gist the full routes please.
[03:04:15] Technodrome: plain and simple, by adding get 'contact => 'contact#new' , my contacts#show no longer has a path
[03:04:35] Technodrome: i thought get would just "add" a path, not completely change the underlying resources
[03:05:01] Radar: Technodrome: Gist the full routes AND rake routes, please.
[03:05:07] rgtk: has joined #RubyOnRails
[03:05:08] maesitos: has joined #RubyOnRails
[03:05:47] joshkovach: has joined #RubyOnRails
[03:05:57] Technodrome: btw, the goal here was to have /contact just be an alias for contacts/new
[03:06:06] Technodrome: i think i went about it the wrong with the "get" method
[03:06:13] Radar: Technodrome: Gist the full routes AND rake routes, please.
[03:06:39] xnp70: has left #RubyOnRails: ()
[03:06:55] rhizome: if you have resources :contacts, your idea will step on that
[03:07:03] maesitos: has joined #RubyOnRails
[03:07:24] zworks: has joined #RubyOnRails
[03:08:03] Surt_Q: has joined #RubyOnRails
[03:08:57] maesitos: has joined #RubyOnRails
[03:10:50] maesitos: has joined #RubyOnRails
[03:12:09] Technodrome: Radar http://pastebin.ca/3374107
[03:12:11] baweaver: has joined #RubyOnRails
[03:12:25] Radar: Technodrome: Close enough.
[03:12:29] Technodrome: so basically after i add get 'contact' => 'contacts#new' , the redirect no longer works
[03:12:39] Technodrome: thats the biggest issue right now
[03:12:41] maesitos: has joined #RubyOnRails
[03:12:49] Radar: Technodrome: line 90 there shows that the contact helper has been redefined to go to the contacts/new.
[03:13:01] Radar: contact_path and contact_url will go there instead of to the show action.
[03:13:43] rgtk: has joined #RubyOnRails
[03:14:02] Technodrome: i didn't mess with the scaffolding code
[03:14:14] Radar: because you're defining the route as get 'contact', which will define a contact_path helper for you to try and be helpful.
[03:14:26] Radar: Technodrome: Third time lucky: show us config/routes.rb please.
[03:14:33] Technodrome: ok, is there any way for it not to do that?
[03:14:46] maesitos: has joined #RubyOnRails
[03:14:50] Technodrome: i just want /contact to show contact/new
[03:15:38] helpa: http://i.imgur.com/m9m3wr9.gif
[03:15:44] Radar: Technodrome: I am getting annoyed right now that I have asked for your routes.rb file three times and that you have not shown it. Please show the config/routes.rb file so that I can look at it.
[03:16:26] Technodrome: http://pastebin.ca/3374109
[03:16:31] maesitos: has joined #RubyOnRails
[03:16:40] Technodrome: its only 4 lines, just that
[03:16:54] Radar: Oh, both rake routes and the routes are in there. Thank you.
[03:17:01] Radar: Technodrome: !gist-usage in future to make that more obvious.
[03:17:01] helpa: Technodrome: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[03:17:14] Surt_Q_: has joined #RubyOnRails
[03:17:17] mickey_mouse: has joined #RubyOnRails
[03:17:25] Radar: Technodrome: Try defining that get 'contact' route after resources :contacts.
[03:17:48] rgtk: has joined #RubyOnRails
[03:18:02] Surt_Q: has joined #RubyOnRails
[03:18:06] Technodrome: redirects fine now
[03:18:23] maesitos: has joined #RubyOnRails
[03:18:27] Technodrome: so i was just overriding with creating a new helper? which then overwrote the old paths?
[03:18:27] _Tariq: has joined #RubyOnRails
[03:19:44] Radar: You defined a route, which defined a helper. resources :contacts won't override helpers that already exist.
[03:19:58] Radar: It saw that contact_path / contact_url already existed, so it didn't create it.
[03:20:08] Radar: didn't create a new contact_path / contact_url helper*
[03:20:17] maesitos_: has joined #RubyOnRails
[03:20:57] Technodrome: so by me defining get 'contact' etc, it got rid of the old new_contact_path ?
[03:21:16] Radar: No, you're thinking of it backwards. It wasn't "old" according to routes.
[03:21:49] Radar: Technodrome: Routes are defined top-down. You defined get "contact"... which defined a routing helper called "contact". Then you call resources :contacts which attempts to also define a "contact" helper, but it won't do that because one exists already.
[03:22:09] maesitos: has joined #RubyOnRails
[03:22:17] Technodrome: but why did that mess up the redirect?
[03:22:29] stannard: has joined #RubyOnRails
[03:22:50] Technodrome: contact#show was still there and defined by the resources
[03:24:03] maesitos_: has joined #RubyOnRails
[03:24:24] mickey_mouse: has joined #RubyOnRails
[03:25:02] rhizome: render :new if params[:id].nil? # in contacts#show
[03:25:28] Technodrome: i understand that is redefined the new for that one route, but i'm still not seeing why it didn't redirect to the show method, which is completely separate and not related to new method
[03:25:54] maesitos: has joined #RubyOnRails
[03:26:11] rgtk: has joined #RubyOnRails
[03:26:58] Radar: Technodrome: It messed it up because redirect_to @contact uses contact_path(@contact) to redirect, which would redirect to /contacts/new.1
[03:26:58] sevenseacat: its the same method
[03:27:13] Radar: Technodrome: Show us the contacts_controller.rb in a gist.github.com Gist please.
[03:27:28] Technodrome: Radar i get it , it makes sense
[03:27:43] Technodrome: format.html { redirect_to @contact,
[03:27:47] Radar: Yes, that's it.
[03:27:50] maesitos: has joined #RubyOnRails
[03:27:56] Technodrome: i just thought it would be @contact('show')
[03:27:58] Radar: I explain that more in this blog post: http://ryanbigg.com/2012/03/polymorphic-routes/
[03:28:07] Technodrome: i didn't know it used the same helper
[03:29:39] maesitos_: has joined #RubyOnRails
[03:29:48] Technodrome: Radar so i'm guessing it does some magic here on the redirect_to method, to see what method to send it to? like show/id ?
[03:30:05] Radar: Technodrome: Read that blog post I linked you to. It'll explain it.
[03:30:16] rgtk: has joined #RubyOnRails
[03:30:46] rakm: has joined #RubyOnRails
[03:31:31] maesitos: has joined #RubyOnRails
[03:32:17] Surt_Q: has joined #RubyOnRails
[03:32:56] Surt_Q: has joined #RubyOnRails
[03:33:23] _Tariq: has joined #RubyOnRails
[03:35:11] Spami: has joined #RubyOnRails
[03:35:28] Surt_Q: has joined #RubyOnRails
[03:36:11] angryz: has joined #RubyOnRails
[03:36:40] eikood: has joined #RubyOnRails
[03:37:48] Radar: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[03:37:54] Radar: has joined #RubyOnRails
[03:37:57] Radar: So that's what that button does.
[03:39:07] mices: has joined #RubyOnRails
[03:43:57] macsteps: has joined #RubyOnRails
[03:45:41] yfeldblum: has joined #RubyOnRails
[03:46:45] yfeldblum: has joined #RubyOnRails
[03:52:54] pawnbox: has joined #RubyOnRails
[03:56:13] ilhami: has joined #RubyOnRails
[03:56:16] SteenJobs: what helper is recommended for creating a button that acts as either a link or executes an action (like downloading a file)? seems most of the helpers i???ve seen in the docs are for ???submit???.
[03:56:16] ilhami: sevenseacat, are you here?
[03:56:27] ilhami: having some issues. :/
[03:56:37] ilhami: Couldn't find Article with 'id'=1
[03:56:40] ilhami: but it exists.
[03:56:48] sevenseacat: are you sure?
[03:57:09] Radar: Sorry ilhami but you must've got one of them lying computers.
[03:57:18] Radar: Take it back to the shop and ask them to give you one that only ever tells the truth.
[03:57:21] pawnbox: has joined #RubyOnRails
[03:57:29] Radar: HELPA HAS SPOKEN
[03:57:38] Radar: SteenJobs: button_to
[03:57:58] SteenJobs: Radar: thanks - syntax for using an image asset for the button?
[03:58:11] Radar: SteenJobs: Typically done with a CSS before thingo.
[03:58:25] mices: there's no rvm on linux mint? only rbenv?
[03:58:36] ilhami: Problem is it tries to redirect me to the article after I deleted it instead of the articles_path which I specified. :/
[03:58:42] Radar: https://github.com/rubysherpas/r4ia_examples/blob/master/ticketee/app/assets/stylesheets/application.css.scss#L25-L40
[03:58:44] Radar: SteenJobs: ^
[03:58:45] sevenseacat: ilhami: !debug
[03:58:45] helpa: ilhami: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[03:59:15] bulldawgden: has joined #RubyOnRails
[03:59:58] SteenJobs: Radar: hmm..why not simply use link_to with an image_tag?
[04:00:06] ilhami: ActiveRecord::RecordNotFound in ArticlesController#destroy
[04:00:12] Radar: SteenJobs: You could do that too.
[04:00:23] Radar: ilhami: rails c; Article.find(1)
[04:00:44] Radar: SteenJobs: In this case, we want the button to have an image AND some text. It's just easier to do it that way.
[04:00:53] ilhami: Radar, it redirects me to the article page after deleting it. Of course it doesn't exist after deleting it.
[04:01:06] Radar: ilhami: As helpa said, please show us your code.
[04:01:39] SteenJobs: has joined #RubyOnRails
[04:02:08] ilhami: https://gist.github.com/anonymous/e63088f2e5d6e16a121f this is what I have in my articles controller
[04:02:28] SteenJobs: Radar: gotcha - the image asset i???m using has the text as part of the SVG file anyway, so i can get away with link_to
[04:02:53] sevenseacat: ilhami: articles_path isnt a string, it's a method.
[04:03:10] ilhami: aaaaaaaah
[04:03:17] Radar: ilhami: !rule0
[04:03:17] helpa: ilhami: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[04:03:22] ilhami: it's 5am. :P
[04:03:26] Radar: ilhami: For future reference, it is the first rule of the channel :P
[04:03:59] ilhami: done with the articles controller now. :)
[04:04:08] treaki__: has joined #RubyOnRails
[04:04:38] Radar: Time to get some sleep?
[04:05:00] ilhami: now I have to do the comments.
[04:05:24] Radar: helpa is broke :(
[04:05:30] sevenseacat: betrayed by helpa!
[04:06:17] dmarr: how do you step in pry?
[04:06:54] underplank: has joined #RubyOnRails
[04:08:04] treaki_: has joined #RubyOnRails
[04:09:07] dmarr: ah got it.. installed pry-byebug instead of pry
[04:09:07] Coldblackice: has joined #RubyOnRails
[04:12:12] DEA7TH: I find it that I often need to do the same let() statements in different specs - how can I reuse those? make another helper file and put them in a method there?
[04:12:32] ilhami: is SQLite the preferred DBMS for RubyOnRails ? Or is there another reason it's default?
[04:12:49] Radar: ilhami: It's the easiesdt to setup.
[04:13:37] braincrash: has joined #RubyOnRails
[04:13:45] ilhami: but how is it performance wise?
[04:13:50] ilhami: compared to MySQL e.g. ?
[04:16:14] Radar: ilhami: !g mysql vs sqlite3
[04:16:18] Radar: ilhami: !rule1
[04:16:18] helpa: ilhami: Do your research before hand. Your question may be answerable with a quick Google search or by simply experimenting. If you're using a method in Rails, look it up in the API Docs or in the Official Guides.
[04:16:54] ilhami: I was asking for your opinion though. :D
[04:19:06] SteenJobs: i cannot for the life of me get this to work - two links that appear as buttons (created using image assets) side by side inline using bootstrap. putting them in separate columns spaces them too far from each other, giving them the ???btn??? class causes the images to be sized at 0x0
[04:19:20] xnp70: has joined #RubyOnRails
[04:19:23] SteenJobs: this is why i can???t stand frontend web stuff. it just seems so damn arbitrary and disorganized
[04:19:34] bulldawgden: has joined #RubyOnRails
[04:20:23] Shidash: has joined #RubyOnRails
[04:20:27] rizenine: has joined #RubyOnRails
[04:22:21] rubyonrailed: has joined #RubyOnRails
[04:22:55] ilhami: heheheheh
[04:24:19] benlieb: has joined #RubyOnRails
[04:24:23] Technodrome: has joined #RubyOnRails
[04:24:42] sevenseacat: everything is arbitrary and unorganized until you learn how it works
[04:24:52] baak: has joined #RubyOnRails
[04:24:54] ilhami: sevenseacat, +1
[04:25:02] ilhami: patience is a virtue.
[04:25:50] SteenJobs: obviously, but there are obviously various gradations for how well designed a system is
[04:26:13] SteenJobs: with backend code, there tends to be significantly more structure and therefore it???s more logically intuitive
[04:29:47] darkxploit: has joined #RubyOnRails
[04:36:02] Palsson: has joined #RubyOnRails
[04:38:55] khairahman: has joined #RubyOnRails
[04:39:10] SteenJobs: it???s fixed by setting a width or height for the image - but the sizing of the buttons needs to by dynamic so that???s no good
[04:40:45] ilhami: Show us your site :D
[04:40:46] kp666: has joined #RubyOnRails
[04:41:16] SteenJobs: proprietary and stuff
[04:41:31] SteenJobs: also not hosted remotely yet anyway
[04:41:45] Devalo: has joined #RubyOnRails
[04:46:47] kp666: has joined #RubyOnRails
[04:48:34] pawnbox: has joined #RubyOnRails
[04:50:06] darkxploit: has joined #RubyOnRails
[04:50:43] Technodrome: Radar thank you for that link earlier
[04:50:47] Radar: Technodrome: no worries :)
[04:50:57] Technodrome: that definitely cleared up how that works
[04:52:31] Technodrome: I see what you meant, I was essentially overriding contact_path, so the id was just getting appended onto the url
[04:52:31] hcnewsom: has joined #RubyOnRails
[04:52:35] pawnbox: has joined #RubyOnRails
[04:53:43] Technodrome: I guess many people might bump into this where you already have controller resources, then you want the similar name to point to it directly
[04:57:41] dmarr: Im trying to write a test for a worker process (sidekiq) and I am a little confused about passing an instance variable (@picture) to the test: https://github.com/marr/localpic2/blob/master/app/workers/sepia_filter.rb#L11
[04:58:33] dmarr: I was thinking I could pass it in here, and access the image_id property: https://github.com/marr/localpic2/blob/master/test/workers/sepia_filter_test.rb#L18
[04:59:00] dmarr: like, refactor sepia_filter to take in a picture instance SepiaFilter.perform_async(@picture.id)
[04:59:06] dmarr: SepiaFilter.perform_async(@picture)
[04:59:24] rhizome: i don't see '@picture' anywhere there
[04:59:56] Devalo_: has joined #RubyOnRails
[05:00:05] bronson: has joined #RubyOnRails
[05:00:10] dmarr: sorry yeah i was thinking of passing the picture instance in, so it would receive `picture` instead of `id
[05:00:23] dexter_: has joined #RubyOnRails
[05:00:34] rhizome: ok, then you get rid of the Picture.find. done.
[05:01:14] dmarr: this is a refile :attachment class
[05:01:41] rhizome: never used it
[05:02:05] tenderlove: has joined #RubyOnRails
[05:02:17] pawnbox: has joined #RubyOnRails
[05:03:26] dmarr: basically the output from puts @picture in the test is different from the one inside the filter function that i'm testing
[05:03:52] atrius: has joined #RubyOnRails
[05:03:56] dmarr: when i change it to pass in the instance, and puts inside the test 'sepia_filter_worker' it shows "#<Picture:0x007ffd87e52658>"
[05:03:59] pawnbox: has joined #RubyOnRails
[05:04:06] barhum2013: has joined #RubyOnRails
[05:04:47] underplank: has joined #RubyOnRails
[05:05:14] Radar: Seems fine
[05:05:16] Radar: what are youe xpecting?
[05:05:22] dmarr: id: 980190963,
[05:05:22] dmarr: title: nil,
[05:05:22] dmarr: created_at: Mon, 15 Feb 2016 05:05:03 UTC +00:00,
[05:05:24] dmarr: updated_at: Mon, 15 Feb 2016 05:05:03 UTC +00:00,
[05:05:26] dmarr: image_id: "c163344cbd971e55d00e13c6f82894f923a37a1858f73ca01383f43a76ff">
[05:05:43] rhizome: with you so far
[05:06:11] dmarr: and from inside the perform: => "#<Picture:0x007ffd87e52658>"
[05:06:25] rhizome: yeah those are the same
[05:06:33] dmarr: sorry, i mixed up the original output starts with => #<Picture:0x007fccab0b7bb8
[05:06:41] dmarr: so its not the stringified version
[05:06:51] dmarr: inside the perform shows the stringified version
[05:07:13] rhizome: this is requiring too much of my imagination
[05:07:23] dmarr: yeah i'll send a link one sec
[05:08:59] baweaver: has joined #RubyOnRails
[05:09:12] dmarr: yeah i'll send a link one sec
[05:14:20] Radar: I don't see any code that will output what you're saying is being output
[05:14:36] srinidhi: has joined #RubyOnRails
[05:15:19] dmarr: https://github.com/marr/localpic2/commit/8e4089e8d333a270f8f6ecfa7e711f7479841509
[05:16:57] Radar: dmarr: try pic.inspect?
[05:17:18] Radar: Also, passing full objects to Sidekiq jobs is not advised because they aren't serialised into Redis.
[05:17:51] dmarr: that might be whats happening ... => "\"#<Picture:0x007fa6304633a8>\""
[05:18:11] dmarr: i dont think i have sidekiq actually running, or redis for that matter
[05:20:04] dmarr: does that matter if i am running in a test env?
[05:20:21] dmarr: as in `bundle exec rake test`
[05:21:16] pawnbox: has joined #RubyOnRails
[05:21:56] ashishsingh173: has joined #RubyOnRails
[05:22:24] arup_r: has joined #RubyOnRails
[05:28:43] SteenJobs: when using send_data to download a file through the browser - how can you dynamically set the :type attribute? presumably users may upload files in various formats, so when the file is then downloaded, the :type attribute will differ from file to file
[05:32:24] maesitos: has joined #RubyOnRails
[05:33:41] xardion: has joined #RubyOnRails
[05:34:56] Ropeney: SteenJobs: `content_type: file.content_type` ?
[05:35:44] SteenJobs: Ropeney: presumably only works if you have an attribute ???content_type??? for the file object you???re referencing
[05:36:00] SteenJobs: which presents the same problem, when the user uploads the file, how do you determine the file type so you can save that attribute
[05:38:11] dmarr: this may be a refile problem now, but created_at and updated_at are the same even though I called Picture.save with a new image https://github.com/marr/localpic2/commit/8fd24ecab5f828b14a089575e530b4e7d284109a
[05:39:14] dmarr: would i have to reload picture somehow before this line https://github.com/marr/localpic2/blob/master/test/workers/sepia_filter_test.rb#L21
[05:40:32] dmarr: kinda new to async in rails
[05:40:53] tjbiddle: has joined #RubyOnRails
[05:42:15] tjbiddle: Opinion question - Which is preferred in the community on a Model: `before_destroy :remove_storage_object_if_self_avatar` or `before_destroy :remove_storage_object, if: Proc.new { is_self_avatar? }` (The conditional being in the method on the first option)
[05:42:17] juddey: has joined #RubyOnRails
[05:42:47] tjbiddle: Currently I have no use for deleting the storage object apart from this case
[05:43:49] godzillaenlacasa: has joined #RubyOnRails
[05:48:12] rails690: has joined #RubyOnRails
[05:49:05] ilhami: Ruby is a great language. :P
[05:49:09] ilhami: better than PHP
[05:49:18] rails690: i have a really big problem with rails' update method: if model.save update_attributes else render :edit <--
[05:49:28] sevenseacat: and that problem is?
[05:49:31] rails690: the render :edit part messes up things a lot, for example Javascript
[05:49:41] sevenseacat: messes up how?
[05:49:41] rails690: I have select2 for my select boxes
[05:50:02] rails690: when the validations fail for the form, and it does render :edit, select2 stops working and my select boxes are just normal select boxes
[05:50:16] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[05:50:30] pyemkey: has joined #RubyOnRails
[05:50:35] rails690: thats just 1 issue
[05:50:53] sevenseacat: one at a time
[05:51:10] worknick: has joined #RubyOnRails
[05:51:15] worknick: Good Morning.
[05:51:23] worknick: can I use :through for belongs_to
[05:51:46] sevenseacat: try it and see.
[05:52:11] apotry: has joined #RubyOnRails
[05:52:13] baweaver: !associations
[05:52:13] helpa: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[05:53:41] JoshGlzBrk: has joined #RubyOnRails
[05:55:10] xnp70: has joined #RubyOnRails
[05:57:45] joshkovach: has joined #RubyOnRails
[05:57:47] Prasun: has joined #RubyOnRails
[06:00:23] roshanavand: has joined #RubyOnRails
[06:00:31] pawnbox: has joined #RubyOnRails
[06:01:36] roshanavand: has joined #RubyOnRails
[06:01:46] pawnbox: has joined #RubyOnRails
[06:01:51] tildes: has joined #RubyOnRails
[06:01:56] rails690: has joined #RubyOnRails
[06:02:44] fn2187: has joined #RubyOnRails
[06:02:44] rails690: as i was saying: the render :edit ruins my JS. Select2 stops working. Here's my code: https://gist.github.com/anonymous/5b1b2eaef5f8ea4d2689 & https://gist.github.com/anonymous/3d36e50b7acba5805971
[06:06:06] SteenJobs: has joined #RubyOnRails
[06:06:45] Radar: rails690: !gist-usage
[06:06:45] helpa: rails690: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[06:06:51] Radar: rails690: More than one file can go in a Gist.
[06:06:51] juddey: has joined #RubyOnRails
[06:07:07] rails690: Radar: sorry, i jsut wanted the syntax to be highlighted
[06:07:17] Radar: rails690: Yes, that will happen if you use Gist right.
[06:07:59] dionysus69: has joined #RubyOnRails
[06:08:05] tildes: has joined #RubyOnRails
[06:08:17] tildes: Hi! I have a small DOM modifying javascript, and the onload function that puts the changes into action. These are both placed in the asset pipeline. I would want the script to be loaded only for those views where it's needed, and not for every views, as it currently is. Sure I can control whether it's executed by use of selectors, but I find it kind of unclean that it's loaded anyway for all pages. Would there be some better way to
[06:10:55] speakingcode: has joined #RubyOnRails
[06:11:15] pawnbox: has joined #RubyOnRails
[06:12:07] Radar: tildes: your question was cut off at "way to"
[06:12:44] tildes: Radar: Oh, I can see the whole thing... the end would be, "Would there be some better way to include the JS only for those pages which need it?"
[06:12:50] Radar: tildes: You could do it with a <%= yield :javascript_for_bottom %> in application.html.erb, and then in the view, <%= content_for :javascript_at_bottom do %><%= javascript_include_tag ... %><% end %>
[06:12:57] intrigueD: has joined #RubyOnRails
[06:13:58] tildes: Radar: So basically I would put the on-load function into the view, by including it there. Seems legit, thanks
[06:15:46] laurenonthehill: has joined #RubyOnRails
[06:15:58] pawnbox: has joined #RubyOnRails
[06:16:34] Devalo: has joined #RubyOnRails
[06:20:04] laurenonthehill: Hello, I have a question. I'm trying to make this form work properly: http://pastebin.com/VcZrw9Tr
[06:20:15] SteenJobs: what???s the syntax to use my own custom image for a file_field button?
[06:20:24] krz: has joined #RubyOnRails
[06:20:51] Radar: you... can't? It's a browser thing.
[06:20:59] laurenonthehill: Sorry, here's a better link: http://pastie.org/10722202
[06:21:11] Radar: laurenonthehill: thanks for doing that
[06:21:23] Radar: laurenonthehill: what's happening when you try that?
[06:21:34] SteenJobs: Radar: so there???s no way to use my own image asset as a button that launches the file browsing window?
[06:21:43] Radar: SteenJobs: not that I am aware of
[06:22:16] laurenonthehill: basically, if you look at that code there are 3 words hard coded and it all works. But what I really want is the vocab_list input by the user to find the words instead of hardcoding
[06:22:31] laurenonthehill: I've been trying to do it with an ajax request but I'm falling a little flat
[06:23:37] laurenonthehill: So a user can input a list of words in a text box, hit "Find words" and then use checkboxes to check which they want to associate with before creating the new object
[06:23:56] SteenJobs: Radar: ha there???s a decently clever hack - basically consists of hiding the file upload button, and using jQuery to divert the click of your custom button to the file upload button
[06:24:07] Radar: SteenJobs: yes, that's one way of doing it.
[06:24:22] Radar: SteenJobs: If you're going to go that far, why not make it even prettier using something like fineUploader?
[06:24:45] pawnbox: has joined #RubyOnRails
[06:24:54] SteenJobs: Radar: mostly because i didn???t know it existed until now :)
[06:25:09] SteenJobs: Radar: been out of the web game for a while, you forget about all of the various plugins and libraries out there
[06:26:07] SteenJobs: Radar: womp???need a commercial license
[06:26:46] intrigueD: has joined #RubyOnRails
[06:28:29] Radar: SteenJobs: Your company can't afford $499?
[06:28:39] SteenJobs: i???m sure they can
[06:28:46] Radar: SteenJobs: And you don't need it if you're not using it for commercial purposes.
[06:28:49] SteenJobs: but why pay $499 when i can just hide the button and put my own in?
[06:28:54] SteenJobs: we are using it for commercial purposes
[06:29:04] Technodrome: jeesh, even though i haven't used rails for years really, i'm making way more progress than I would if I did this in java ee (which I know extremely well)
[06:29:05] Radar: Because fineuploader offers more than that/
[06:29:12] SteenJobs: and i???ll just use dropzone.js for drag and drop
[06:29:18] Radar: OK, GLHF.
[06:29:29] SteenJobs: eh, don???t need those features for now - should we need it i???ll definitely tell them we need to purchase a license
[06:29:40] SteenJobs: but for now we just need a simple uploader for clients to upload image assets
[06:30:02] SteenJobs: Radar: i made a note though. right now i???m just building an MVP for a meeting on wed with a potentially huge client.
[06:32:04] barhum2013: has joined #RubyOnRails
[06:33:48] laurenonthehill: So I started trying to use javascript to render a partial, but how can I add the checkboxes (f.association) to the form that's already on the page.
[06:36:58] NeoHamled: has joined #RubyOnRails
[06:37:22] moeabdol2: has joined #RubyOnRails
[06:39:18] rails690: ok ive got some theoretical questions about optimistic locking
[06:40:23] rails690: if im using optimistic locking, and lets say Admin A is editing person #300, and Admin B is giving paychecks to people #289, #290, #300, #301
[06:40:55] rails690: actually there would never be a conflict here
[06:40:56] Prasun: has joined #RubyOnRails
[06:41:33] rails690: wait actually yes there would
[06:41:56] norc: has joined #RubyOnRails
[06:44:59] netzfisch: has joined #RubyOnRails
[06:46:04] lxsameer: has joined #RubyOnRails
[06:47:20] ur5us: has joined #RubyOnRails
[06:49:46] pawnbox: has joined #RubyOnRails
[06:49:59] rails690: how do I account for associations in optimistic locking?
[06:50:32] johnflux: has joined #RubyOnRails
[06:51:21] enitiz: has joined #RubyOnRails
[06:53:57] RegulationD: has joined #RubyOnRails
[06:56:20] worknick: this is my configuration for jquery dialog https://gist.github.com/wrknck/3dae7f407d14e98acb04 it still opens in the top left corner of my window. how can i force to be open in real world center of my browser?
[06:57:20] worknick: tried with of window. same result.
[06:58:17] kies^: has joined #RubyOnRails
[06:59:16] solars: has joined #RubyOnRails
[07:00:13] rails690: there's a fundamental problem with optimistic locking
[07:00:17] rails690: anyone want to help?
[07:00:36] rails690: it doesnt take into account associations
[07:01:23] triptec: has joined #RubyOnRails
[07:03:50] shaman42: has joined #RubyOnRails
[07:03:51] phon: has joined #RubyOnRails
[07:04:01] Janno: has joined #RubyOnRails
[07:04:02] neanderslob: has joined #RubyOnRails
[07:04:02] gavit: has joined #RubyOnRails
[07:04:02] parus: has joined #RubyOnRails
[07:04:02] devn_: has joined #RubyOnRails
[07:04:02] bl0m1: has joined #RubyOnRails
[07:04:02] Marquel: has joined #RubyOnRails
[07:04:03] oded_: has joined #RubyOnRails
[07:04:08] Marquel: has joined #RubyOnRails
[07:04:09] drupald: has joined #RubyOnRails
[07:04:09] djellemah: has joined #RubyOnRails
[07:04:10] gregf_: has joined #RubyOnRails
[07:04:11] speaking1ode: has joined #RubyOnRails
[07:04:11] Siyo: has joined #RubyOnRails
[07:04:11] Siyo: has joined #RubyOnRails
[07:04:11] wldcordeiro: has joined #RubyOnRails
[07:04:12] bphogan: has joined #RubyOnRails
[07:04:12] mclee: has joined #RubyOnRails
[07:04:15] Xat`: has joined #RubyOnRails
[07:04:15] w0bni: has joined #RubyOnRails
[07:04:15] Dreamer3: has joined #RubyOnRails
[07:04:16] aep: has joined #RubyOnRails
[07:04:18] dsimon: has joined #RubyOnRails
[07:04:19] coffeejunk: has joined #RubyOnRails
[07:04:19] sloggerkhan: has joined #RubyOnRails
[07:04:22] nullwarp: has joined #RubyOnRails
[07:04:24] Denarii: has joined #RubyOnRails
[07:04:28] hfp: has joined #RubyOnRails
[07:04:47] dmz: has joined #RubyOnRails
[07:04:52] knight_: has joined #RubyOnRails
[07:05:03] Conflict: has joined #RubyOnRails
[07:05:29] Psyq: has joined #RubyOnRails
[07:05:53] MiracleBlue__: has joined #RubyOnRails
[07:06:16] jhill_: has joined #RubyOnRails
[07:06:37] g3funk: has joined #RubyOnRails
[07:08:54] tvw: has joined #RubyOnRails
[07:11:05] krz: has joined #RubyOnRails
[07:12:26] rails690: any rails people here?
[07:13:34] rails690: optimistic locking doesnt take into account ASSOCIATIONS, this is a big problem, what should I do?
[07:14:04] sevenseacat: rails690: you may need to explain what you're talking about.
[07:14:16] rails690: For example, if two people are editing the same record, and one deletes an association and then saves, when the other one saves he'll get an exception saying suhc and such ID doesn't exist
[07:14:24] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[07:16:00] comrad: has joined #RubyOnRails
[07:16:46] rails690: You have a model named Person and it has a has many association called Department. Inside the form of Person, it contains a cocoon nested association form. Using optimistic locking, lets say Admin A edits Person #300, who has 2 Department associations. Then lets say Admin B comes and opens the edit page for #300 at the same time. Lets say Admin A deletes 1 out of the 2 Department Associations and then saves while Admin B is still editing. When
[07:16:46] rails690: Admin B is done editing and tries to save (and he didnt touch the Department associations), an error will be raised saying Department with such and such ID doesn't exist!
[07:17:18] rails690: How do I handle this?
[07:17:44] sevenseacat: ok, that has nothing to do with optimistic locking
[07:18:40] tjbiddle: has joined #RubyOnRails
[07:18:56] rails690: really? it relates to the same problem though --> 2 users editing the same record at the same time
[07:19:35] rails690: and ideally, if i was using optimistic locking, it should notify me if the associations changed
[07:20:36] sevenseacat: are you using it? I've seen no evidence of that
[07:21:03] techsethi: has joined #RubyOnRails
[07:21:32] rails690: I am using it, however it only raises a stale object exception if i edit normal fields (non associations)
[07:22:38] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[07:23:03] ilhami: guys.. tutorial is done now. :) Now I need to start on a project. sevenseacat you have any good ideas?
[07:23:15] sevenseacat: ilhami: whatever you're learning Rails for
[07:23:36] ilhami: I mean you can basically use it for any web project.
[07:23:39] eikood: has joined #RubyOnRails
[07:24:33] ilhami: sevenseacat, do you live close to Indonesia?
[07:24:50] sevenseacat: its thousands of km away.
[07:25:21] ilhami: well it's not that far compared to Denmark at least hehe
[07:25:46] matthewd: sevenseacat: To be fair.. what isn't? :P
[07:25:53] sevenseacat: matthewd: fair point.
[07:27:42] NeoHamled: has joined #RubyOnRails
[07:27:52] mhoungbo: has joined #RubyOnRails
[07:28:30] ilhami: 19 hours and 10 minutes between us sevenseacat
[07:29:26] ilhami: I should visit Australia. :P
[07:29:37] ilhami: nice weather btw.
[07:30:01] worknick: any idea on jq ui dialog positision?
[07:32:05] yardenbar: has joined #RubyOnRails
[07:33:20] maesitos: has joined #RubyOnRails
[07:35:15] sevenseacat: I have many ideas.
[07:35:53] Macaveli: has joined #RubyOnRails
[07:36:20] rails690: how do I use with_lock for model updates/creations/deletes, etc.? E.g. where do I put it in this action: https://gist.github.com/anonymous/3d36e50b7acba5805971
[07:36:23] eljimbo: has joined #RubyOnRails
[07:37:01] worknick: good for you.
[07:38:03] sevenseacat: rails690: you'd likely have to lock when loading the record.
[07:38:28] sevenseacat: http://api.rubyonrails.org/classes/ActiveRecord/Locking/Pessimistic.html
[07:38:38] algernop_k: has joined #RubyOnRails
[07:41:13] rvanlieshout: has joined #RubyOnRails
[07:44:12] eljimmy: has joined #RubyOnRails
[07:45:09] Pazician: has joined #RubyOnRails
[07:45:30] Prasun: has joined #RubyOnRails
[07:46:49] stel_ro: has joined #RubyOnRails
[07:47:04] tetraktys: has joined #RubyOnRails
[07:48:47] stel_ro: hello, i am coming from C++, and i want to grab ruby on rails , can you suggest me any good books for ruby? not absolute beginner, but for someone who have experience with programming.
[07:49:13] helpa: Learn Ruby by reading this book - http://manning.com/black3 - The Well-Grounded Rubyist by David A. Black
[07:49:50] armyriad: has joined #RubyOnRails
[07:51:19] ilhami: stel_ro, she wants your money. :P
[07:52:48] sevenseacat: its not my book
[07:53:03] kirillzh: has joined #RubyOnRails
[07:53:23] stel_ro: i see the syntax is little weird, i mean its not like the c-syntax like
[07:56:59] ilhami: sevenseacat, I was kidding.
[07:57:13] sevenseacat: ilhami: you keep saying that but you keep saying creepy things anyway
[07:57:36] ilhami: stel_ro, I'd recommend the tutorial on the official site
[07:57:51] rails690: in my controller im using def set_person
[07:57:51] rails690: @person = Person.lock.find(params[:id])
[07:58:08] rails690: and of course set_person is in a before_filter for show, edit, and update
[07:58:27] rails690: but no locking occurs and theres no change in my query, and im still able to edit the record at the same time
[07:58:35] rails690: i was wanting to use pessimistic locking...
[07:58:59] ilhami: sevenseacat, I like some things about you and dislike some things about you heh
[07:59:03] sandstrom: has joined #RubyOnRails
[07:59:07] juddey: has joined #RubyOnRails
[07:59:18] baweaver: ilhami: let's keep the personal chatter down.
[08:00:32] matthewd: rails690: I don't think pessimistic locking is going to help with [what I infer to be] the problem you're trying to solve
[08:00:48] rails690: matthewd: the association problem?
[08:01:13] rails690: matthewd: has no one faced this problem in rails before??? im surprised i cant find anything on it
[08:03:06] ilhami: I like the way Rails makes it easy to use HTTP Basic Auth
[08:03:06] baweaver: so basically a race condition on editing?
[08:03:38] baweaver: First step would be to try and make it an impossibility. Why are two sources able to update the same record at the same time?
[08:04:01] melonstorm: has joined #RubyOnRails
[08:04:02] ilhami: shouldn't be possible
[08:04:26] baweaver: it might be, but the question is if this is one such case for rails690
[08:04:53] matthewd: rails690: Do you need a `touch: true` on the `belongs_to`?
[08:05:08] rails690: matthewd: no, i dont even know what that is
[08:06:07] matthewd: If you don't know what it is, how do you know you don't need it?
[08:06:47] rails690: i see that it sets the updated_at to the current time for the associated job
[08:07:29] rails690: ok so if i set that, optimistic locking should take into account changes to the associations
[08:08:16] rails690: ok cool, let me try this, i still have more questions so please dont go
[08:09:19] ilhami: go hide matthewd
[08:12:15] darutoko: has joined #RubyOnRails
[08:16:01] edwinvdgraaf: has joined #RubyOnRails
[08:16:46] pawnbox: has joined #RubyOnRails
[08:18:01] sandstrom: has joined #RubyOnRails
[08:18:29] deur-: has joined #RubyOnRails
[08:18:46] Devalo: has joined #RubyOnRails
[08:22:15] eikood: has joined #RubyOnRails
[08:24:35] eikood: has joined #RubyOnRails
[08:26:57] eikood: has joined #RubyOnRails
[08:27:32] DylanJ: has joined #RubyOnRails
[08:29:30] ziyadb: has joined #RubyOnRails
[08:29:39] y2mq37: has joined #RubyOnRails
[08:30:22] SteenJobs: has joined #RubyOnRails
[08:32:01] artto: has joined #RubyOnRails
[08:34:02] shibly: has joined #RubyOnRails
[08:34:18] shibly: has left #RubyOnRails: ("Leaving")
[08:37:52] rubyonrails221: has joined #RubyOnRails
[08:38:11] rubyonrails221: has left #RubyOnRails: ()
[08:39:15] Atrox: has joined #RubyOnRails
[08:41:13] armyriad: has joined #RubyOnRails
[08:42:10] Atrox: Hi guys, is it possible to authenticate only specific channels in actioncable? I would love to use one channel for everybody and not only authenticated users.
[08:43:14] srinidhi: has joined #RubyOnRails
[08:46:44] kmckelvin: has joined #RubyOnRails
[08:48:15] stannard: has joined #RubyOnRails
[08:48:15] snowy: has joined #RubyOnRails
[08:49:23] AzaToth: has joined #RubyOnRails
[08:50:01] railsForDaiz: has joined #RubyOnRails
[08:50:06] nettoweb: has joined #RubyOnRails
[08:51:00] matthias_: has joined #RubyOnRails
[08:53:01] DEA7TH: has joined #RubyOnRails
[08:55:09] Ergo: has joined #RubyOnRails
[09:01:16] futilegames: has joined #RubyOnRails
[09:01:47] bronson: has joined #RubyOnRails
[09:03:20] herpless: has joined #RubyOnRails
[09:03:56] atmosx: has joined #RubyOnRails
[09:04:35] artto: has joined #RubyOnRails
[09:05:04] askhat: has joined #RubyOnRails
[09:07:13] askhat: has joined #RubyOnRails
[09:08:48] futilegames: has left #RubyOnRails: ()
[09:10:37] kmckelvin: has joined #RubyOnRails
[09:10:43] BradenBraden: has joined #RubyOnRails
[09:12:36] BradenBraden: hi guys. so i have a rails project that was set to use postgres but switching it over to rethinkDB to give it a go. removed the database.yml file, not require active_record in application.rb, removed migration files and all references to active record the in environment files as well as the models, however, its still loading AR and looking for database.yml which it no longer finds. Cannot load `Rails.application.database_configuration`: Could
[09:12:36] BradenBraden: not load database configuration. No such file - ["config/database.yml"]. What have I missed?
[09:12:47] railsForDaiz: has joined #RubyOnRails
[09:14:24] BhavyaM: has joined #RubyOnRails
[09:15:28] mdw: has joined #RubyOnRails
[09:16:53] MiracleBlue__: has joined #RubyOnRails
[09:16:53] jhill_: has joined #RubyOnRails
[09:17:03] ziyadb: has joined #RubyOnRails
[09:17:05] Atrox: has joined #RubyOnRails
[09:17:08] herpless: has joined #RubyOnRails
[09:20:22] JohnBat26: has joined #RubyOnRails
[09:25:58] FastJack_: has joined #RubyOnRails
[09:26:21] techsethi: has joined #RubyOnRails
[09:28:33] manveru_: has joined #RubyOnRails
[09:29:00] defsdoor: has joined #RubyOnRails
[09:29:43] FooBarWidget: has joined #RubyOnRails
[09:30:03] Somnius: has joined #RubyOnRails
[09:30:24] Lloyd: has joined #RubyOnRails
[09:32:33] dionysus70: has joined #RubyOnRails
[09:33:04] alphaatom: has joined #RubyOnRails
[09:34:09] maesitos: has joined #RubyOnRails
[09:34:39] TheMoonMaster: has joined #RubyOnRails
[09:34:40] FastJack_: has left #RubyOnRails: ()
[09:34:47] sandstrom: has joined #RubyOnRails
[09:35:49] drptbl: has joined #RubyOnRails
[09:36:14] mikecmpbll: has joined #RubyOnRails
[09:36:23] tjbiddle: has joined #RubyOnRails
[09:36:52] FastJack: has joined #RubyOnRails
[09:41:29] pawnbox: has joined #RubyOnRails
[09:42:44] axilaris: has joined #RubyOnRails
[09:42:54] DEA7TH: has joined #RubyOnRails
[09:44:18] drptbl_: has joined #RubyOnRails
[09:45:53] axilaris: hi guys, can someone help me with subquery with rails ? https://gist.github.com/anonymous/71fcc6db6f90d6e584e3
[09:46:02] axilaris: in here im using postgis
[09:46:12] axilaris: but maybe ignore the postgis stuff
[09:46:34] axilaris: i have managed to order the query correctly as seen in the last result
[09:46:54] artto: has joined #RubyOnRails
[09:47:09] axilaris: now im trying to do a subquery of the ordered result by (grouping city and count)
[09:47:36] axilaris: however, the order of the result is no more correct. the city that comes out first is not in the first order
[09:50:01] matthewd: axilaris: That's how SQL works; subqueries are unordered
[09:50:14] smoitra: has joined #RubyOnRails
[09:50:19] axilaris: is there a way i can make it work somehow ?
[09:50:40] matthewd: You need to put the order on the outer query
[09:50:42] axilaris: i want to grab all the cities in the ordered list
[09:50:53] axilaris: and group and count
[09:51:51] srinidhi: has joined #RubyOnRails
[09:52:35] matthewd: I don't think I understand the high level idea of what the query's trying to find
[09:52:40] axilaris: ok, need to think abit, some hint would be nice :)
[09:52:56] matthewd: I might do better if the name of the scope was more descriptive than "mygroupcountsubquery"
[09:53:10] blackmesa: has joined #RubyOnRails
[09:53:27] axilaris: so far i only manage the ordering... just from there i dont know how to get to the next part
[09:53:50] axilaris: subquery was the closest but like u said no ordering
[09:54:09] yfeldblum: has joined #RubyOnRails
[09:54:10] matthewd: What is it actually finding?
[09:55:19] matthewd: Cities, with a count of contained treasures, ordered by the distance to a contained treasure from a fixed point.. maybe?
[09:56:16] axilaris: matthewd: nearest cities
[09:56:48] axilaris: so using postgis, ived ordered by distance the treasure closest to coordinates
[09:57:03] pjammer: has joined #RubyOnRails
[09:57:12] axilaris: some of these treasures are further in different cities
[09:57:41] axilaris: i want to group these treasures in these different cities and just count the number of treasures in these cities
[09:58:00] axilaris: but then, i want the closest city to come up first followed by the next closest
[09:58:11] axilaris: and the moment the cities are not ordered
[09:58:13] quazimodo: I need to hire an IOS dev
[10:00:50] blackmesa: has joined #RubyOnRails
[10:01:44] matthewd: axilaris: So, as you need the order on the outer query, it needs to be written from that perspective
[10:02:30] matthewd: axilaris: .order("min(st_distance(..))"), perhaps?
[10:03:21] trinaldi: has joined #RubyOnRails
[10:05:23] axilaris: whats min ?
[10:09:25] BradenBraden: i have removed everything except for the bare bones app but still get "Could not load database configuration. No such file - ["config/database.yml"]". Cant find any other reference to active record so dont know why it is loading up.
[10:10:41] marr: has joined #RubyOnRails
[10:12:37] arBmind: has joined #RubyOnRails
[10:13:35] ElFerna_: has joined #RubyOnRails
[10:15:13] arup_r: has joined #RubyOnRails
[10:15:15] BradenBraden: stack trace. what other info would be helpful? https://gist.github.com/brazenbraden/d592602dd40dbb65f63f
[10:15:19] marr: has joined #RubyOnRails
[10:17:25] nocontrol: has joined #RubyOnRails
[10:18:03] BradenBraden: added application.rb and unicorn.rb
[10:18:18] universa1: BradenBraden: rails new my_app -O -- do that and compare it with your application.
[10:18:25] universa1: BradenBraden: http://stackoverflow.com/questions/19078044/disable-activerecord-for-rails-4
[10:19:35] FooMunki: has joined #RubyOnRails
[10:20:29] Devalo: has joined #RubyOnRails
[10:20:31] kp666: has joined #RubyOnRails
[10:21:53] mdw: has joined #RubyOnRails
[10:22:00] BradenBraden: universa1, doing it now. converted over a different app a couple days ago and all went fine. been using that one as a reference and as far as i can tell, done everything I did there (although the current app is much larger with a whole host of extra gems)
[10:22:49] universa1: BradenBraden: maybe some gem depends on activerecord
[10:23:04] BradenBraden: universa1, thats what im thinking
[10:23:24] universa1: BradenBraden: Gemfile.lock -> search for active record ;)
[10:23:55] BradenBraden: universa1, just the rails gem
[10:24:20] matthewd: BradenBraden: If you don't want AR loaded, you shouldn't use the rails gem
[10:27:37] smoitra: has joined #RubyOnRails
[10:27:41] BradenBraden: if you dont include the rails gem, you dont get any of the other active_**s, plus, generating a new app with rails new app -0 includes the rails gem in the gemfile so yea, it should be there
[10:27:48] arup_r: Any method in Rails which can tell me the previous value of a ActiveRecord object after calling update on it ?
[10:28:09] universa1: before = instance.attribute; instance.update
[10:30:29] arup_r: There was a direct method which holds it, but I am not able to recall it..
[10:32:28] Kendos-Kenlen: has joined #RubyOnRails
[10:32:53] matthewd: BradenBraden: Oh, so it does
[10:33:14] pawnbox: has joined #RubyOnRails
[10:33:36] matthewd: BradenBraden: Still, breaking out the individual gems should at least tell you what's trying to load it
[10:34:29] matthewd: arup_r: previous_changes
[10:34:32] maesitos: has joined #RubyOnRails
[10:34:46] BradenBraden: matthewd, sure, but even if the gem is installed, it should matter if it is not required in the project, so by disabling 'require "active_record"', it should be loaded.
[10:38:09] arup_r: matthewd: yeah.. that one
[10:39:59] arup_r: matthewd: I tried like e = Entry.first; e.update(status: :released) ; e.status_changed? # gives nil .. why so?
[10:40:35] ldnunes: has joined #RubyOnRails
[10:40:42] arup_r: but `previous_changes` is working.. no idea why *_changed? didn't work
[10:41:08] rhizome: foo.changed? will list the fields changed
[10:41:16] matthewd: arup_r: *_changed? returns whether the attribute is currently changed (i.e., has something to be saved)
[10:42:40] arup_r: ok, after save there is not direct method to inspect the attribute value? just asking. If not I will work around it with `previous_changes` ofcourse..
[10:43:33] srinidhi: has joined #RubyOnRails
[10:47:42] Detch: has joined #RubyOnRails
[10:48:58] smoitra: has joined #RubyOnRails
[10:51:17] johnflux: has joined #RubyOnRails
[10:51:17] johnflux: has joined #RubyOnRails
[10:54:38] rikkipitt: has joined #RubyOnRails
[10:55:18] artto: has joined #RubyOnRails
[10:56:21] rikkipitt: bit of a random question. Say I want users to be able to set up git versioned projects within an app, is this possible? does anyone here know of a way of allowing users to git push to mini projects but administrate it all in a rails app?
[10:56:52] mark4: has joined #RubyOnRails
[10:57:34] universa1: rikkipitt: gitlab?
[10:58:06] rikkipitt: universa1: i was thinking that, just wondering if there was a way to use a git gem to accomplish something similar...
[10:58:56] solars: hi, is it possible to distinguish between an updated and new object in an aftersave callback?
[11:00:21] rubyonrails694: has joined #RubyOnRails
[11:00:27] universa1: rikkipitt: sure, they can do it, it is open source, look how they do it and adopt what you need... there is also the "git" gem iirc
[11:00:31] rvanlieshout: use an after_update or after_create callback solars
[11:00:39] universa1: solars: updated_at == created_at
[11:01:22] solars: rvanlieshout, thanks a lot
[11:01:28] solars: universa1, I assume that after_update does just that
[11:01:32] solars: or something similar :)
[11:02:11] universa1: solars: don't assume... look at the code ;)
[11:02:27] solars: I'm writing the test at the moment just to be sure :)
[11:02:43] rikkipitt: universa1: cheers, i've just got an interesting idea i'd like to try out
[11:02:46] solars: after_create is not only called on .create but also on .new + .save right?
[11:03:03] arup_r: I m not able to render a view while doing remote form submission. Getting error https://gist.github.com/aruprakshit/8a2246a77a0cd6db7848 .. what is wrong in my code ?
[11:04:29] universa1: solars: try? ;)
[11:04:59] universa1: arup_r: https://gist.github.com/aruprakshit/8a2246a77a0cd6db7848#file-log-txt-L7
[11:05:40] universa1: https://gist.github.com/aruprakshit/8a2246a77a0cd6db7848#file-log-txt-L2
[11:08:14] pawnbox: has joined #RubyOnRails
[11:09:23] gregf_: has left #RubyOnRails: ()
[11:10:43] gregf__: has joined #RubyOnRails
[11:12:08] Technodrome: has joined #RubyOnRails
[11:12:53] rubyonrails581: has joined #RubyOnRails
[11:15:00] baweaver: has joined #RubyOnRails
[11:17:37] cajone: has joined #RubyOnRails
[11:18:06] jsrn_: has joined #RubyOnRails
[11:29:43] dtordable: has joined #RubyOnRails
[11:30:57] Ropeney: has joined #RubyOnRails
[11:36:08] Spami: has joined #RubyOnRails
[11:42:52] Spami: has joined #RubyOnRails
[11:43:42] SteenJobs: has joined #RubyOnRails
[11:43:44] cassioscabral: has joined #RubyOnRails
[11:44:57] Pazician_: has joined #RubyOnRails
[11:46:46] rikkipitt: has joined #RubyOnRails
[11:47:10] oded_: has joined #RubyOnRails
[11:49:04] Cervajz: has joined #RubyOnRails
[11:49:24] tetraktys: has joined #RubyOnRails
[11:52:14] arup_r: universa1: thanks. So now no error. I see in browser network console that view got rendered, but in the browser web page no change.. I had to refresh the page to see the change.. https://gist.github.com/aruprakshit/8a2246a77a0cd6db7848
[11:52:20] arup_r: What else I am missing
[11:54:57] pawnbox_: has joined #RubyOnRails
[12:02:17] Surt_Q: has joined #RubyOnRails
[12:02:31] pawnbox: has joined #RubyOnRails
[12:03:33] jottr: has joined #RubyOnRails
[12:07:28] ewnd9_: has joined #RubyOnRails
[12:07:48] maesitos_: has joined #RubyOnRails
[12:08:25] ElFerna_: has joined #RubyOnRails
[12:11:52] arup_r: any help please..? I have no clue..
[12:12:56] riotjones: has joined #RubyOnRails
[12:16:24] ddv: arup_r: what is the problem again?
[12:18:09] smoitra: has joined #RubyOnRails
[12:18:19] deur-: arup_r: my guess is you don't have JS code that replaces the render output to a div of your choice
[12:18:23] arup_r: ddv: I an rendering the a view when as a response of Ajax form submission. But in the browser, not seeing the change after the update. But, in browser devtool network tab I see the correct HTML as a responhttps://gist.github.com/aruprakshit/8a2246a77a0cd6db7848se rendered. But that is not refreshing the browser dom.
[12:19:13] khairahman: has joined #RubyOnRails
[12:19:51] chouhoulis: has joined #RubyOnRails
[12:19:54] ddv: arup_r: try adding .json or .js to the url if you are checking manually in a browser
[12:19:56] arup_r: deur-: ok, so https://gist.github.com/aruprakshit/8a2246a77a0cd6db7848#file-entries_controller-rb-L12 doesn't add the content inside the body automatically ?
[12:20:43] deur-: not afaik :) you need a .js.erb file to do that for you
[12:20:46] deur-: arup_r: http://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html#server-side-concerns
[12:21:47] arup_r: ddv: No, I am submitting the form as a remote form.. and it is coming to the controller update action.. and once update is done. response as an HTML is being rendered, just not refreshing the page..
[12:21:59] techsethi: has joined #RubyOnRails
[12:22:04] arup_r: deur-: I know that.. some SO answers shows this trick..
[12:22:59] Devalo: has joined #RubyOnRails
[12:23:17] jyraff: has joined #RubyOnRails
[12:23:31] deur-: arup_r: well yeah, my guess is that's why you don't see any content. the render file does not add the content inside the body automatically as far as i know.
[12:23:44] deur-: *s/render file/render call
[12:24:39] universa1: yes. as the others have pointed out you need to either have a client-side js which takes the response or have a js.erb file on the server which does the replacing.
[12:25:36] hcnewsom: has joined #RubyOnRails
[12:30:06] KorriX: Hello! I'm fighting a strange issue. I do a json post request containing parameters {a: 1, b: 2, c: 3, d: 4}. When I'm looking into raw params variable [no strong parameters] I see: {a: 1, b: 2, c: 3, d: 4, mymodel: {a: 1, b: 2}} what might be the reason?
[12:30:27] EdwardIII: heh whenver i google about actioncable to see an example, all i find are screencasts and stuff like "This won't be a tutorial or a how-to article - instead, we're going to get into the why of Action Cable, not the how."
[12:30:51] KorriX: How rails is parsing such a request? I'd like to have all four params inside mymodel key, or not have it at all
[12:31:05] jyraff_: has joined #RubyOnRails
[12:31:50] defsdoor: KorriX, gist your json and your logs
[12:31:53] arup_r: hmm. thanks.. what you people said made sense..
[12:31:53] universa1: KorriX: how are you sending the json request? actual request.
[12:32:27] matthewd: KorriX: http://api.rubyonrails.org/classes/ActionController/ParamsWrapper.html
[12:32:48] universa1: EdwardIII: there is an example app on github iirc
[12:33:01] universa1: EdwardIII: https://github.com/rails/actioncable-examples
[12:33:31] EdwardIII: universa1: this one looks pretty good actually: https://www.zweitag.de/en/blog/technology/lets-build-a-chat-with-actioncable
[12:33:49] Spami: has joined #RubyOnRails
[12:34:26] arup_r: EdwardIII: Yeah, I need many such blogs to learn ActionCable ... It is so new too me..
[12:34:29] EdwardIII: looks interesting. i've done a few trivial things with websockets before with sockjs/tornado/django, it was awesome
[12:34:42] matthewd: EdwardIII: http://jargon.io/joeyschoblaska/rails-5-chess-with-action-cable-websockets
[12:34:49] KorriX: <matthewd>: Thank you.
[12:34:50] EdwardIII: and it was shockingly easy to get something prototype-worthy up and going
[12:35:36] EdwardIII: cables looks pretty neat, i'll have to have a more in-depth play
[12:37:30] AlexJakeGreen: has joined #RubyOnRails
[12:39:11] pawnbox: has joined #RubyOnRails
[12:40:07] tetraktys: has joined #RubyOnRails
[12:41:15] stannard: has joined #RubyOnRails
[12:41:26] dextertzu: has joined #RubyOnRails
[12:46:28] sebbarg: has joined #RubyOnRails
[12:46:29] rgtk: has joined #RubyOnRails
[12:46:43] artto: has joined #RubyOnRails
[12:47:01] chipotle: how is the ruby support with google?
[12:47:25] aganov: has joined #RubyOnRails
[12:47:29] chipotle: i think the only way to run ruby is to use their VPS like product and install RoR myself? whereas other languageshave suport in their heroku type offering
[12:47:45] chipotle: universa1: trying to decide on a webhost. i have used digital ocaen and linode in the past but want to learn "the cloud"
[12:48:00] universa1: chipotle: https://cloud.google.com/ruby/
[12:48:55] eyck: has joined #RubyOnRails
[12:48:59] null__: heroku is in the cloud
[12:49:14] ddv: I doubt that.
[12:50:29] rvanlieshout: heroku is cloud hosting indeed
[12:51:46] pawnbox: has joined #RubyOnRails
[12:55:40] kmckelvi1: has joined #RubyOnRails
[12:58:26] blackmesa: has joined #RubyOnRails
[12:59:18] pawnbox: has joined #RubyOnRails
[12:59:26] quazimodo: has joined #RubyOnRails
[13:00:11] openstruct: has joined #RubyOnRails
[13:00:24] EdwardIII: heh not sure there's much to learn about heroku is there?
[13:00:36] rvanlieshout: there is lot to learn if you want
[13:00:39] EdwardIII: git push heroku master && cowsay "take the rest of the day off"
[13:00:50] rvanlieshout: i just don't use it and don't like that part of it
[13:00:52] renanoronfle: has joined #RubyOnRails
[13:00:53] rvanlieshout: or it's IO performance
[13:01:39] ddv: it's way overpriced
[13:02:01] EdwardIII: it is very expensive
[13:02:08] EdwardIII: but you're getting a lot for your money, right?
[13:02:16] EdwardIII: think about how much you charge per hour for your devops stuff
[13:02:24] unl0ckd: has joined #RubyOnRails
[13:02:38] rvanlieshout: you'll get a poor IO performance for it
[13:02:52] EdwardIII: i've seen complaints about IO for aws/ebs/ec2 too though
[13:03:13] rvanlieshout: cause their io performance is poor
[13:03:29] krz: has joined #RubyOnRails
[13:03:38] bronson: has joined #RubyOnRails
[13:03:40] EdwardIII: slow io is slow
[13:04:04] ddv: I recommend bluerail.nl
[13:04:07] matthewd: *cough* openshift *cough*
[13:04:20] hardtail: has joined #RubyOnRails
[13:04:34] Kendos-Kenlen: has joined #RubyOnRails
[13:04:37] hardtail: has joined #RubyOnRails
[13:04:42] ddv: matthewd: stop advertising :p
[13:05:46] adaedra: ddv: but it's all writting in foreign!
[13:05:57] ddv: adaedra: lol
[13:07:25] deur-: 10 euro / month is fairly cheap though, even for virtual hosting
[13:08:23] ddv: are you Dutch, deur-?
[13:08:35] ddv: deur means door in Dutch
[13:08:58] deur-: there's a long, complicated and uninteresting story attached to it
[13:09:06] adaedra: Flemish part, I get
[13:10:20] AntiSpamMeta: has joined #RubyOnRails
[13:11:37] godzillaenlacasa: has joined #RubyOnRails
[13:12:01] syath: has joined #RubyOnRails
[13:13:20] sandstrom: has joined #RubyOnRails
[13:13:31] EdwardIII: i'm in amsterdam frequently for work
[13:13:33] silverdust: I have a uploads table where I place files from different other models. It uses its Upload model. I didn't foresee the problem with this. I'd set a role field to specify the type of model whose file is in an upload
[13:13:44] chipotle: EdwardIII: yes i like amsterdam
[13:13:48] chipotle: i was thinking of living there
[13:13:54] EdwardIII: i'd live there
[13:14:00] EdwardIII: seems insanely expensive though, like london
[13:14:54] silverdust: Upload model has role, parent_id. If parent_id for modelA is 8 and parent_id for modelB is 8. Deleting for modelB may delete modelA's upload
[13:14:57] deur-: appartments surely aren't as expensive as in London, i reckon
[13:16:02] silverdust: When I fetch the uploaded image for ModelB with ModelB.uploads.first.image if a ModelA upload has the same parent_id I get the image for that instead
[13:16:21] silverdust: How can I fix this?
[13:16:34] matthewd: silverdust: So, it sounds like you've invented a broken version of a polymorphic belongs_to association
[13:16:51] EdwardIII: yeah ok probably not *as* expensive heh
[13:16:52] deur-: silverdust: gist your model class please, i'm guessing there's a foreign key mismatch in your relations
[13:17:10] matthewd: silverdust: But my first question is going to have to be: why do you have a single shared Upload model?
[13:17:35] matthewd: silverdust: I understand it might be too late to revisit atm, but if it's not, I'd certainly start there.
[13:17:50] silverdust: because the validation is the same for all and I think it'll be DRY to do handle it all in one place
[13:18:13] silverdust: * to handle it all in one place
[13:20:25] sandstrom: has joined #RubyOnRails
[13:21:03] chouhoulis: has joined #RubyOnRails
[13:21:36] silverdust: I created the gist here https://gist.github.com/bl4ckdu5t/923a13ac2770eeed73b3 with all needed details
[13:23:04] deur-: silverdust: what you need here is a polymorphic relation instead of has_many relations
[13:23:28] silverdust: can I fix that without tampering with data in them?
[13:23:50] deur-: nope, you'll need an additional column that stores the linked model
[13:23:50] silverdust: I already have a production version with live content before I realized this on development
[13:23:53] mdw: has joined #RubyOnRails
[13:24:00] deur-: *the linked model class name
[13:24:18] silverdust: but with a new migration the existing data remains intact
[13:25:18] deur-: silverdust: http://guides.rubyonrails.org/association_basics.html#polymorphic-associations
[13:25:37] goodcodeguy: has joined #RubyOnRails
[13:26:05] deur-: silverdust: so applied to your situation, you'd have the uploads table with both "uploadable_type" and an "uploadable_id" column
[13:26:55] deur-: and in your Upload class, have "belongs_to :uploadable, polymorphic: true"
[13:27:18] deur-: in all other classes you'll use "has_many :uploads, as: :uploadable"
[13:28:19] silverdust: okay then I hae to rename_column parent_id to uploadable_id
[13:28:39] silverdust: and create a new uploadable_type . What goes in uploadable_type ?
[13:28:57] silverdust: I believe it's what I'm presently storing in role
[13:29:06] rvanlieshout: ddv: do you have hosting @ bluerail.nl?
[13:29:11] silverdust: e.g product for products
[13:29:14] deur-: the linked model class name, so in your case Collection, Product etc,..
[13:29:20] deur-: silverdust: oh right, I forgot you have that table
[13:29:20] silverdust: collection for collections
[13:29:22] rvanlieshout: (late response.. phone)
[13:29:26] mist: has joined #RubyOnRails
[13:29:36] ddv: rvanlieshout: nope
[13:29:41] deur-: silverdust: then you won't need to do any data migration, just rename the table columns and set the association to be polymorphic
[13:29:55] deur-: and you should be good to go
[13:30:10] oumanef: has joined #RubyOnRails
[13:30:38] deur-: as to why it doesn't work now; it's a foreign key mismatch, because it's not scoping the association to the role column anywhere
[13:31:18] deur-: so the app deletes everything matching the parent_id without referencing the role column
[13:32:20] silverdust: yes I see. I'm glad I'm getting to use polymorphic relationships. I'd always wanted to understand it and STI
[13:32:55] deur-: they're great to decouple stuff when combined with concerns
[13:33:31] silverdust: Can STI be a susbstitute for this?
[13:34:04] askhat: has joined #RubyOnRails
[13:35:03] silverdust: Is it okay to still have my dependent destroy with it this way has_many :uploads, as: :uploadable, dependent: :destroy
[13:35:08] dexter_: has joined #RubyOnRails
[13:35:15] deur-: silverdust: not sure what STI means i'm afraid :)
[13:35:23] deur-: silverdust: sure, would still work
[13:35:28] silverdust: Single Table Inheritance
[13:36:14] silverdust: I get to read things that are beyond my knowledge so I'd long read about Polymorphic associations and STI and making decisions on which to choose but it was all greek to me at the time
[13:36:26] ddv: it's a pretty simple concept
[13:36:26] oumanef: has left #RubyOnRails: ()
[13:36:39] oumanef: has joined #RubyOnRails
[13:37:16] deur-: silverdust: ooh right. I think they're the same thing, no?
[13:37:26] deur-: you use a type column to identify the relation
[13:38:26] blackmesa: has joined #RubyOnRails
[13:39:47] silverdust: you mean STI uses just type rather than sth like imageable_type
[13:40:09] askhat_: has joined #RubyOnRails
[13:40:37] deur-: ah yes, probably
[13:40:52] deur-: so you can have stuff like `class Volvo < Car` etc
[13:41:18] deur-: and Car on its own inherits from ActiveRecord::Base
[13:41:43] deur-: i believe it's there in rails, but tbh i've never used it :x
[13:41:47] silverdust: okay I see. Now that I have an idea I can go back to read more about them
[13:42:12] deur-: http://api.rubyonrails.org/classes/ActiveRecord/Inheritance.html
[13:42:13] deur-: there we go
[13:42:58] tjbiddle: has joined #RubyOnRails
[13:44:30] DEA7TH: has joined #RubyOnRails
[13:44:45] matthias_: has joined #RubyOnRails
[13:47:31] _Tariq: has joined #RubyOnRails
[13:47:51] jsrn__: has joined #RubyOnRails
[13:47:52] mist: has left #RubyOnRails: ()
[13:51:29] arup_r: has joined #RubyOnRails
[13:53:15] artto: has joined #RubyOnRails
[13:58:16] M-shine: has joined #RubyOnRails
[14:02:14] kenpoint: has joined #RubyOnRails
[14:03:25] joshkovach: has joined #RubyOnRails
[14:03:38] lacrymology: has joined #RubyOnRails
[14:05:00] msyvich: has joined #RubyOnRails
[14:07:35] ziyadb: has joined #RubyOnRails
[14:09:39] goodcodeguy: has joined #RubyOnRails
[14:11:03] silverdust: when changing a column that has an index does the index change?
[14:11:38] rvanlieshout: silverdust: that's up for your db engine to do so
[14:12:00] silverdust: so I don't have to bother about that on a psql db
[14:13:20] Kendos-Kenlen: has joined #RubyOnRails
[14:14:04] curtis3000: has joined #RubyOnRails
[14:15:31] Ousmane: has joined #RubyOnRails
[14:18:08] tetraktys: has joined #RubyOnRails
[14:18:19] railsFor_: has joined #RubyOnRails
[14:19:53] maesitos: has joined #RubyOnRails
[14:21:03] bob_f: Hi, I'm using the `exception_notification` gem but I'm finding that the email notifications I'm getting aren't filtering GET params, despite them being in my `Application.filter_parameters`. They params are filtered in some places in the notification mail, but e.g. the URL given displays the params, as well as various places in the environment it dumps.
[14:21:14] bob_f: Is it possible to fully filter these ?
[14:21:16] sankaber: has joined #RubyOnRails
[14:21:42] matthewd: bob_f: If they're filter-worthy, you probably shouldn't be putting them in the URL in the first place
[14:21:51] MiracleBlue___: has joined #RubyOnRails
[14:22:04] lipoqil: has joined #RubyOnRails
[14:22:48] bob_f: matthewd: It's an authentication token, in this case. We compromised a little, but our preference would be to allow them to be visible in the address bar, but not email them around every time an error happens.
[14:23:04] chouhoulis: has joined #RubyOnRails
[14:23:14] matthias_: has joined #RubyOnRails
[14:23:23] jhill__: has joined #RubyOnRails
[14:23:26] PedramT: has joined #RubyOnRails
[14:23:31] ilhami_: has joined #RubyOnRails
[14:23:36] AzaToth_: has joined #RubyOnRails
[14:23:43] universa1: bob_f: the url is before params, so you'd have to manually filter those
[14:23:45] rvanlieshout: bob_f: what's wrong with having them visible in the mail
[14:23:45] hfp_: has joined #RubyOnRails
[14:24:19] Devalo: has joined #RubyOnRails
[14:24:28] mja: has joined #RubyOnRails
[14:24:28] norc: has joined #RubyOnRails
[14:24:44] bob_f: rvanlieshout: If I get an error email, I often need to forward it on to another team, so I'd like to avoid unnecessarily passing auth tokens on to teams that don't need knowledge of them.
[14:24:50] worknick: has joined #RubyOnRails
[14:24:53] mja: hi guys! It is able to return more than one result using distinct in rails?
[14:24:59] y2mq37: has joined #RubyOnRails
[14:25:19] rvanlieshout: bob_f: but if somebody is able to click a link it's in there
[14:25:38] matthewd: bob_f: The in-the-URL problem isn't just that it's visible in the browser: your web server / proxies are going to be logging it pretty freely too, without special efforts (and so's the browser, of course)
[14:25:41] bob_f: rvanlieshout: Sure, but each team has their own login - the API supports both token and BasicAuth.
[14:25:55] rvanlieshout: true, but hiding it doesn't mean it's not in there when they forward it
[14:26:01] bob_f: matthewd: Yeah, nginx logs the token too, but access to those logs is more restricted.
[14:26:38] Denarii: has joined #RubyOnRails
[14:26:46] bob_f: I understand it's not ideal to do it this way but we took the decision a long time ago, in order to make getting up and running with the API quick and easy for our clients, and now we have dozens of clients all using this endpoint.
[14:26:49] universa1: bob_f: it shouldn't be too hard to extend excpetion_notification and add some filtering on url and the other parts, too ;)
[14:26:58] jhass: mja: I'd expect (and think to remember) it to just do that if there's actually more than one distinct result
[14:27:26] mja: well, it returns only one
[14:27:35] bob_f: universa1: Yeah, I'm looking at the views now and it will be quite straightforward to just dump them into my application and sanitise the output, was just wondering if there was something more low-level in Rails I could do.
[14:27:36] algernop_k: has joined #RubyOnRails
[14:27:54] waldi_: has joined #RubyOnRails
[14:28:00] universa1: bob_f: not that i know off, but i don't know much ;)
[14:28:04] mja: if I exec something like, let's say, Model.where(:name = somename).distinct
[14:28:05] jhass: mja: then you most likely don't have more than one unique result
[14:28:07] mja: it return only one
[14:28:11] bob_f: universa1: The trouble is that it's not only the URL - various environment variables contain segments of the URL, as well as Rack environment variables containing just `token=blahblah`
[14:28:27] bob_f: So it's not a case of just parsing and re-building the URL - it's going to have to be a bit of a hatchet job.
[14:29:14] rails690: has joined #RubyOnRails
[14:29:25] universa1: bob_f: the env dump should also be possible to fix, you know the auth-token from the url, a gsub in the end with the auth-token and replace it with XXXXXXX might do the trick
[14:29:30] M-shine: has joined #RubyOnRails
[14:29:42] bob_f: universa1: Yeah, that's exactly what I'm going to do, it just feels nasty. :)
[14:30:09] toydestroyer: has joined #RubyOnRails
[14:30:47] bob_f: If there's a post-processing hook for the email notifier itself, that'd save having to dump the views into my applicatino.
[14:30:49] matthewd: bob_f: Cheat? :)
[14:31:03] rubyonrailed: has joined #RubyOnRails
[14:31:18] matthewd: Make the original URL shove the token in the session, then redirect to the "actual" thing
[14:31:35] rails690: im trying to use jruby on rails, however during bundle install it says Installing binding_of_caller 0.7.2 with native extensions and it FAILS. This is a known issue, my question is which Gem uses binding_of_caller??? I dont want to install it but I don't know how to stop bundle from trying to
[14:31:42] matthewd: Redirect action is simple -> no errors there; errors in the real one -> no secrets in the URL
[14:32:19] bob_f: matthewd: Hah, and if there's an exception raised in my hackery ? ;)
[14:32:42] bob_f: I'll go with post-processing the email notification itself - would rather avoid putting kludge into the main code path.
[14:34:58] barhum2013: has joined #RubyOnRails
[14:35:57] trinaldi: has joined #RubyOnRails
[14:37:17] tfitts: has joined #RubyOnRails
[14:38:11] bob_f: Looks like an ActionMailer interceptor will do the trick.
[14:39:41] blackmesa: has joined #RubyOnRails
[14:40:30] railsForDaiz: has joined #RubyOnRails
[14:42:03] Ousmane: has joined #RubyOnRails
[14:42:30] Ergo^: has joined #RubyOnRails
[14:45:07] rails690: i dont know how to skip the installation of binding_of_caller gem
[14:45:15] rails690: in bundle install using jruby-
[14:48:41] roshanavand: has joined #RubyOnRails
[14:49:09] msyvich: has joined #RubyOnRails
[14:49:25] sergey_makagon: has joined #RubyOnRails
[14:50:27] rubyonrailed: has joined #RubyOnRails
[14:51:01] hcnewsom: has joined #RubyOnRails
[14:51:12] gregf_: has joined #RubyOnRails
[14:53:31] moeabdol: has joined #RubyOnRails
[14:54:24] Sylario: has joined #RubyOnRails
[14:55:18] Technodrome: has joined #RubyOnRails
[14:55:51] matthias_: has joined #RubyOnRails
[14:56:57] RegulationD: has joined #RubyOnRails
[14:58:41] moeabdol1: has joined #RubyOnRails
[15:00:39] Terens: has joined #RubyOnRails
[15:00:49] Terens: Hello. How can I use semantic-ui with rails without pain ?
[15:01:38] pawnbox: has joined #RubyOnRails
[15:02:46] jhass: https://github.com/doabit/semantic-ui-sass looks like the most popular gem
[15:03:43] Terens: i hope its not out of date
[15:06:32] goodcodeguy: has joined #RubyOnRails
[15:07:18] nfk: has joined #RubyOnRails
[15:07:37] sinkensabe: has joined #RubyOnRails
[15:08:12] polishdub: has joined #RubyOnRails
[15:09:22] B1n4r10: has joined #RubyOnRails
[15:10:23] Frem: has joined #RubyOnRails
[15:13:54] msyvich: has joined #RubyOnRails
[15:17:22] dopamean1: has joined #RubyOnRails
[15:17:52] jcm: hi, since my rails site is in https, I've been reported browser errors with alert regarding HTTP Strict Transport Security (HSTS)
[15:21:51] universa1: jcm: so? you enabled hsts in your webservers configuration?
[15:22:14] adavia: has joined #RubyOnRails
[15:22:43] jottr: has joined #RubyOnRails
[15:23:49] chouhoulis: has joined #RubyOnRails
[15:24:29] targaf_: has joined #RubyOnRails
[15:24:54] thejoecarroll_: has joined #RubyOnRails
[15:24:58] roshanavand: has joined #RubyOnRails
[15:25:28] havenn: has joined #RubyOnRails
[15:25:28] havenn: has joined #RubyOnRails
[15:25:32] icedp: has joined #RubyOnRails
[15:25:51] hfp: has joined #RubyOnRails
[15:25:53] fmcgeough: has joined #RubyOnRails
[15:25:54] JoshL: has joined #RubyOnRails
[15:25:54] Junaos: has joined #RubyOnRails
[15:26:10] aegis3121: has joined #RubyOnRails
[15:27:48] sonOfRa: has joined #RubyOnRails
[15:28:52] tomaw: has joined #RubyOnRails
[15:31:11] matthias_: has joined #RubyOnRails
[15:31:43] drbayer: has joined #RubyOnRails
[15:33:28] underplank: has joined #RubyOnRails
[15:33:29] ql6wlld: has joined #RubyOnRails
[15:35:08] mary5030: has joined #RubyOnRails
[15:36:49] mary5030: has joined #RubyOnRails
[15:38:24] dexter_: has joined #RubyOnRails
[15:39:36] nettoweb: has joined #RubyOnRails
[15:42:05] enitiz: has joined #RubyOnRails
[15:42:45] Conflict: has joined #RubyOnRails
[15:48:03] ElFerna_: has joined #RubyOnRails
[15:51:13] rubyonrailed: has joined #RubyOnRails
[15:54:57] speaking1ode: has left #RubyOnRails: ()
[15:55:09] speakingcode: has joined #RubyOnRails
[15:58:28] Terens: hello could anyone help me with
[15:58:56] Terens: this https://github.com/Semantic-Org/Semantic-UI-Rails-LESS ?
[16:00:51] [Butch]: has joined #RubyOnRails
[16:03:01] jottr: has joined #RubyOnRails
[16:09:12] dionysus69: has joined #RubyOnRails
[16:10:03] macsteps: has joined #RubyOnRails
[16:10:46] bronson: has joined #RubyOnRails
[16:13:19] Technodrome: has joined #RubyOnRails
[16:17:27] Jasaka: has joined #RubyOnRails
[16:17:38] underplank: has joined #RubyOnRails
[16:17:44] rubyonrailed: has joined #RubyOnRails
[16:18:20] jhass: hard to tell, given you stated no issue so far
[16:24:53] DmitryBochkarev: has joined #RubyOnRails
[16:25:13] zworks: has joined #RubyOnRails
[16:25:19] franzip: has joined #RubyOnRails
[16:25:31] msyvich: has joined #RubyOnRails
[16:25:52] Devalo: has joined #RubyOnRails
[16:28:24] jscheel: has joined #RubyOnRails
[16:29:09] chouhoulis: has joined #RubyOnRails
[16:31:18] kirillzh: has joined #RubyOnRails
[16:31:47] aganov: has joined #RubyOnRails
[16:33:28] dionysus69: has joined #RubyOnRails
[16:36:56] kmckelvin: has joined #RubyOnRails
[16:39:09] AnomalousBit: has joined #RubyOnRails
[16:41:55] RegulationD: has joined #RubyOnRails
[16:46:41] ElFerna_: has joined #RubyOnRails
[16:47:30] KensoDev: has joined #RubyOnRails
[16:47:45] disgrntld: has joined #RubyOnRails
[16:48:44] KitsuneDrag0n: has joined #RubyOnRails
[16:48:54] korzybski: has joined #RubyOnRails
[16:49:45] tetraktys: has joined #RubyOnRails
[16:50:35] Contigi: has joined #RubyOnRails
[16:54:08] drbayer: has joined #RubyOnRails
[16:54:18] blackmesa: has joined #RubyOnRails
[16:55:08] eljimmy: has joined #RubyOnRails
[16:57:05] netzfisch: has joined #RubyOnRails
[16:58:42] sonofdirt: has joined #RubyOnRails
[16:59:54] Terens: Why not someone use bootstap plain and use sass ?
[17:00:22] benlieb: has joined #RubyOnRails
[17:01:14] sandstrom: has joined #RubyOnRails
[17:01:39] qejk: has joined #RubyOnRails
[17:04:01] Synthead: where do I put favicons? they go in /app/assets somewhere, I presume?
[17:04:08] neanderslob_: has joined #RubyOnRails
[17:04:50] intrigueD: has joined #RubyOnRails
[17:04:50] intrigueD: has joined #RubyOnRails
[17:05:00] KensoDev: has joined #RubyOnRails
[17:06:36] macsteps: has joined #RubyOnRails
[17:06:39] gingray: has joined #RubyOnRails
[17:07:05] norc_: has joined #RubyOnRails
[17:07:09] lacrymology: has left #RubyOnRails: ()
[17:07:36] jcm: universa1: no I simply added to production.rb config.force_ssl = true
[17:08:33] gingray: Hi can anyone help with paperclip validation i've an issue i'm able to upload multiple files and want to validate size of sum of all attached files
[17:08:36] KensoDev: has joined #RubyOnRails
[17:08:43] gingray: is it possible with paperclip
[17:11:11] Palsson: has joined #RubyOnRails
[17:11:19] benlieb: has joined #RubyOnRails
[17:12:12] Sylario: gingray: I highly doubt that paperclip do that out of the box. But you can make a custom validator using the ability of paperclip to get the size of the original upload
[17:13:08] norc_: Im using delayed_job for a project, but cannot find any documentation on what argument is passed for the hooks (before, after, etc). They just call it "job" in the code examples. Any pointers?
[17:13:10] gingray: sylario: thanks for your response seems to be so
[17:13:16] matthias_: has joined #RubyOnRails
[17:15:18] kirillzh: Why would I need to return created_at and updated_at fields in Rails API response? Can't think of the scenario.
[17:19:32] Sylario: kirillzh: blog API ? Discourse API ?
[17:19:59] mostlybadfly: has joined #RubyOnRails
[17:20:05] kirillzh: API for sort of social app
[17:20:15] claytonzaugg: has joined #RubyOnRails
[17:20:23] Sylario: some auditing external tool?
[17:20:35] Sylario: For stats?
[17:21:09] Sylario: To respact european laws and alow third party tool to retrieve a user Data?
[17:21:53] neanderslob: has joined #RubyOnRails
[17:22:09] corioliss: has joined #RubyOnRails
[17:24:16] rodfersou: has joined #RubyOnRails
[17:24:38] mustmodify: has joined #RubyOnRails
[17:24:49] rakm: has joined #RubyOnRails
[17:25:18] mustmodify: anyone have a recipe for using app.get('/some.pdf') and then attaching that to an email?
[17:25:22] norc_: kirillzh, what makes you think you need to anyhow?
[17:26:30] sonalkr132: has joined #RubyOnRails
[17:26:44] btwebdev: has joined #RubyOnRails
[17:27:08] btwebdev: do rails models need to coincide w/migrations?
[17:27:19] btwebdev: i'm adding a column via a migration, and then adding data to that column
[17:27:40] btwebdev: but it's saying 'unknown attribute' when i try to run the migration that adds data to the table
[17:28:01] kirillzh: norc_ timestamps are returned in response by default, so I guess there should be a reason for that. I just don't know if I need these timestamps or if there is some practice of using them.
[17:28:37] norc_: btwebdev, ActiveRecord implements method_missing together with introspecting some metadata on your database to find out whether that method has a corresponding column or not.
[17:29:23] btwebdev: so migration 1 add_column :table_name, :msg_type, :string
[17:29:29] norc_: btwebdev, so if ActiveRecord says it cannot see a column, your database does not have it, which usually indicates that forgot a migration (or messed it up badly)
[17:29:34] jottr: has joined #RubyOnRails
[17:29:46] btwebdev: well when i check mysql, migration 1 has successfully created the column
[17:29:58] norc_: btwebdev, did you restart the web server?
[17:30:11] btwebdev: and then migration 2is just Module::Model.create! field1: 'xyz', field2: 'abc'
[17:30:20] btwebdev: restart between migrations?
[17:30:30] adaedra: You shouldn't need to
[17:30:36] adaedra: But it doesn't hurt.
[17:30:58] btwebdev: so, migration 1 completes successfully. restart server and run migration 2 = success. but if i drop my DB and try to run all migrations it fails
[17:31:00] norc_: adaedra, you also shouldn
[17:31:02] btwebdev: is that column list cached?
[17:31:05] norc_: should not need to restart spring
[17:31:08] norc_: but somehow you do all the time.
[17:31:27] btwebdev: saw something a few years back on reset_column_somethingorother
[17:31:32] btwebdev: but can't find that in current AR docs
[17:31:59] norc_: btwebdev, http://apidock.com/rails/ActiveRecord/Base/reset_column_information/class
[17:32:29] norc_: Personally I lost all my faith in half the caching magic between ActiveRecord and Spring.
[17:32:39] btwebdev: weird, didn't find that article. thanks will look.
[17:33:36] btwebdev: so should it be Module::Model.reset_column_information?
[17:34:32] chouhoulis: has joined #RubyOnRails
[17:35:08] rgtk: has joined #RubyOnRails
[17:37:31] Cohedrin: has joined #RubyOnRails
[17:38:26] mikeiniowa: has joined #RubyOnRails
[17:38:54] jhass: Terens: a lot of folk do, why you claim nobody does?
[17:39:11] dexter_: has joined #RubyOnRails
[17:39:20] EdwardIII: hrm what's the best way to add an fk to existing model? write your own migration? or is there some 'auto generate migration' thing i can do like django has?
[17:39:48] EdwardIII: spring the java framework?
[17:40:05] jhass: not sure, if anywhere rails g migration has an option for it
[17:40:46] DEA7TH: has joined #RubyOnRails
[17:41:33] EdwardIII: ah i didn't realise there was a g migration
[17:41:33] adaedra: EdwardIII: just a xxx_id column or a real db-side fk? I think rails don't do the second natively.
[17:41:34] EdwardIII: life is good
[17:41:45] EdwardIII: hrm yeah it's not a real fk is it
[17:41:45] Devalo: has joined #RubyOnRails
[17:41:49] EdwardIII: a 'reference', right?
[17:42:13] adaedra: For the first: rails g migration AddSecondModelToFirstModels second_model:references
[17:42:22] jhass: adaedra: http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_foreign_key
[17:42:27] EdwardIII: neat, thanks
[17:42:33] jhass: no idea if references does that automatically by now
[17:42:37] jhass: I think it has an option?
[17:42:46] adaedra: jhass: that was more for the references, yeah
[17:43:13] jhass: http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_reference
[17:43:17] jhass: foreign_key: true
[17:43:33] EdwardIII: seems like it kinda is fk aware: add_reference(:stay_details, :payment_response, {:index=>true, :foreign_key=>true})
[17:43:47] adaedra: I wonder about the need for the foreigner gem now, I kinda remember it was required, don't know why
[17:43:56] jhass: I think it's deprecated now
[17:44:11] adaedra: ACTION needs to actualize a little his rails-fu then.
[17:44:11] malcolmva: has joined #RubyOnRails
[17:45:48] mikecmpbll: has joined #RubyOnRails
[17:45:56] jhass: can't find anything in the repo about that though
[17:46:59] Quintasan: Hi, how does one usually solve having user-defined fields in a from? My users want to be able to define custom form templates but I can't figure out how to solve this.
[17:48:26] jhass: use a document db or have something like fields(id, name), data(id, field_id, value)
[17:48:32] jhass: specifics depend on the specifics
[17:48:54] jhass: could also consider a mix, for example a json column in a postgres db
[17:50:27] eljimmy: has joined #RubyOnRails
[17:51:56] n00bDev: has joined #RubyOnRails
[17:52:30] Terens: I am cannot understand
[17:52:36] Terens: how to add a file into application.css
[17:53:10] jhass: /= require foo/bar
[17:53:12] norc_: Is there a simple way to install additional hooks/callbacks into the rake db tasks?
[17:53:13] jhass: //= require foo/bar
[17:53:15] adaedra: If you didn't change application.css, just drop a .css or .scss file in the app/assets/stylesheets folder and it will be picked up automatically.
[17:53:28] jhass: norc_: after or before?
[17:54:14] norc_: jhass, I want some action done after the db:schema:load when called from db:setup
[17:54:37] jhass: only then? mh
[17:55:04] jhass: and it must be before the seeds?
[17:55:18] norc_: Or I guess I could simply create my own rake task that simply calls db:schema:load, my task, and then db:seed.
[17:55:21] tetraktys: has joined #RubyOnRails
[17:55:29] jhass: yeah I guess
[17:55:51] norc_: Basically I have some schema that must only be applied to development and another environment.
[17:56:34] jhass: sounds like you'll have a dirty db/schema.rb all the time then and need to manually edit it for production
[17:56:48] norc_: Or is there some mechanism in migrations that allows me to deal with pre-existing views/tables in production that my rails code has no control over?
[17:57:16] arup_r: has joined #RubyOnRails
[17:57:17] macsteps: has joined #RubyOnRails
[17:57:38] norc_: Yeah that is what I have currently, and I want to split it - so I can use migrations for as many tables as possible, while only manually maintaining the legacy tables.
[17:57:46] hardtail: has joined #RubyOnRails
[17:58:42] jhass: I'd probably consider using distinct databases for the stuff you have control over and you don't and have completely external bootstrap sql scripts to build a fake legacy DB for dev
[17:58:45] hardtail: has joined #RubyOnRails
[17:59:06] mustmodify: has left #RubyOnRails: ()
[17:59:28] Terens: *=require cssfile //=require otherfile
[17:59:31] Terens: arent they comments?
[17:59:32] jhass: and then perhaps a rake task to run them and just append the dependency to db:setup
[17:59:35] Terens: what is the difference
[17:59:48] adaedra: Terens: they're directive for sprockets.
[17:59:55] jhass: Terens: http://guides.rubyonrails.org/asset_pipeline.html
[17:59:57] rubyonrailed: has joined #RubyOnRails
[18:00:05] Terens: I was reading this but got confused with the comment thing
[18:00:47] norc_: jhass, that would work. I could simply expose them all as views - that way they would not get pulled by schema:dump either.
[18:00:53] Terens: also what if I use compiled eg Semantic ui and not a gem one? what would I lose?
[18:01:15] jhass: norc_: sounds good
[18:01:18] worknick: has joined #RubyOnRails
[18:01:26] worknick: is there any gem for user notifications?
[18:02:10] norc_: worknick, just out of curiosity, did you bother to google first?
[18:04:04] sleungcy: has joined #RubyOnRails
[18:04:13] EMCHAMP_: has joined #RubyOnRails
[18:04:35] neilf: has joined #RubyOnRails
[18:04:36] worknick: norc_: only get the public_activity and faye and pusher and they are third party.
[18:05:25] norc_: worknick, alright. What exactly are you trying to achieve? What do you need exactly?
[18:06:16] drbayer: has joined #RubyOnRails
[18:06:34] bronson: has joined #RubyOnRails
[18:06:39] worknick: simple notification. when other users, rate, like, comment current users activity he should get notification. this is seperate from public_activity. i am already using public_activity for other purpose.
[18:07:21] EdwardIII: are controller helpers intended really only for use in templates?
[18:07:26] tubbo: worknick: not that i know of, but check out ruby-toolbox.com and see if maybe something is indexed there somewhere?
[18:07:45] worknick: tried. nothing.
[18:07:53] tubbo: EdwardIII: not only are they intended for use in view templates, i believe they can *only* be used in view templates...since most helpers assume ActionView::Helpers are included.
[18:08:02] norc_: EdwardIII, What is a "controller helper" ?
[18:08:12] EdwardIII: well i'm not sure what you call them
[18:08:15] EdwardIII: 'rails helpers'?
[18:08:31] tubbo: worknick: hmm, well honestly for the "asynchronously notifying the user" part, pusher is really the way to go (if money is no object)
[18:08:37] norc_: EdwardIII, helpers are an odd thing, and usually have code that is much better placed in service modules/classes or decorators.
[18:08:39] EdwardIII: they seem to be tied in with controllers (actionpack/lib/action_controller/metal/helpers.rb), tubbo seemed to know what i mean
[18:08:43] tubbo: takes all the BS out of sending push notifications to the browser or mobile devices.
[18:09:01] mdw: has joined #RubyOnRails
[18:09:04] jhass: EdwardIII: stuff in app/helpers is called view helpers and can only be used in those
[18:09:15] EdwardIII: i have a params method i need to share between 2 controllers
[18:09:22] EdwardIII: just looking for the best place to pop it
[18:09:28] norc_: EdwardIII, put it into a module and include it.
[18:09:32] norc_: Its Ruby.
[18:09:43] tubbo: PSA if anyone here decides to develop a web framework in the future and wants to name something a 'helper', just stop.
[18:09:51] jhass: http://api.rubyonrails.org/classes/AbstractController/Helpers/ClassMethods.html#method-i-helper can define a view helper at the controller level, making a controller method available as a view helper for example
[18:10:15] EdwardIII: in symfony they call 'em 'extensions'
[18:10:15] tubbo: EdwardIII: yeah that's better off as a "concern", which could just be a module you include (no need to extend AS::Concern) into your controllers.
[18:10:32] EdwardIII: oooh concerns
[18:10:48] tubbo: EdwardIII: ruby is already capable of implementing module composition, so you don't need to actually extend anything...just make a module.
[18:10:50] norc_: When Rails users say "concern" they usually just mean "plain old ruby module" though.
[18:11:03] tubbo: yeah that's why i put "concern" in quotes, because i meant for you to treat it as a concern :)
[18:11:17] tubbo: a module can be many things...a namespace, a collection of global methods, etc.
[18:12:07] norc_: Ruby calls this pattern "mixins" ;-)
[18:12:23] EdwardIII: unsure what to name this
[18:12:40] EdwardIII: everything else just seems to exist at the root level. models, controllers, all that stuff
[18:13:05] tubbo: rails provides a dir for you called app/controllers/concerns that you can put controller-level mixins at.
[18:13:36] KensoDev: has joined #RubyOnRails
[18:14:14] rgtk_: has joined #RubyOnRails
[18:14:19] EdwardIII: ah ok it needs to be a mixin because it needs self.params
[18:14:20] Hans267: has joined #RubyOnRails
[18:15:01] EdwardIII: whaddya normally call the module? Concerns?
[18:15:49] norc_: EdwardIII, depends on what it does ;-)
[18:17:01] norc_: Here is some examples of what I call my ActiveRecord concerns: ViewProxy, Filterable, Trackable, MagicMarkers
[18:17:46] EdwardIII: ok so you give them role-flavoured names too then
[18:17:56] aegis3121: has joined #RubyOnRails
[18:17:57] EdwardIII: or in ruby i guess that would be "mixin-flavoured names"
[18:18:00] intrigueD: has joined #RubyOnRails
[18:18:21] EdwardIII: so ParamConcern is probably a daft name
[18:18:43] norc_: What common code does it abstract away?
[18:18:53] norc_: What functionality does it offer?
[18:19:17] asahi: has joined #RubyOnRails
[18:19:21] EdwardIII: well at the moment it's just a way to share a params for one particular model between 2 controllers
[18:19:33] EdwardIII: but i guess in the future i would probably pop other params in there too
[18:19:44] norc_: EdwardIII, what is your model named?
[18:20:17] norc_: StayDetailParameters would be a simplistic name.
[18:20:34] norc_: Just pick something that gives at least a slight indication what it mixes in.
[18:21:47] EdwardIII: the other framework i've been using encourages you to fear and distrust state
[18:21:59] EdwardIII: ruby (and rails) are very... state-friendly heh
[18:22:12] EdwardIII: that's a good name, i think i'll roll with that, thanks
[18:22:29] SteenJobs: has joined #RubyOnRails
[18:22:41] tubbo: EdwardIII: what do you mean?
[18:22:44] tubbo: "state-friendly"?
[18:23:02] norc_: This is a bold statement about a framework revolving about statless HTTP. :-)
[18:23:02] EdwardIII: they utilise state a lot
[18:23:16] EdwardIII: i mean state on objects rather than the protocol
[18:23:32] EdwardIII: e.g. in the other framework they would go absolutely nuts if you used a trait to handle params like that
[18:23:42] tubbo: EdwardIII: you mean laravel?
[18:23:57] EdwardIII: they'd say it should be a separate object that you pass your params into, so it's loosely coupled and you can use it somewhere else, i.e. not a controller
[18:24:05] EdwardIII: your cli tool or template or whatever
[18:24:06] sandstrom: has joined #RubyOnRails
[18:24:14] EdwardIII: tubbo: no, symfony
[18:24:16] EdwardIII: back in a bit
[18:24:19] mwcmitchell: has joined #RubyOnRails
[18:24:26] tetraktys: has joined #RubyOnRails
[18:24:40] norc_: EdwardIII, the issue is just terminology. Many frameworks are actually quite similar, they just use M/V/C differently - which results in all kind of weird comparisons how "one framework does better than the other"
[18:25:34] srinidhi: has joined #RubyOnRails
[18:25:50] Pumukel: has joined #RubyOnRails
[18:26:30] ElFerna_: has joined #RubyOnRails
[18:28:23] magickid: has joined #RubyOnRails
[18:28:34] tubbo: none of this MVC stuff is even "real MVC" anyway ;)
[18:28:36] worknick: tubbo: norc_ i was looking for something to "create" the notifications of all action and not for "delivering" the notification itself.
[18:28:43] tubbo: because MVC was designed as a way to design user interfaces, not backend code
[18:29:16] sinkensabe: has joined #RubyOnRails
[18:29:25] Synthead: this is a little weird
[18:29:51] Synthead: I have some .css.scss files in /app/stylesheets, and they use image-url(...) tags
[18:30:24] Synthead: when serving it via production, the paths it generates are /assets/some_file.png, not the fingerprinted md5 version
[18:30:32] Synthead: so I get 404s on the links
[18:30:35] Synthead: why is this?
[18:32:34] Synthead: hm, I cleared out /public/assets, and in regenerating them, they seem to have the new URLs
[18:32:46] Synthead: that's kind of disconcerting... is this normal?
[18:33:33] norc_: Synthead, did you compile your assets?
[18:34:13] tubbo: Synthead: it's definitely not normal to precompile your assets in development, so if you did that before switching to prod (or ran a `rake` task without prepending RAILS_ENV=production), you might have accidentally generated your assets in the wrong env and confused rails' manifest generator (which is what it uses to make sure it doesn't compile assets when not needed)
[18:34:36] Synthead: norc_: I did precompile them, yeah
[18:34:42] Synthead: tubbo: that's probably what I did there
[18:34:57] Synthead: tubbo: I'll just make sure to always precompile them in production ;)
[18:35:03] Synthead: thanks a lot guys!
[18:35:16] chouhoulis: has joined #RubyOnRails
[18:36:19] sandstrom: has joined #RubyOnRails
[18:36:30] dopamean_: has joined #RubyOnRails
[18:39:09] msyvich: has joined #RubyOnRails
[18:40:37] KensoDev: has joined #RubyOnRails
[18:43:51] KitsuneDrag0n: has joined #RubyOnRails
[18:44:20] SteenJobs: has joined #RubyOnRails
[18:44:28] kmckelvin: has joined #RubyOnRails
[18:44:59] Synthead: I have match "*path" => redirect("/"), via: :get in routes.rb. Is there a way to make this redirect via https?
[18:45:22] chouhoulis: has joined #RubyOnRails
[18:46:33] Synthead: the request will already be https, if it helps
[18:49:21] blackmesa: has joined #RubyOnRails
[18:50:09] tildes: has joined #RubyOnRails
[18:50:27] unreal_: has joined #RubyOnRails
[18:51:52] nettoweb: has joined #RubyOnRails
[18:52:11] tildes: has joined #RubyOnRails
[18:54:34] lacrymology: has joined #RubyOnRails
[18:55:36] smathy: has joined #RubyOnRails
[19:00:30] aegis3121: has joined #RubyOnRails
[19:02:06] Macaveli: has joined #RubyOnRails
[19:03:18] BradenBraden: finally found the thorn in my side. gem 'whisper' causes the AR to boot up looking for database.yml
[19:05:46] sankaber: has joined #RubyOnRails
[19:07:44] pawnbox_: has joined #RubyOnRails
[19:08:23] lxsameer: has joined #RubyOnRails
[19:08:24] macsteps: has joined #RubyOnRails
[19:08:29] nettoweb: has joined #RubyOnRails
[19:09:05] nogic: has joined #RubyOnRails
[19:10:04] nogic: has joined #RubyOnRails
[19:11:07] JohnBat26: has joined #RubyOnRails
[19:11:09] nogic: has joined #RubyOnRails
[19:11:52] nogic: has joined #RubyOnRails
[19:12:33] roshanavand: has joined #RubyOnRails
[19:13:03] krz: has joined #RubyOnRails
[19:13:58] Terens: hello i write <%=image_tag 'logo.png' %>
[19:14:00] Terens: and it fails
[19:14:09] Terens: Asset was not declared to be precompiled in production.
[19:14:10] Terens: Add `Rails.application.config.assets.precompile += %w( logo.png )` to `config/initializers/assets.rb` and restart your server
[19:15:30] imanc: has joined #RubyOnRails
[19:17:10] imanc: I've been using python & django for years and am looking for a no b/s book on rails that doesn't mess about teaching the basics like MVC. Does such a thing exist?
[19:17:12] nettoweb: has joined #RubyOnRails
[19:19:34] smathy: Terens, Rails 5 ?
[19:21:20] rhizome: imanc: probably not
[19:21:38] fox_mulder_cp: imanc: official guides - simple blogapp, rails 4 in actions simple ticket system, rails 4 agile development - smart online store
[19:22:52] smathy: imanc, I don't know any of the major Rails books that spend more than a dozen or so pages on those basics.
[19:23:16] fox_mulder_cp: imanc: all books, all stories - only a part of magic
[19:23:37] imanc: ok, sounds good - thanks guys :)
[19:23:43] msyvich: has joined #RubyOnRails
[19:24:18] fox_mulder_cp: only mind, only brain and trying to play with all tech's make u experience
[19:25:14] Toledo|gone: has joined #RubyOnRails
[19:25:46] Toledo|gone: has left #RubyOnRails: ()
[19:26:27] arup_r: ok time to sleep.. another worst day... :/
[19:26:44] triptec: has joined #RubyOnRails
[19:27:01] fox_mulder_cp: imanc: i start use rails, use default blogapp manual and use it as test lab for a techniques, which taken from all books some lines ago here, and experiments and my practice from asp.net mvc4 and perl mvc framework
[19:27:07] fox_mulder_cp: arup_r: good night
[19:28:04] RegulationD: has joined #RubyOnRails
[19:29:02] bronson: has joined #RubyOnRails
[19:29:10] asahi: has joined #RubyOnRails
[19:30:08] asahi: I just upgraded to rails 5 and I'm getting the alias_method_chain deprecation warning when I do rails c but it doesn't tell me where alias_method_chain is being used
[19:30:55] drale2k: has joined #RubyOnRails
[19:32:04] baweaver: has joined #RubyOnRails
[19:32:27] spion: has joined #RubyOnRails
[19:32:33] mdw: has joined #RubyOnRails
[19:32:35] blackmesa: has joined #RubyOnRails
[19:32:54] ldnunes_: has joined #RubyOnRails
[19:33:29] ur5us: has joined #RubyOnRails
[19:34:11] dopamean_: has joined #RubyOnRails
[19:34:30] smathy: asahi, grep -r alias_method_chain $(bundle list --paths)
[19:35:25] drale2k: i want to open a socket on a certain port with rails. Can i use ActionCable for that? I am on Rails 5.
[19:36:17] drale2k: ActionCable is only for WebSockets right? So if i want to open a tcp socket i will need something alese
[19:38:03] podman: has joined #RubyOnRails
[19:38:15] cac: has joined #RubyOnRails
[19:39:18] tubbo: drale2k: yeah, but Ruby comes with socket programming support in the stdlib.
[19:39:21] batasrki: has joined #RubyOnRails
[19:39:45] tubbo: so you can just use the TCPSocket class to open a new connection
[19:39:56] dexter_: has joined #RubyOnRails
[19:40:08] drale2k: tubbo: yep but i was looking for something that makes it simpler. I will take another look, maybe it is simple enough with the built in classes
[19:40:48] askhat: has joined #RubyOnRails
[19:41:07] drale2k: btw do i see the socket log in the same log file i see the rails HTTP traffic?
[19:41:11] tubbo: drale2k: not sure how much more simple you want to get :) also, do you really need to use raw TCP or are you actually developing against a higher-level protocol of some kind?
[19:41:35] drale2k: tubbo: i am reading GPS data which is sending binary data to a TCP connection
[19:41:41] norc_: has joined #RubyOnRails
[19:41:45] tubbo: ahh ok, yeah :)
[19:42:10] tubbo: you're probably stuck with using the raw TCPSocket class.
[19:42:23] drale2k: hm ok, shouldn't be too bad
[19:42:35] _3by8: has joined #RubyOnRails
[19:42:38] tubbo: just maybe thinking you were using ZMQ or some other socket lib and then i could say "oh, just use the gem for it" :)
[19:43:28] drale2k: i looked all night yesterday for a lib or gem for FM1100 Sensor but nothing for ruby
[19:44:18] drale2k: so i had to write the parser for the binary data to read it and now i need to figure out how to accept the incoming data properly
[19:44:21] cac: has joined #RubyOnRails
[19:44:44] tubbo: sounds fun
[19:44:55] tubbo: (not being sarcastic...i love that kind of stuff)
[19:44:55] drale2k: we'll see how fun it is :P
[19:45:24] drale2k: how would i read the TCP log?
[19:45:34] drale2k: is it dumped into the rails server log ?
[19:46:18] tubbo: drale2k: it doesn't come with a log, you'd have to implement that yourself. the easiest thing to do would probably be calling Rails.logger, like Rails.logger.info 'opened tcp connection'
[19:47:43] drale2k: yup thanks
[19:50:29] jottr: has joined #RubyOnRails
[19:51:37] trinaldi: has joined #RubyOnRails
[19:52:05] HalcyonicStorm: has joined #RubyOnRails
[19:53:06] sinkensabe: has joined #RubyOnRails
[19:53:42] arthurix_: has joined #RubyOnRails
[19:54:42] msyvich: has joined #RubyOnRails
[19:54:55] _3by8: For some reason my Rails app wants to keep sending me to the show action rather than the update action, why is that? https://gist.github.com/threebyeight/1efa62c91cc08e5659ec
[19:55:35] Technodrome: has joined #RubyOnRails
[19:56:04] rhizome: _3by8: gist the actual error
[19:56:28] _3by8: https://gist.github.com/threebyeight/9e64fa42c439c0b9963c
[19:56:58] rhizome: you can just add it to your existing gist
[19:57:12] rhizome: what about params?
[19:57:42] _3by8: rhizome: that's all that's showing up.
[19:57:50] rhizome: and your routes
[19:57:57] hardtail: has joined #RubyOnRails
[19:58:03] rhizome: that's all that's in your log for that action?
[19:58:12] marr: has joined #RubyOnRails
[19:58:42] rhizome: no "Started PATCH..."?
[19:58:52] rhizome: or GET, if it thinks it wants #show
[19:59:06] hardtail: has joined #RubyOnRails
[19:59:44] _3by8: rhizome: I updated the gist with what the route looks like.
[20:00:18] rhizome: you may be too secretive
[20:00:52] _3by8: Not trying to be secretive, just simple.
[20:02:02] _3by8: I thought setting the method to :patch would trigger the update action but it's not.
[20:02:05] nfk|laptop: has joined #RubyOnRails
[20:02:11] rhizome: then can i see the actual routes? rake routes
[20:02:44] msyvich: has joined #RubyOnRails
[20:04:59] asahi1: has joined #RubyOnRails
[20:05:24] asahi1: has left #RubyOnRails: ()
[20:05:58] _3by8: rhizome: I'm sorry, I'm sick and I'm on meds and I'm not paying attention to "simple" things.
[20:06:57] diegoviola: has joined #RubyOnRails
[20:07:51] arthropododo: has joined #RubyOnRails
[20:08:42] sandstrom: has joined #RubyOnRails
[20:10:45] asahi1: has joined #RubyOnRails
[20:11:18] doublemalt_: has joined #RubyOnRails
[20:11:43] asahi1: has left #RubyOnRails: ()
[20:11:45] asahi1: has joined #RubyOnRails
[20:12:09] asahi1: has left #RubyOnRails: ()
[20:12:17] asahi1: has joined #RubyOnRails
[20:13:40] benlieb: has joined #RubyOnRails
[20:14:08] asahi1: hello, is pry-rails still being used by people today, or has a different irb gained favor?
[20:14:53] trinaldi: has joined #RubyOnRails
[20:15:56] mwcmitchell: has joined #RubyOnRails
[20:18:21] nettoweb: has joined #RubyOnRails
[20:20:26] drbayer: has joined #RubyOnRails
[20:21:16] tercenya: has joined #RubyOnRails
[20:22:41] ilhami: she went to sleep?
[20:22:51] norc_: asahi1, there is only pry really.
[20:23:18] norc_: Afaik there is also ripl for rails, but I have yet to meet someone who actually uses ripl.
[20:25:19] drbayer: has joined #RubyOnRails
[20:25:49] asahi1: norc_: okay thank you
[20:27:31] mhoungbo: has joined #RubyOnRails
[20:32:04] mdw: has joined #RubyOnRails
[20:35:14] mwcmitchell: has joined #RubyOnRails
[20:37:08] Balint: has joined #RubyOnRails
[20:41:58] FooMunki: has joined #RubyOnRails
[20:43:31] openstruct: has joined #RubyOnRails
[20:44:19] dexter_: has joined #RubyOnRails
[20:45:11] netzfisch: has joined #RubyOnRails
[20:45:42] goodcodeguy: has joined #RubyOnRails
[20:46:07] Balint: Hey, I would need some help with some code, any rails gurus here?
[20:47:11] Pro|: just ask
[20:48:27] Balint: Alright, my problem is: I am making a blog and have articles with comments assigned. When I am rendering the comments under the article an "extra" comment is rendered
[20:48:50] Balint: without it's attributes but with the same layout as a comment would be
[20:49:35] Balint: I am dropped and created new database but the problem still persists. I cannot figure out what the problem could be..
[20:50:32] bronson: has joined #RubyOnRails
[20:51:09] batasrki: Balint: !gist
[20:51:09] helpa: Balint: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[20:51:22] smathy: Balint, probably you're building an empty comment somewhere for the "New Comment" form in your view, and that's now getting mixed up in the general display of comments.
[20:54:45] franzip: has joined #RubyOnRails
[20:55:00] Balint: https://gist.github.com/anonymous/b870ff7031b4f1a46dbb
[20:55:30] Balint: I thought about it, but if i remove the form partial it is still there..
[20:55:33] FooMunki: has joined #RubyOnRails
[20:56:45] iammiles: has joined #RubyOnRails
[20:56:51] batasrki: you're not calling .build anywhere but _form.html.erb?
[20:56:51] Balint: Well, you're right it was the form, now how do I do to remove the "ghost comment?"
[20:57:00] smathy: Balint, that form partial is funky too, you don't add <form> elements inside the `form_for` btw.
[20:57:27] iammiles: has left #RubyOnRails: ()
[20:57:44] smathy: Balint, see, just calling the form partial builds an extra comment.
[20:58:18] smathy: Balint, and you call the form partial BEFORE you iterate over @article.comments in your show template.
[20:59:43] smathy: Balint, you should be able to make this work by changing your `@article.comments.build` in your form to `Comment.new(article:@article)`
[21:00:13] renegadeandy: has joined #RubyOnRails
[21:00:22] dici: has joined #RubyOnRails
[21:00:23] Balint: Thank you!
[21:00:32] Balint: An other follow up question..
[21:01:44] Balint: The form_for acts as a <form> ?
[21:02:55] Balint: And if I have = @articles.each |article| do --- that does not count as a div, so I cannot assign a class for that?
[21:03:27] Balint: = @articles.each do |article| I mean
[21:10:20] juddey: has joined #RubyOnRails
[21:11:29] liceoprova: has joined #RubyOnRails
[21:11:59] batasrki: Balint: where in that gist is @articles.each? I'm not sure I understand your question
[21:12:55] liceoprova: has left #RubyOnRails: ()
[21:13:38] celly: has joined #RubyOnRails
[21:14:48] neanderslob: hi all, I'm validating a set of fields: validates_presence_of :street, :city, :state, :zip, :country
[21:15:20] neanderslob: however, since I've added this validation, I have this message: "can't be blank" below each of the fields in my form
[21:16:13] neanderslob: is there a convenient way to hide the message altogether or to transform it to something less cumbersome?
[21:16:58] DTee: has joined #RubyOnRails
[21:17:05] rhizome: neanderslob: shouldn't do that by default, are you using simple_form or something that would put it there?
[21:17:42] neanderslob: rhizome: thanks for the response; yea, I'm using simple_form
[21:19:47] yfeldblum: has joined #RubyOnRails
[21:24:27] mices: does it make a difference if i use rvm or rbenv, rvm has to be installed through curl on my system but there's an rbenv package in my "package installer(gui)"
[21:28:54] batasrki: mices: depends on how old that rbenv package is
[21:30:47] Cervajz: has joined #RubyOnRails
[21:31:51] fox_mulder_cp: mices: some month ago i compiled some manual for rbenv for a ~5mins and ~10 commands for it https://github.com/foxmuldercp/blogapp/blob/master/README.rdoc
[21:33:07] fox_mulder_cp: it now used root anyway, only your or selected railsapp user targeted
[21:35:05] mdw: has joined #RubyOnRails
[21:37:06] aaronr: has joined #RubyOnRails
[21:37:25] SteenJobs: has joined #RubyOnRails
[21:38:52] maesitos: has joined #RubyOnRails
[21:40:48] RegulationD: has joined #RubyOnRails
[21:42:15] pawnbox: has joined #RubyOnRails
[21:44:10] theBestNunu: has joined #RubyOnRails
[21:45:27] theBestNunu: wats the official stable version of rails? 4.2 ?
[21:45:36] Radar: theBestNunu:
[21:46:20] fox_mulder_cp: he he. i'm glad. i win in css styling my jekyll site
[21:46:41] theBestNunu: jekyll is nice, i switched 1 month ago from wordpress
[21:46:44] qejk: has joined #RubyOnRails
[21:46:48] fox_mulder_cp: some fixes and i can say wordpress - bye bye, my darling
[21:47:17] fox_mulder_cp: theBestNunu: some years ago i write my static content generator on powershell. then bash+ perl..
[21:48:03] fox_mulder_cp: and my procrastination make me cry. but ~week ago i learn about guthub using jekyll and try it
[21:48:04] theBestNunu: powershell i've used it for some fun with keyboard injection hehe
[21:48:51] nettoweb: has joined #RubyOnRails
[21:48:57] fox_mulder_cp: theBestNunu: i try to control my rdp farm, win domain with ~500 units
[21:49:05] theBestNunu: i switched bc I was getting a lot of traffic, something which my tiny server could now handle
[21:49:17] AntiSpamMeta: has joined #RubyOnRails
[21:49:24] theBestNunu: jekyll is so much faster and secure
[21:49:38] theBestNunu: since you have no logic, only content
[21:49:48] fox_mulder_cp: some last years switched to hostmaster after hosting support, want kill authors of plesk, ispmanager and ispconfig
[21:49:50] mwcmitchell: has joined #RubyOnRails
[21:50:37] fox_mulder_cp: theBestNunu: hew, i use interest logic in jekull for i18n site which is mainly on my native russian/ukrainian
[21:50:46] edwinvdgraaf: has joined #RubyOnRails
[21:51:00] pabloh: has joined #RubyOnRails
[21:51:10] dcope: i'm trying to use devise (warden) + another piece of middleware and i can't figure out why warden thinks im not authenticated
[21:51:16] dcope: following this: http://www.programmatic.me/blog/2014/11/14/making-devise-token-authenticable-work-with-grape-apis/
[21:51:35] fox_mulder_cp: it without content on english now, but proof of concept temporary here http://panel.mulder.kiev.ua/
[21:51:37] dcope: has anyone used warden + other middleware?
[21:52:39] theBestNunu: fox_mulder_cp: looks pretty good, its even responsive ;)
[21:53:14] fox_mulder_cp: theBestNunu: jekull theme author in footer
[21:53:29] fox_mulder_cp: his site is very pretty
[21:55:16] fox_mulder_cp: theBestNunu: i have a /en and /ru collections, and special properties for index
[21:55:46] fox_mulder_cp: and filtering for current language and lang selector
[21:56:52] theBestNunu: hey, any1 used datatables with RoR ?
[21:57:24] theBestNunu: or an alternative?
[21:59:20] arBmind: has joined #RubyOnRails
[22:00:12] maesitos_: has joined #RubyOnRails
[22:04:52] Conflict: has joined #RubyOnRails
[22:06:41] jscheel: has joined #RubyOnRails
[22:08:26] roshanavand: has joined #RubyOnRails
[22:09:56] bahar: has joined #RubyOnRails
[22:09:56] bahar: has joined #RubyOnRails
[22:11:47] levifig: has joined #RubyOnRails
[22:12:32] pawnbox: has joined #RubyOnRails
[22:13:42] railsForDaiz: has joined #RubyOnRails
[22:14:31] srinidhi: has joined #RubyOnRails
[22:14:42] wethu: has joined #RubyOnRails
[22:16:40] asahi1: has left #RubyOnRails: ()
[22:16:43] mrgreenfur: has joined #RubyOnRails
[22:18:24] mrgreenfur: Afternoon everyone! I have a bunch of models that all share the same statistics methods, and I already have generic code that works on each of them. Is there a best practice of how to get each model to have these methods without repeating them?
[22:19:02] Devalo: has joined #RubyOnRails
[22:19:14] fox_mulder_cp: mrgreenfur: concern folder
[22:19:32] fox_mulder_cp: and include it for models, controllers, etc
[22:20:25] moeabdol2: has joined #RubyOnRails
[22:20:35] mrgreenfur: fox_mulder_cp: thank you!
[22:20:59] jtong: has joined #RubyOnRails
[22:23:28] fox_mulder_cp: mrgreenfur: glad to help u
[22:23:44] mdw: has joined #RubyOnRails
[22:24:06] Pazician: has joined #RubyOnRails
[22:24:25] fox_mulder_cp: see u tomorrow
[22:24:58] rubyonrailed: has joined #RubyOnRails
[22:25:14] askhat_: has joined #RubyOnRails
[22:26:16] rogue_koder: has joined #RubyOnRails
[22:26:36] targaf: has joined #RubyOnRails
[22:27:12] sunya7a: has joined #RubyOnRails
[22:28:28] johnflux: has joined #RubyOnRails
[22:28:41] tvw: has joined #RubyOnRails
[22:28:56] redondos: has joined #RubyOnRails
[22:29:30] samuelkadolph: has joined #RubyOnRails
[22:30:21] drbayer: has joined #RubyOnRails
[22:30:25] humd1ng3r: has joined #RubyOnRails
[22:31:12] crdpink2: has joined #RubyOnRails
[22:32:55] beingjohnm: Is there a way to check what controller a form is submitted from? e.g. I have a form for editing @model in both the @model controller and the @model2 controller. If submitted in @model I want it to go there and if submitted in @model2 I want it to redirect there.
[22:33:46] edwinvdgraaf: has joined #RubyOnRails
[22:35:29] Radar: beingjohnm: I doubt they're called @model and @model2.
[22:35:32] Radar: beingjohnm: !fake
[22:35:32] helpa: beingjohnm: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[22:35:35] maesitos: has joined #RubyOnRails
[22:35:58] Radar: beingjohnm: it'd help us to see some real code for these controllers and models, and to know if these two models are relate.d
[22:36:41] apeiros: beingjohnm: HTTP_REFERER
[22:37:03] apeiros: oh, but you don't need that for debugging
[22:37:13] triptec: has joined #RubyOnRails
[22:37:16] apeiros: then??? I wouldn't use that.
[22:37:53] beingjohnm: Radar: oh, sorry about that. They are really called @goal and @after_signup (a wizard for after signing up).
[22:38:55] Technodrome: has joined #RubyOnRails
[22:39:05] beingjohnm: apeiros: yeah, I thought of that but thought that could get messy at some point down the line. My lack of skillz is creating enough code debt as is. :)
[22:39:12] ur5us: has joined #RubyOnRails
[22:39:32] apeiros: yeah, don't use it. I didn't read until the end and thought you were debugging something.
[22:39:41] Radar: beingjohnm: You could store a location in the session and then redirect back to that.
[22:39:45] apeiros: pass an information along
[22:40:36] apeiros: so you can just use params[:source] or somesuch to decide on where to redirect to
[22:40:51] Ropeney: has joined #RubyOnRails
[22:40:51] Scriptonaut: has joined #RubyOnRails
[22:41:13] beingjohnm: Radar, apeiros: thanks. I'll do that.
[22:41:24] sfr^: has joined #RubyOnRails
[22:41:37] penguinpowernz: has joined #RubyOnRails
[22:49:12] sinkensabe: has joined #RubyOnRails
[22:50:47] Coldblackice: has joined #RubyOnRails
[22:56:36] stannard: has joined #RubyOnRails
[22:56:47] cih: has joined #RubyOnRails
[22:59:26] intrigueD: has joined #RubyOnRails
[23:01:03] superlou: has joined #RubyOnRails
[23:01:29] railsFor_: has joined #RubyOnRails
[23:02:05] mwcmitchell: has joined #RubyOnRails
[23:03:25] jtong: has joined #RubyOnRails
[23:04:04] Glenny: has joined #RubyOnRails
[23:04:12] jtong: has joined #RubyOnRails
[23:05:19] SteenJobs: has anyone used dropzone.js with a form containing a file_field, and know how to submit one of the params from dropzone.js as the param associated with file_field?
[23:06:41] JoshGlzBrk: has joined #RubyOnRails
[23:08:52] snowy: has joined #RubyOnRails
[23:08:57] drale2k: anything wrong with starting a tcp socker within a controller action?
[23:09:00] lipoqil: has joined #RubyOnRails
[23:09:18] drale2k: this feels dirty but it makes it easy for me to parse the incoming data and use it with Rails Models
[23:09:55] drale2k: i wonder about performance though, could be a lot of connections coming in from multiple devices (GPS devices)
[23:12:05] pawnbox: has joined #RubyOnRails
[23:12:31] jscheel: has joined #RubyOnRails
[23:15:14] markelite: has joined #RubyOnRails
[23:16:04] smathy: drale2k, maybe use a connection pool, eg. https://github.com/mperham/connection_pool
[23:19:41] quazimodo: has joined #RubyOnRails
[23:21:01] triptec: has joined #RubyOnRails
[23:21:25] jtong: has joined #RubyOnRails
[23:21:34] replay: has joined #RubyOnRails
[23:22:16] replay: has joined #RubyOnRails
[23:23:50] ziyadb: has joined #RubyOnRails
[23:24:09] askhat: has joined #RubyOnRails
[23:25:14] blackhuey: has joined #RubyOnRails
[23:27:37] kerunaru: has joined #RubyOnRails
[23:35:24] SteenJobs: when an image is uploaded successsfully, the user is redirected to user_root_path???but when using dropzone.js, my UploadController#Create processes as JSON???what???s the best way to redirect to user_root_path when format.json?
[23:40:03] ur5us: has joined #RubyOnRails
[23:42:18] railsFor_: Hello, I referenced my javascript file "jquery-1.11.3.min.js" (in public/assets/js) in application.html.erb as <script src="assets/js/jquery-1.11.3.min.js"></script>. If i access the page from the dashboard#index or students#index the javascript url in chrome is 'assets/js/jquery-1.11.3.min.js" and i get a 200. However if i try and access students#new the javascript url becomes 'students/assets/js/jquery-1.11.3.min.js" 404 fro the file. Could
[23:42:19] railsFor_: someone explain why this is happening? Thanks
[23:42:51] pawnbox: has joined #RubyOnRails
[23:43:36] sinkensabe: has joined #RubyOnRails
[23:44:12] _Tariq: has joined #RubyOnRails
[23:47:36] ruurd: because you are referencing it as a relative URL?
[23:48:52] dexter_: has joined #RubyOnRails
[23:49:06] ruurd: besides: it's much better to use the functions provided by rails instead of hacking js directly into your erb templates.
[23:49:11] SteenJobs: ok, almost there - doing ???format.json { render template: 'user/inbox/index', formats: :html }??? tries to display the appropriate view, but it bypasses the inbox#index action so the appropriate vars aren???t loaded..
[23:49:28] SteenJobs: how can i get format.json to call inbox#index?
[23:49:56] railsFor_: @ruurd i think your are right. Will take a look thanks
[23:50:31] triptec: has joined #RubyOnRails
[23:50:56] [Butch]_: has joined #RubyOnRails
[23:50:58] ruurd: Use javascript_include_tag and point to application.js which pulls in the rest of the JS stuff.
[23:51:13] ruurd: same for css stuff
[23:51:22] ruurd: use stylesheet_link_tag
[23:52:04] railsFor_: @ruud im trying to put a Admin Dashboard Theme and don't want to mess with assets too much
[23:52:20] railsFor_: @ruurd don't want to break anything
[23:53:50] ruurd: then follow the asset pattern and refer to a similar thing as application.js but call it dashboard.js
[23:53:57] ruurd: same for css.
[23:54:26] ruurd: don't mess too much with it because you probably will also break the asset pipeline if you do.
[23:54:36] rgtk: has joined #RubyOnRails
[23:54:38] ruurd: basically you will make your life a lot harder
[23:55:49] railsFor_: @ruurd thats what I'm also scared of. Im fine with controllers, models but when it comes to the asset pipeline I'm like what where's what. sass css -.-
[23:56:11] ruurd: Well. git can save your ass...
[23:56:22] railsFor_: @ruurd ^_^ true that
[23:57:05] ruurd: have fun. breaking stuff isn't scary anymore if you git.
[23:58:03] alex88: has joined #RubyOnRails