« Back to channel list

#RubyOnRails - 31 July 2017

« Back 1 day Forward 1 day »
[00:00:21] growp: i'm doing stuff and i don't check here fast enough, i thought you can post and come back later
[00:00:23] havenwood: growp: Which gem? Pray tell!
[00:01:13] havenwood: growp: What gem are you talking about?
[00:01:59] growp: for real estate listings
[00:02:13] Radar: growp: link us to the gem please.
[00:02:40] Radar: Is it this one? https://rubygems.org/gems/rets
[00:05:43] Radar: growp: No recent updates meaning no updates since January of this year?
[00:05:58] Radar: growp: did you consider filing an issue on the GH repo? Over here; https://github.com/estately/rets
[00:06:41] growp: no, i have never filed an issue before
[00:13:30] cam27: has joined #RubyOnRails
[00:17:27] bronson: has joined #RubyOnRails
[00:25:03] jhfisc: has joined #RubyOnRails
[00:32:20] ali_g: hi there! so if I'm querying a table with Model.uniq.pluck(:user_id) as it has several entries per user, and I want to retrieve several of the columns of that table per user_id (so let's say I want retrieve the corresponding :first_name and :last_name for each :user_id but not the rest of the columns ) what would be a good way to do it?
[00:33:32] ali_g: I'm guessing if it Model.uniq.pluck(:user_id, :first_name, :last_name and the user has 2 rows with his id, but made a data entry mistake on his :first_name I'll get 2 of those, but I only need to get one
[00:33:59] sevenseacat: has joined #RubyOnRails
[00:36:41] brent__: has joined #RubyOnRails
[00:36:57] Ropeney: has joined #RubyOnRails
[00:43:39] cam27: has joined #RubyOnRails
[00:47:28] havenwood: ali_g: Model.distinct.pluck :first_name, :last_name
[00:49:20] havenwood: ali_g: What do you want it to be distinct on?
[00:53:14] ali_g: on :user_id (users can add several rows of data)
[00:54:19] ali_g: really trying to do an equivalent of excel's vlookup where I give the code a :user_id and get the values of other columns
[00:54:22] havenwood: ali_g: If you're also plucking the :user_id you can: Model.pluck 'DISTINCT user_id', :first_name, :last_name
[00:54:54] havenwood: ali_g: Model.distict(:user_id).pluck(:first_name, :last_name)
[00:55:00] havenwood: ali_g: However it is you want it.
[00:56:04] ali_g: havenwood: thanks! that answers my question :) need to practice proper chaining
[01:10:02] apparition: has joined #RubyOnRails
[01:14:25] cam27: has joined #RubyOnRails
[01:19:30] ali_g1: has joined #RubyOnRails
[01:19:40] jhfisc: has joined #RubyOnRails
[01:23:22] dexter1: has joined #RubyOnRails
[01:28:45] jhfisc: has joined #RubyOnRails
[01:33:27] jhfisc: has joined #RubyOnRails
[01:38:21] jhfisc: has joined #RubyOnRails
[01:43:49] cam27: has joined #RubyOnRails
[01:50:02] HoierM: has joined #RubyOnRails
[01:53:10] jhfisc: has joined #RubyOnRails
[01:58:03] Jameser: has joined #RubyOnRails
[02:01:29] sevenseacat: has joined #RubyOnRails
[02:09:12] jahrichie: has joined #RubyOnRails
[02:10:04] jhfisc: has joined #RubyOnRails
[02:14:04] cam27: has joined #RubyOnRails
[02:16:15] jhfisc: has joined #RubyOnRails
[02:16:54] Jameser: has joined #RubyOnRails
[02:18:22] bronson: has joined #RubyOnRails
[02:27:06] jhfisc: has joined #RubyOnRails
[02:29:17] muzik: has joined #RubyOnRails
[02:30:26] DTZUZO: has joined #RubyOnRails
[02:33:12] jhfisc: has joined #RubyOnRails
[02:38:25] irishfromua: has joined #RubyOnRails
[02:39:16] jhfisc: has joined #RubyOnRails
[02:44:15] cam27: has joined #RubyOnRails
[02:46:30] irishfromua: has joined #RubyOnRails
[02:47:45] gr33nw00d: has joined #RubyOnRails
[02:48:00] gr33nw00d: Hey guys, for the life of me I can't figure out how to disable test unit generators
[02:48:08] gr33nw00d: In rails 5.1
[02:49:24] muzik: Why would you want to disable them?
[02:49:57] sevenseacat: because you might not be using test unit?
[02:50:46] gr33nw00d: Yes, actually I won't be writing any tests for this project
[02:50:52] gr33nw00d: or if I do I'll add them myself
[02:52:30] gr33nw00d: https://gist.github.com/otang/d63c0455628b47f17e4559f14505303e
[02:55:43] mcr431: has joined #RubyOnRails
[02:57:11] jhfisc: has joined #RubyOnRails
[03:05:23] dviola: has joined #RubyOnRails
[03:07:03] Ropeney: has joined #RubyOnRails
[03:09:11] jhfisc: has joined #RubyOnRails
[03:14:50] cam27: has joined #RubyOnRails
[03:15:11] jhfisc: has joined #RubyOnRails
[03:19:00] Jameser: has joined #RubyOnRails
[03:21:13] jhfisc: has joined #RubyOnRails
[03:21:52] Jameser: has joined #RubyOnRails
[03:49:21] Jameser: has joined #RubyOnRails
[03:50:32] arBmind: has joined #RubyOnRails
[03:53:08] ali_g1: So... I have a (very big) array of values that I want to create as rows in a new table. How can I do that? .create doesn't support it
[03:55:21] ali_g1: the array would be like (["1", "Peter", "Heppner"], ["2", "Patti", "Smith"], ....)
[03:55:50] ali_g1: and the columns in the new empty table are like :id, :name, :last_name etc
[03:58:35] Jameser: has joined #RubyOnRails
[04:00:14] cam27: has joined #RubyOnRails
[04:01:36] umaaji: has joined #RubyOnRails
[04:02:56] Jameser: has joined #RubyOnRails
[04:06:49] wethu: ali_g1: depending on how large your array is, you'd want to break it down into batches, but #create supports an array of hash values where the key matches a column name, you could create this with #map and zip each with an array of keys: [["1", "Peter", "Heppner"], ["2", "Patti", "Smith"]].map { |a| %w(id first last).zip(a).to_h }
[04:08:01] wethu: use %i() if they really must be symbols, i can't remember if they're indifferent
[04:10:37] ali_g1: YES this worked. I put it into a variable then Model.create(variable) :)))))
[04:10:43] ali_g1: thank you wethu
[04:11:03] wethu: no worries.
[04:13:54] jhfisc: has joined #RubyOnRails
[04:19:54] bronson: has joined #RubyOnRails
[04:20:08] s2013: has joined #RubyOnRails
[04:30:44] cam27: has joined #RubyOnRails
[04:32:59] brent__: has joined #RubyOnRails
[04:37:15] jhfisc: has joined #RubyOnRails
[04:40:27] armyriad: has joined #RubyOnRails
[04:42:22] jhfisc: has joined #RubyOnRails
[04:57:10] jhfisc: has joined #RubyOnRails
[05:00:31] srinidhi: has joined #RubyOnRails
[05:03:38] jhfisc: has joined #RubyOnRails
[05:03:45] cam27: So now that I’m getting into the models more. And getting errors like Couldn't find OrderItem with 'id'=2 [WHERE "order_items"."order_id" = $1] in my better_errors result. Do I go into Rails C to start seeing what is going on?
[05:06:59] cam27: because I’m trying to delete an order, but I could be deleting items? I wanted to do a cascade effect. By removing the order, I’d remove the children. But I probably don’t want to destroy the order, just set it to not active. idk, what if I ever needed to pull the order back up? Looks like I’m getting into the backend now lol
[05:16:06] kapil___: has joined #RubyOnRails
[05:19:39] jhfisc: has joined #RubyOnRails
[05:31:19] cam27: has joined #RubyOnRails
[05:32:10] kapil___: any coffiescript expert here? i want paid support.
[05:34:45] andrew9184: has joined #RubyOnRails
[05:39:44] hive-mind: has joined #RubyOnRails
[05:44:30] Jameser: has joined #RubyOnRails
[05:46:48] jhfisc: has joined #RubyOnRails
[05:59:05] jhfisc: has joined #RubyOnRails
[06:05:17] roshanavand: has joined #RubyOnRails
[06:06:00] jhfisc: has joined #RubyOnRails
[06:15:14] guacamole: has joined #RubyOnRails
[06:15:21] jhfisc: has joined #RubyOnRails
[06:16:38] cam27: has joined #RubyOnRails
[06:20:50] bronson: has joined #RubyOnRails
[06:29:48] conta: has joined #RubyOnRails
[06:33:25] rgr: has joined #RubyOnRails
[06:36:13] guacamole: has joined #RubyOnRails
[06:38:25] zhjwpku[m]: has joined #RubyOnRails
[06:49:06] cam27: has joined #RubyOnRails
[06:49:36] srinidhi: has joined #RubyOnRails
[06:49:58] conta: has joined #RubyOnRails
[06:50:30] shotbug: has joined #RubyOnRails
[06:51:03] shotbug: has joined #RubyOnRails
[07:04:57] one_zero: has joined #RubyOnRails
[07:08:04] one_zero: has joined #RubyOnRails
[07:12:38] S1kx: has joined #RubyOnRails
[07:14:14] moeabdol: has joined #RubyOnRails
[07:16:10] pootiscoder: has joined #RubyOnRails
[07:17:16] cam27: has joined #RubyOnRails
[07:22:18] dionysus69: has joined #RubyOnRails
[07:24:25] cabotto: has joined #RubyOnRails
[07:32:27] wethu: has joined #RubyOnRails
[07:57:08] one_zero: has joined #RubyOnRails
[08:18:11] jhfisc: has joined #RubyOnRails
[08:21:28] bronson: has joined #RubyOnRails
[08:23:11] jhfisc: has joined #RubyOnRails
[08:24:30] marr: has joined #RubyOnRails
[08:26:12] workmad3: has joined #RubyOnRails
[08:26:40] DoubleMalt: has joined #RubyOnRails
[08:28:04] moeabdol: has joined #RubyOnRails
[08:29:11] jhfisc: has joined #RubyOnRails
[08:37:00] jhfisc: has joined #RubyOnRails
[08:37:27] berserk_ren: has joined #RubyOnRails
[08:42:19] jhfisc: has joined #RubyOnRails
[08:51:07] jhfisc: has joined #RubyOnRails
[08:57:26] jhfisc: has joined #RubyOnRails
[09:04:12] jhfisc: has joined #RubyOnRails
[09:05:37] Tempesta: has joined #RubyOnRails
[09:07:08] Arkentias: has joined #RubyOnRails
[09:11:06] moei: has joined #RubyOnRails
[09:11:43] emilkarl: has joined #RubyOnRails
[09:12:03] emilkarl_: has joined #RubyOnRails
[09:17:11] gregf_: has joined #RubyOnRails
[09:21:25] ur5us: has joined #RubyOnRails
[09:27:10] ur5us: has joined #RubyOnRails
[09:35:15] jhfisc: has joined #RubyOnRails
[09:35:39] Sylario: has joined #RubyOnRails
[09:36:04] arBmind: has joined #RubyOnRails
[09:37:15] moeabdol: has joined #RubyOnRails
[09:39:50] brent__: has joined #RubyOnRails
[09:41:48] dionysus69: I am trying to find or create based on author and receiver, but it creates duplicate if receiver sends message back to author. Conversation.find_or_create_by(author_id: 1, receiver_id: 4) so I want this to find instead of create if receiver is 1 and author is 4
[09:47:30] arBmind: has joined #RubyOnRails
[09:49:39] jhfisc: has joined #RubyOnRails
[10:03:16] jhfisc: has joined #RubyOnRails
[10:09:12] jhfisc: has joined #RubyOnRails
[10:14:31] jhfisc: has joined #RubyOnRails
[10:23:00] bronson: has joined #RubyOnRails
[10:42:01] pootiscoder: has joined #RubyOnRails
[10:43:45] jhfisc: has joined #RubyOnRails
[10:51:29] Arkentias: has joined #RubyOnRails
[10:54:10] mikecmpbll: has joined #RubyOnRails
[10:54:51] s2013: has joined #RubyOnRails
[10:58:56] ur5us: has joined #RubyOnRails
[11:03:13] apeiros: has joined #RubyOnRails
[11:14:22] DoubleMalt: has joined #RubyOnRails
[11:15:44] ur5us: has joined #RubyOnRails
[11:29:13] xall: has joined #RubyOnRails
[11:32:00] muzik: has joined #RubyOnRails
[11:35:31] jhfisc: has joined #RubyOnRails
[11:39:30] muzik: has joined #RubyOnRails
[11:41:17] jhfisc: has joined #RubyOnRails
[11:46:47] jhfisc: has joined #RubyOnRails
[11:49:07] arup_r: has joined #RubyOnRails
[11:51:32] say^: has joined #RubyOnRails
[11:57:25] jhfisc: has joined #RubyOnRails
[12:06:18] webdestroya: has joined #RubyOnRails
[12:07:13] jhfisc: has joined #RubyOnRails
[12:24:03] bronson: has joined #RubyOnRails
[12:26:36] Ergo: has joined #RubyOnRails
[12:30:56] ResidentBiscuit: has joined #RubyOnRails
[12:35:29] jhfisc: has joined #RubyOnRails
[12:42:47] AlHafoudh: has joined #RubyOnRails
[12:43:01] AlHafoudh: guys, does "heroku run bash" work for you right now?
[12:51:26] jhfisc: has joined #RubyOnRails
[13:02:42] AlHafoudh: FYI https://status.heroku.com/incidents/1236
[13:03:13] jhfisc: has joined #RubyOnRails
[13:05:28] cstls: has joined #RubyOnRails
[13:05:40] eelster: has joined #RubyOnRails
[13:06:44] apparition: has joined #RubyOnRails
[13:14:17] jhfisc: has joined #RubyOnRails
[13:18:58] jhfisc: has joined #RubyOnRails
[13:19:46] gp5st: has joined #RubyOnRails
[13:21:31] gp5st: hello. I would like to make my views and assets a separate project. What is the nest way to do that?
[13:25:09] cstls: gp5st: http://edgeguides.rubyonrails.org/api_app.html
[13:25:12] apparition47: has joined #RubyOnRails
[13:26:52] gp5st: cstls, I don't mean API, I mean the layout, views, assets would be in once place, and the controllers, libs, &c in another
[13:26:58] Jameser: has joined #RubyOnRails
[13:27:42] pmunt: has joined #RubyOnRails
[13:28:44] gp5st: cstls, why what?
[13:29:53] gp5st: I'm trying to build this so that the front end can be replaced, primarily because I'd like to open source it and there's no reason everyone needs to start with my assets, logos, &c
[13:35:41] catbusters: has joined #RubyOnRails
[13:35:45] jhfisc: has joined #RubyOnRails
[13:39:50] muzik: has joined #RubyOnRails
[13:40:21] brent__: has joined #RubyOnRails
[13:41:17] jaegerca: has joined #RubyOnRails
[13:42:14] jaegerca: So I am building an engine. This engine has a number of different routes - I was to insert certain routes into one part of my applications routes file, and another set of routes into another part of my applications routes file. Can anyone think of a pragmatic way of doing this?
[13:42:23] jaegerca: I want* to insert
[13:44:17] jhfisc: has joined #RubyOnRails
[13:44:56] jaegerca: I am thinking of it almost like how rails views do it with content_for and then yielding in the layout. Imagine I am yielding certain types of routes into my routes file that are in routes_for blocks in the engines routes.
[13:50:07] jhfisc: has joined #RubyOnRails
[13:53:06] muzik: has joined #RubyOnRails
[13:54:50] mrbubbles: has joined #RubyOnRails
[13:55:18] say^: gp5st: I think engines would be the answer to this. http://guides.rubyonrails.org/engines.html#overriding-views
[13:55:41] mrbubbles: Apologies in advance if this is a silly question, but I'm using Solidus and overriding a back-end product edit form view. That bit works fine, but the view renders a couple of partials... which aren't found (as I haven't copied those over). Is there a way that I can tell the view to look in the engine to find the partial, or shoudl I just copy those over too?
[13:56:46] mrbubbles: This is the form- https://github.com/solidusio/solidus/blob/master/backend/app/views/spree/admin/products/_form.html.erb - line 52 is causing the error. I know you can prefix a route with a namespace so that it knows what to target, perhaps its the same with partialss?
[13:59:34] gp5st: say^, ah, thanks. for some reason I though engines only generated code
[14:01:17] say^: mrbubbles: I _think_ it should work if you just specify `render partial:` first . But I'm not entirely sure.
[14:02:13] jhfisc: has joined #RubyOnRails
[14:07:12] jhfisc: has joined #RubyOnRails
[14:08:14] Jameser: has joined #RubyOnRails
[14:11:02] chouhoulis: has joined #RubyOnRails
[14:12:42] jhfisc: has joined #RubyOnRails
[14:18:25] jhfisc: has joined #RubyOnRails
[14:18:37] veex: has joined #RubyOnRails
[14:23:07] mrbubbles: Thanks say^ I'll try that :)
[14:24:47] bronson: has joined #RubyOnRails
[14:25:02] Chernobuk: has joined #RubyOnRails
[14:37:15] cam27: has joined #RubyOnRails
[14:40:37] kt: has joined #RubyOnRails
[14:40:55] banisterfiend: has joined #RubyOnRails
[14:41:01] arBmind: has joined #RubyOnRails
[14:47:14] ule: has joined #RubyOnRails
[14:47:50] ule: Hey guys.. I'm pretty sure someone had this issue before.. I'm upgrading rails from 4.1 to 4.2, getting this now: ActionView::Template::Error: Assert was not declared to be precompiled in production
[14:48:18] ule: According with my google research this is due a sprockets-rails locked version by the latest bundler version 1.15.2
[14:48:22] workmad3: has joined #RubyOnRails
[14:48:40] ule: so, It's suggesting myself to add the config/initialize/assets
[14:49:08] ule: but.. I already have the application.js on my assets.. so isn't this enough for precompiling assets referenced inside application.js?
[14:50:59] ule: adding individuals files into config/initializers/assets.rb helps though
[14:51:28] rgr_: has joined #RubyOnRails
[14:53:59] kt: has joined #RubyOnRails
[14:57:54] jaegerca: Is there a way to mount some routes of an engine in one place and the others in another place?
[15:13:44] jhfisc: has joined #RubyOnRails
[15:18:51] chouhoulis: has joined #RubyOnRails
[15:19:52] jhfisc: has joined #RubyOnRails
[15:20:39] cagomez: has joined #RubyOnRails
[15:21:31] cagomez: has joined #RubyOnRails
[15:43:47] eelster: has joined #RubyOnRails
[15:45:06] sekmo: has joined #RubyOnRails
[15:47:12] jhfisc: has joined #RubyOnRails
[15:49:17] sekmo: Hi all! My controller inherits the "check_logged_in" method and has a "before_action" that triggers it
[15:49:18] sekmo: https://gist.github.com/sekmo/c4bc4331df1fc22c933712fcd43d85e1
[15:49:21] sekmo: https://gist.github.com/sekmo/b15b3269a574ac00003c220ec1f89745
[15:49:40] kt: has joined #RubyOnRails
[15:50:38] sekmo: There is a devise built-in helper that does the exact job of "check_logged_in"?
[15:51:38] [Butch]: has joined #RubyOnRails
[15:52:42] jhfisc: has joined #RubyOnRails
[15:54:49] jphase: has joined #RubyOnRails
[15:56:43] tbuehlmann_: sekmo: yes, there is: https://github.com/plataformatec/devise#controller-filters-and-helpers
[15:58:24] sekmo: Thank you so much :-)
[15:59:12] jhfisc: has joined #RubyOnRails
[15:59:32] ekinmur: has joined #RubyOnRails
[16:04:02] jhfisc: has joined #RubyOnRails
[16:05:00] dionysus69: has joined #RubyOnRails
[16:07:07] Rodya_: has joined #RubyOnRails
[16:15:33] xall: has joined #RubyOnRails
[16:20:23] jhfisc: has joined #RubyOnRails
[16:26:18] bronson: has joined #RubyOnRails
[16:26:21] mtkd: has joined #RubyOnRails
[16:29:12] jhfisc: has joined #RubyOnRails
[16:29:43] vrlogrs: has joined #RubyOnRails
[16:29:53] vrlogrs: https://pastebin.com/B1q2V6qW
[16:30:01] vrlogrs: need some help with Rails 5.1 controller test
[16:30:08] vrlogrs: trying to specify the format (:js)
[16:30:20] vrlogrs: but keep getting an error: gumentError: unknown keyword: format
[16:30:25] vrlogrs: ArgumentError*
[16:30:58] vrlogrs: Please advise :)
[16:34:52] gusrub: has joined #RubyOnRails
[16:35:04] havenwood: vrlogrs: get login_path, constraints: -> req { req.format == :json }
[16:35:13] jhfisc: has joined #RubyOnRails
[16:36:26] havenwood: vrlogrs: http://guides.rubyonrails.org/routing.html#request-based-constraints
[16:37:59] havenwood: vrlogrs: Note the second warning ^ at the bottom of Section 3.9 above
[16:41:12] jhfisc: has joined #RubyOnRails
[16:49:07] jhfisc: has joined #RubyOnRails
[16:50:23] one_zero: has joined #RubyOnRails
[16:51:11] defsdoor: has joined #RubyOnRails
[16:52:49] vrlogrs: thanks alot havenwood!
[16:52:52] vrlogrs: ill check it out
[16:55:12] jhfisc: has joined #RubyOnRails
[16:59:49] vrlogrs: havenwood - now im getting ArgumentError: unknown keyword: constraints
[16:59:51] eelster: has joined #RubyOnRails
[17:00:39] havenwood: vrlogrs: show the line as you're running it?
[17:01:17] jhfisc: has joined #RubyOnRails
[17:07:12] jhfisc: has joined #RubyOnRails
[17:12:54] brent__: has joined #RubyOnRails
[17:15:12] jhfisc: has joined #RubyOnRails
[17:15:46] dviola: has joined #RubyOnRails
[17:18:49] emilkarl: has joined #RubyOnRails
[17:21:18] jhfisc: has joined #RubyOnRails
[17:27:18] jhfisc: has joined #RubyOnRails
[17:37:05] jhfisc: has joined #RubyOnRails
[17:46:04] gp5st: has joined #RubyOnRails
[17:51:24] dviola: has joined #RubyOnRails
[17:54:58] dionysus69: has joined #RubyOnRails
[17:58:48] high_fiver: has joined #RubyOnRails
[17:59:17] gusrub: has joined #RubyOnRails
[18:02:39] guacamole: has joined #RubyOnRails
[18:03:40] emilkarl: has joined #RubyOnRails
[18:04:47] Cesariox: has joined #RubyOnRails
[18:06:50] jhfisc: has joined #RubyOnRails
[18:08:54] irishfromua: has joined #RubyOnRails
[18:13:35] conta: has joined #RubyOnRails
[18:15:11] jhfisc: has joined #RubyOnRails
[18:15:11] noob_on_rails: has joined #RubyOnRails
[18:16:03] noob_on_rails: hey all , if i have an e-shop , or whatever other content , and i want to offer bilingual support
[18:16:13] noob_on_rails: how should i design the DB
[18:16:39] noob_on_rails: just throw in 2 instances of the same thing for each language? add double fields for each language or?
[18:17:21] pro777: noob_on_rails: Here a great place to start: http://guides.rubyonrails.org/i18n.html
[18:19:23] noob_on_rails: hmm ok ill look into it thanks :D
[18:25:41] emilkarl: has joined #RubyOnRails
[18:27:14] bronson: has joined #RubyOnRails
[18:31:12] jhfisc: has joined #RubyOnRails
[18:35:11] jhfisc: has joined #RubyOnRails
[18:39:15] srinidhi: has joined #RubyOnRails
[18:40:14] jhfisc: has joined #RubyOnRails
[18:46:16] jhfisc: has joined #RubyOnRails
[18:51:00] jhfisc: has joined #RubyOnRails
[18:52:10] banisterfiend: has joined #RubyOnRails
[18:55:47] gusrub: has joined #RubyOnRails
[18:56:20] jhfisc: has joined #RubyOnRails
[18:59:56] futilegames: has joined #RubyOnRails
[19:02:34] futilegames: has left #RubyOnRails: ()
[19:02:37] jhfisc: has joined #RubyOnRails
[19:08:06] Rodya_: has joined #RubyOnRails
[19:13:35] brent__: has joined #RubyOnRails
[19:14:14] NoGodDamnIdea: has joined #RubyOnRails
[19:14:54] gambl0re: has joined #RubyOnRails
[19:17:10] emers2n: has joined #RubyOnRails
[19:20:03] cagomez: has joined #RubyOnRails
[19:20:14] jhfisc: has joined #RubyOnRails
[19:30:28] emers2n: I'm using a form_for, with the action parameter set to 'new' and it routes to 'products/new'. How could I set it to 'people/new' instead?
[19:33:58] jhfisc: has joined #RubyOnRails
[19:40:14] jhfisc: has joined #RubyOnRails
[19:43:57] dionysus69: has joined #RubyOnRails
[19:47:49] arBmind: has joined #RubyOnRails
[19:50:46] jhfisc: has joined #RubyOnRails
[19:56:11] zacts: has joined #RubyOnRails
[20:02:28] banisterfiend: has joined #RubyOnRails
[20:15:38] choke: has joined #RubyOnRails
[20:18:35] jhfisc: has joined #RubyOnRails
[20:22:17] emers2n: How do I react to a successfully submitted form_for?
[20:23:00] emers2n: ^ Answer here: https://stackoverflow.com/questions/3501317/rails3-rails-js-and-jquery-catching-success-and-failure-of-ajax-requests
[20:25:37] jimms: has joined #RubyOnRails
[20:27:51] Rodya_: has joined #RubyOnRails
[20:28:02] bronson: has joined #RubyOnRails
[20:28:07] cagomez: has joined #RubyOnRails
[20:29:08] jhfisc: has joined #RubyOnRails
[20:31:35] cagomez: has joined #RubyOnRails
[20:41:12] jhfisc: has joined #RubyOnRails
[20:48:43] gusrub: has joined #RubyOnRails
[20:53:11] jhfisc: has joined #RubyOnRails
[20:57:58] Darmani: has joined #RubyOnRails
[20:58:06] Darmani: Radar: You around?
[21:01:25] jhfisc: has joined #RubyOnRails
[21:04:46] choke: has joined #RubyOnRails
[21:07:53] jhfisc: has joined #RubyOnRails
[21:11:00] jhfisc: has joined #RubyOnRails
[21:12:23] guacamole: has joined #RubyOnRails
[21:14:40] lxsameer: has joined #RubyOnRails
[21:16:11] jhfisc: has joined #RubyOnRails
[21:18:50] linoespinoza: has joined #RubyOnRails
[21:21:38] HoierM: has joined #RubyOnRails
[21:28:31] jhfisc: has joined #RubyOnRails
[21:28:50] ur5us: has joined #RubyOnRails
[21:30:20] duderonomy: has joined #RubyOnRails
[21:36:37] jhfisc: has joined #RubyOnRails
[21:40:29] jhfisc: has joined #RubyOnRails
[21:42:18] gusrub: has joined #RubyOnRails
[21:44:12] GodFather: has joined #RubyOnRails
[21:44:43] jhfisc: has joined #RubyOnRails
[21:50:02] jhfisc: has joined #RubyOnRails
[21:50:02] gusrub: has joined #RubyOnRails
[21:56:20] jhfisc: has joined #RubyOnRails
[21:57:52] brent__: has joined #RubyOnRails
[21:58:16] cam27: Is this how I would find the oreder_items with a fk order_id == 4? OrderItem.find(order == 4)
[22:00:32] nahtnam: has joined #RubyOnRails
[22:01:25] lxsameer: has joined #RubyOnRails
[22:02:44] jhfisc: has joined #RubyOnRails
[22:09:11] jhfisc: has joined #RubyOnRails
[22:10:39] gusrub: has joined #RubyOnRails
[22:13:12] michael_mbp: hey all - I'm trying to trace AR (DB) calls in a controller action and correlate those calls to actual code. I've basically killed all before filters except 1, and am still seeing loads of DB calls.
[22:13:23] michael_mbp: so I replaced the instance var with a dummy object - AND still DB calls!
[22:13:39] michael_mbp: What's a dummy object? Well, just a PORO with fake methods.
[22:14:18] jhfisc: has joined #RubyOnRails
[22:23:28] cagomez: has joined #RubyOnRails
[22:24:28] chrisgopher: has joined #RubyOnRails
[22:25:14] jhfisc: has joined #RubyOnRails
[22:25:15] chrisgopher: has left #RubyOnRails: ()
[22:25:17] chrisgopher: has joined #RubyOnRails
[22:28:07] mikecmpbll: has joined #RubyOnRails
[22:28:55] bronson: has joined #RubyOnRails
[22:29:17] jhfisc: has joined #RubyOnRails
[22:30:48] linoespinoza: has joined #RubyOnRails
[22:32:36] banisterfiend: has joined #RubyOnRails
[22:34:55] jhfisc: has joined #RubyOnRails
[22:36:04] choke: has joined #RubyOnRails
[22:40:32] jhfisc: has joined #RubyOnRails
[22:41:06] gusrub: has joined #RubyOnRails
[22:43:40] Radar: GOOD MRONING
[22:45:21] Radar: MORNING TOO
[22:46:53] jhfisc: has joined #RubyOnRails
[22:48:18] banisterfiend: has joined #RubyOnRails
[22:52:28] Winter_Foxo: has joined #RubyOnRails
[22:52:41] banisterfiend: has joined #RubyOnRails
[22:52:46] Winter_Foxo: Does anyone know if devise supports PBKDF2?
[22:53:10] jhfisc: has joined #RubyOnRails
[22:53:48] Winter_Foxo: Yeah I did that
[22:53:58] Winter_Foxo: But I'm not getting good results
[22:54:35] Winter_Foxo: I can see some people have tried it but it doesn't seem to be supported
[22:54:37] Radar: Is there anything stopping you from using the forks of devise-encryptable which add pbkdf2 support?
[22:55:01] Radar: Or at least those forks' code.
[22:55:15] Winter_Foxo: The forks seem to be very old and unsupported
[22:56:45] Radar: https://github.com/plataformatec/devise-encryptable/pull/11
[22:56:50] Radar: By "very old" you mean March last year?
[22:57:14] Radar: And by unsupported, you mean that you couldn't possibly comprehend the 19 lines of code in that PR and maintain it yourself if the need arose?
[22:57:21] Radar: Sorry, 20 lines.
[22:59:11] jhfisc: has joined #RubyOnRails
[23:04:43] npgm: has joined #RubyOnRails
[23:05:04] brent__: has joined #RubyOnRails
[23:05:43] brent__: i am working to upgrade a rails 3.2 and ruby 2.0 app to rails 4.0.13 and ruby 2.3.4 I am having issues w/ has_many, seems they may be broken, only thing I can find about the error is saying it was fixed on 4.1.7, however I can't imagine has_many was having these issues for so long before
[23:05:55] Radar: brent__: !didntwork
[23:05:55] helpa: brent__: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[23:06:01] banisterfiend: has joined #RubyOnRails
[23:09:34] banisterfiend: has joined #RubyOnRails
[23:10:05] brent__: Radar: let me get a stack trace
[23:10:08] Radar: thank you.
[23:10:33] cam27: I keep getting this error, and people have said just reset cookies and session and things,but that’s not working? Couldn't find OrderItem with 'id'=4 [WHERE "order_items"."order_id" = $1]
[23:10:55] brent__: Radar: https://gist.github.com/brentluna/ced4a7869e6f770d660572b5999bb413
[23:11:23] brent__: This is w/ rails 4.0.13(last 4.0 release I believe) and ruby 2.3.2
[23:11:33] brent__: It happens when I try to run a has_many association
[23:12:55] brent__: https://github.com/rails/rails/issues/16967 I found this, but like I said it sounds like it said it was fixed in 4.1.7
[23:13:11] jhfisc: has joined #RubyOnRails
[23:13:20] brent__: And seems unlikely this was a problem from 4.0 to 4.1.7
[23:13:58] brent__: Also just testted 4.0.10 and same result
[23:14:43] brent__: Radar: the relation is defined as so: has_many :authorships, order: 'position', as: :authorable, dependent: :destroy
[23:17:02] jhfisc: has joined #RubyOnRails
[23:17:49] dopie: has joined #RubyOnRails
[23:18:02] dopie: anyone here can help me with the error I'm getting https://gist.github.com/staycreativedesign/0e184957069dde375065928b693ff5e5 whenever you have time...
[23:19:17] Radar: brent__: /Users/brent/workspace/cureus/spec/fixtures/fixture_builder.rb:79:in `block (2 levels) in <top (required)>'
[23:19:19] Radar: WHat is on this line?
[23:20:00] brent__: https://gist.github.com/brentluna/ced4a7869e6f770d660572b5999bb413
[23:20:08] brent__: Radar: the last line on the new file in the gist
[23:20:21] brent__: i realized its not all has_many, just that one specificallyfor authorships
[23:22:17] Radar: brent__: any particular reason to not be using the latest rails 4.0 release?
[23:22:22] Radar: You're on 4.0.10, but the latest is 4.0.13
[23:23:01] brent__: right, I just went down to 4.0.10 to see if that made a difference
[23:23:12] jhfisc: has joined #RubyOnRails
[23:23:21] brent__: My works app was on 3.2.X and I am working on updating
[23:24:05] brent__: So I may have fixed it by removing the " order: 'position' " from the has_many declaration
[23:27:21] dopie: did I overkill trying to implement Service Objects?
[23:28:18] Radar: dopie: rip
[23:28:23] Radar: brent__: oh right
[23:28:36] dopie: Radar, rip?
[23:28:38] brent__: is that deprecated?
[23:28:46] Radar: brent__: no.
[23:28:49] Radar: brent__: !associations
[23:28:49] helpa: brent__: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[23:28:52] Radar: probably has more info ^
[23:28:56] Radar: dopie: "overkill" "rip"
[23:29:04] Radar: c'mon it is not too large a gap to span
[23:29:15] jhfisc: has joined #RubyOnRails
[23:33:29] brent__: Radar: thanks for taking the time. FYI, it looks like i needed to use "-> {order(:position) } "
[23:34:07] brent__: I have a crap ton of scopes I need to go through and do the same that are throwing errors right now
[23:37:04] jhfisc: has joined #RubyOnRails
[23:39:42] emers2n: I want to trigger the submission of a form_for with jQuery
[23:40:13] emers2n: if I do jQuery("#form").submit(), it causes an error
[23:40:40] emers2n: What is the correct way to trigger the submission of a form_for?
[23:41:06] brent__: I'm not sure i've used .submit()
[23:41:06] Jameser: has joined #RubyOnRails
[23:41:24] emers2n: Well you're gonna learn today
[23:41:28] brent__: I've often done var data = $('form').serialize()
[23:41:36] brent__: and then just use that as the data in an ajax
[23:43:04] brent__: $('#form') returns a form object?
[23:43:13] brent__: whats the error you're getting?
[23:44:03] emers2n: It returns an Unathenticated error, which if I manually fix then leads to a unknown format error
[23:44:23] emers2n: On the other hand if I just press return on the input it works flawlessly
[23:49:23] brent__: Hard to tell without more info, seems like .submit() should do it if the jquery object is valid
[23:50:09] brent__: you could try submitting it w/ your own ajax method and see if that makes a diff
[23:52:41] emers2n: Here's my dirty fix: Instead of trying to submit the form with .submit()
[23:52:56] emers2n: I added a hidden submit button and then called a .click() on that hidden submit button
[23:54:40] brent__: weird, that it made a difference
[23:55:10] brent__: well i guess it just results in using the standard form acton instead of jquery
[23:55:28] emers2n: Exactly, it makes sure that it performs exactly the way Rails expects