« Back to channel list

#RubyOnRails - 01 August 2017

« Back 1 day Forward 1 day »
[00:06:54] jhfisc: has joined #RubyOnRails
[00:12:09] jhfisc: has joined #RubyOnRails
[00:15:15] jhfisc: has joined #RubyOnRails
[00:21:14] jhfisc: has joined #RubyOnRails
[00:24:26] aperkins81: has joined #RubyOnRails
[00:29:12] jhfisc: has joined #RubyOnRails
[00:29:59] bronson: has joined #RubyOnRails
[00:35:30] bronson: has joined #RubyOnRails
[00:38:09] cam27: has joined #RubyOnRails
[00:42:01] jhfisc: has joined #RubyOnRails
[00:44:08] HoierM: has joined #RubyOnRails
[00:44:43] jhfisc: has joined #RubyOnRails
[00:46:40] sevenseacat: has joined #RubyOnRails
[00:49:40] brent__: has joined #RubyOnRails
[00:53:10] cam27: I don’t know what my question even is, is that a good thing lol?
[00:55:49] gusrub: has joined #RubyOnRails
[00:58:11] apparition: has joined #RubyOnRails
[01:05:55] banisterfiend: has joined #RubyOnRails
[01:17:46] banisterfiend: has joined #RubyOnRails
[01:22:32] segy: has joined #RubyOnRails
[01:27:14] DoubleMalt: has joined #RubyOnRails
[01:34:47] jhfisc: has joined #RubyOnRails
[01:39:44] jhfisc: has joined #RubyOnRails
[01:45:56] jhfisc: has joined #RubyOnRails
[01:49:11] jhfisc: has joined #RubyOnRails
[01:53:22] patrick99e99: has joined #RubyOnRails
[01:55:46] irishfromua: has joined #RubyOnRails
[01:58:33] mjolnird: After all these years I figured rails deployment on your own hardware would have gotten easier.
[02:04:39] gp5st: has joined #RubyOnRails
[02:05:35] jhfisc: has joined #RubyOnRails
[02:05:55] linoespinoza: has joined #RubyOnRails
[02:08:20] linoespinoza: has joined #RubyOnRails
[02:12:21] gusrub: has joined #RubyOnRails
[02:18:15] sagax: has joined #RubyOnRails
[02:19:40] jhfisc: has joined #RubyOnRails
[02:36:45] jhfisc: has joined #RubyOnRails
[02:37:41] bronson: has joined #RubyOnRails
[02:43:12] jhfisc: has joined #RubyOnRails
[02:49:15] jhfisc: has joined #RubyOnRails
[02:57:12] jhfisc: has joined #RubyOnRails
[02:57:23] duderonomy: has joined #RubyOnRails
[02:58:01] Rodya_: has joined #RubyOnRails
[03:01:06] choke: has joined #RubyOnRails
[03:07:37] dopie: has joined #RubyOnRails
[03:13:55] banisterfiend: has joined #RubyOnRails
[03:14:24] dopie: I got almost everything working...
[03:15:31] dopie: https://gist.github.com/staycreativedesign/4911d08a7d60329abc89f9d6e9ccd7d0 how can I have the user submitted values still appear?
[03:19:14] jhfisc: has joined #RubyOnRails
[03:22:32] dopie: has left #RubyOnRails: ("Leaving")
[03:27:18] banisterfiend: has joined #RubyOnRails
[03:30:28] jhfisc: has joined #RubyOnRails
[03:33:12] jhfisc: has joined #RubyOnRails
[03:37:23] cjohnson: why are you calling User.new after you already created a new User with the params?
[03:37:35] bronson: has joined #RubyOnRails
[03:38:11] cjohnson: seems like you should just be calling User.new once, attempting to save it, and then using that same record to display data if it failed to save
[03:39:25] jhfisc: has joined #RubyOnRails
[03:42:38] kies: has joined #RubyOnRails
[03:54:56] Jameser: has joined #RubyOnRails
[04:03:13] segy_: has joined #RubyOnRails
[04:04:11] mvensky: has joined #RubyOnRails
[04:07:31] Darmani: has joined #RubyOnRails
[04:07:38] Darmani: Radar: Hello o.o
[04:08:16] segy: has joined #RubyOnRails
[04:11:35] segy_: has joined #RubyOnRails
[04:12:12] jhfisc: has joined #RubyOnRails
[04:17:33] srinidhi: has joined #RubyOnRails
[04:22:24] segy: has joined #RubyOnRails
[04:26:37] segy_: has joined #RubyOnRails
[04:29:24] segy: has joined #RubyOnRails
[04:30:11] emers2n: Yo check out this totally insane question
[04:31:22] segy-: has joined #RubyOnRails
[04:33:03] segy_: has joined #RubyOnRails
[04:33:13] emers2n: I do a query to get a set of histories from the past 30 days. The histories records dates are randomly mixed throughout the past 30 days. How would I go about filling in the missing dates so I can have an array of the past 30 days?!
[04:33:40] sevenseacat: thats one way to raise eyebrows
[04:33:53] emers2n: I was hoping man
[04:34:11] sevenseacat: I sincerely hope not
[04:34:34] emers2n: I was hoping
[04:39:28] jhfisc: has joined #RubyOnRails
[04:40:11] cjohnson: emers2n: How I might do it: sort the array, find hte lowest and highest dates, build a new array out of that range. use that array for the actual iteration
[04:40:15] cjohnson: and your original array for the lookup
[04:40:47] cjohnson: you already know the start and end dates, it's 30 days ago and now, right?
[04:41:02] cjohnson: so just do that same logic but you don't have to do sorting
[04:45:42] jhfisc: has joined #RubyOnRails
[04:47:33] nickjj: has joined #RubyOnRails
[04:50:20] jhfisc: has joined #RubyOnRails
[04:53:11] kt: has joined #RubyOnRails
[04:57:36] jhfisc: has joined #RubyOnRails
[04:59:01] brent__: has joined #RubyOnRails
[05:00:20] biox: has joined #RubyOnRails
[05:06:25] jhfisc: has joined #RubyOnRails
[05:15:09] kt: has joined #RubyOnRails
[05:15:58] emers2n: Could anyone let me know what this 13 digit date format seen here called: https://jsfiddle.net/Regisc/kbdn6dpp/
[05:16:02] srinidhi: has joined #RubyOnRails
[05:16:31] sevenseacat: unix timestamps
[05:19:44] cam27: What is the quickest way to get good with Active Record?
[05:19:44] emers2n: sevenseacat: thanks. So following this for converting to unix timestamp I'm still getting a 10 character length number instead of a 13 character length number: https://stackoverflow.com/questions/1805950/ruby-rails-converting-a-date-to-a-unix-timestamp
[05:20:25] sevenseacat: yours might include milliseconds.
[05:20:32] sevenseacat: cam27: practice
[05:20:43] cam27: I’m trying to get all items with a reference through a foreign_key, and I don’t know if it should be a find, where, join?
[05:21:01] sevenseacat: cam27: can you elaborate a little?
[05:21:08] jhfisc: has joined #RubyOnRails
[05:22:13] cam27: @order_items = @order.order_items.where( id: @order) (trying to get order_items with a reference to the order_id)
[05:22:51] sevenseacat: in that case you don't need a where - @order.order_items will apply that scope for you
[05:23:06] sevenseacat: to fetch all the OrderItems associated to that Order
[05:23:22] cam27: oh, so it gets the whole record
[05:23:26] emers2n: sevenseacat: Thanks! You are correct. Very helpful! "unix timestamp milliseconds ruby" in google lead to the right answer.
[05:25:00] cam27: And with this line, am I accesign the column total_price? @order_items.params[total_price]
[05:25:13] cam27: accessing ^
[05:25:16] sevenseacat: are you? what does running that code give you?
[05:25:28] cam27: a bunch of crap lol
[05:25:36] sevenseacat: define 'crap'
[05:26:00] cam27: It’s actually breaking on the next line, so my feed back is not that good
[05:26:05] cam27: syntax error, unexpected tIDENTIFIER, expecting ')'
[05:26:06] cam27: payment_method_nonce: params[:payment_method_nonce])
[05:26:27] sevenseacat: right, so fix the syntax error, then you can see whats wrong with the line you wrote
[05:26:53] cam27: If I do it as a symbol, then it says can’t convert from symbol to integer
[05:27:19] sevenseacat: so backtrack a little bit. what is @order_items ?
[05:27:30] cam27: and I tried string with to_i
[05:27:43] sevenseacat: trying random things won't really help
[05:27:59] sevenseacat: let's break it down and use logic
[05:28:06] cam27: is it a reference to order?
[05:28:13] sevenseacat: i'm asking you
[05:28:17] jhfisc: has joined #RubyOnRails
[05:28:19] sevenseacat: you've got it in front of you, i dont
[05:28:37] cam27: @order_items = @order.order_items
[05:28:55] sevenseacat: ok, so what data does the variable hold?
[05:29:00] sevenseacat: what type of object is it?
[05:29:31] cam27: all of the order item recors where the id is = order_id
[05:29:39] sevenseacat: thats not a type
[05:29:56] banisterfiend: has joined #RubyOnRails
[05:30:41] cjohnson: emers2n: javascript unix timestamps always include milliseconds fyi
[05:30:52] cjohnson: it's common practice to divide by 1000 in JS before shipping elsewhere
[05:31:30] cam27: https://gist.github.com/cam271/4fa3eaabc2b70821c894b3e604c4cacd
[05:31:36] emers2n: cjohnson: good to know
[05:31:57] sevenseacat: cam27: that doesnt tell me what value it has
[05:32:18] sevenseacat: I'm trying to help you understand what the code you've written actually does; you're making that a little hard
[05:32:29] cam27: YEah, this is why I came on here and said “Where can I go to get better with Active Record” lol
[05:32:53] sevenseacat: this has nothing to do with activerecord
[05:33:00] sevenseacat: this has to do with you following advice
[05:33:25] cam27: You said gist it? gist what?
[05:33:38] sevenseacat: gist the object. the data, the value, the type
[05:34:03] cam27: how do I get that? schema
[05:34:34] sevenseacat: if you're in a rails console, just evaluating it will print it out in the console
[05:35:49] sevenseacat: if you don't know what data types you're dealing with, you don't know what methods you can call on them
[05:38:44] bronson: has joined #RubyOnRails
[05:39:58] jhfisc: has joined #RubyOnRails
[05:40:36] krmela: has joined #RubyOnRails
[05:45:29] pootiscoder: has joined #RubyOnRails
[05:46:45] cam27: is its type nil?
[05:47:18] sevenseacat: dont guess, check.
[05:47:20] cam27: hey, I’m trying to get this thing to work with rescue rails c and it is not stopping with the binding.pry
[05:48:05] cam27: it should go into debug mode and I can step through and see the values
[05:48:27] sevenseacat: what exactly have you done?
[05:49:45] choke: has joined #RubyOnRails
[05:50:15] ahrs: has joined #RubyOnRails
[05:51:15] cam27: Idon’t know how to see what @instances hold, I suck with back end stuff, that’s why I wanted to know how to get better with finding out what those instances actually store.
[05:51:46] cam27: I’ve ran some queries, I don’t really know what they mean
[05:52:21] sevenseacat: start a rails console, load an Order record with order = Order.first or something similar, then check what order.order_items is
[05:54:28] banisterfiend: has joined #RubyOnRails
[05:54:54] jhfisc: has joined #RubyOnRails
[05:56:11] cam27: So that’s how I get to it. I’ve been trying all day, and I was ready to pay for an online course, cause this stuff is driving me nuts. The rails guides didn’t do much for debugging these values I didn’t think or see
[05:57:07] sevenseacat: well its not testing the exact values in the controller you're looking at, it's more general debugging
[05:57:10] sevenseacat: http://guides.rubyonrails.org/debugging_rails_applications.html might be worth a read
[05:57:32] sevenseacat: it sounds like getting more familiar with ruby might help you before you try picking up rails
[05:59:34] cam27: I use pry instead of byebug that’s why I skimmed that section
[06:00:41] cam27: but still, it’s this active chaining or whatever it is called, I just don’t get it with db. Long conversation, I just want to take a course on it so that I get it and I can knwo what’ going on with the data
[06:01:14] jhfisc: has joined #RubyOnRails
[06:01:57] agent_white: has joined #RubyOnRails
[06:06:00] banisterfiend: has joined #RubyOnRails
[06:06:53] krmela: good day there i have question how is possible to do something like this @order =Order.where(:datum => params[:datum] ).where(:user_id => current_user.id).first_or_create and on submit action just save it
[06:07:12] jhfisc: has joined #RubyOnRails
[06:07:16] cam27: Good question, lets sign up for a course together lol
[06:07:36] roshanavand: has joined #RubyOnRails
[06:08:14] cam27: Too bad they didn’t teach Active REcord in school ay
[06:08:45] krmela: cam27: i am pretty old for school but not old to get learn new tricks
[06:10:23] cjohnson: krmela: what is the question exactly
[06:10:34] jhfisc: has joined #RubyOnRails
[06:10:51] cam27: I took the same db course with two different teachers and both of them didnt teach me anything. I got an A for staying awake though
[06:11:08] krmela: cjohnson: i am have call model.first_or_create with some where
[06:11:30] krmela: i dont know how to be able pass model as well url where to send result
[06:12:12] krmela: cjohnson: i just want on submit save it but order is on submit action nill
[06:13:18] krmela: let me make gist with sources
[06:17:49] krmela: https://gist.github.com/netmoleCBA/d0822b40c1f876883c0c17d5fad0aca7
[06:19:12] krmela: i am welcome any idea why is bad in code
[06:24:40] jhfisc: has joined #RubyOnRails
[06:30:06] krmela: cjohnson: any idea ?
[06:30:23] banisterfiend: has joined #RubyOnRails
[06:30:57] dionysus69: has joined #RubyOnRails
[06:32:10] banisterfiend: has joined #RubyOnRails
[06:33:42] moeabdol: has joined #RubyOnRails
[06:37:20] mvensky: has joined #RubyOnRails
[06:37:22] conta: has joined #RubyOnRails
[06:40:19] Jameser: has joined #RubyOnRails
[06:42:45] Jameser: has joined #RubyOnRails
[06:43:38] banisterfiend: has joined #RubyOnRails
[06:46:26] jhfisc: has joined #RubyOnRails
[06:54:28] banisterfiend: has joined #RubyOnRails
[06:57:47] jhfisc: has joined #RubyOnRails
[06:59:52] conta: hey folk. I have electron app and I want it to communicate with Rails server App via api (user can login via electron app, update some stuff in db). I would like to also have web app, that same users can see stuff with. What keywords should I google?
[07:01:37] ome: has joined #RubyOnRails
[07:06:36] srinidhi: has joined #RubyOnRails
[07:07:47] banisterfiend: has joined #RubyOnRails
[07:12:46] lxsameer: has joined #RubyOnRails
[07:19:06] banisterfiend: has joined #RubyOnRails
[07:25:13] jhfisc: has joined #RubyOnRails
[07:27:43] Jameser: has joined #RubyOnRails
[07:30:48] banisterfiend: has joined #RubyOnRails
[07:31:16] jhfisc: has joined #RubyOnRails
[07:37:15] jhfisc: has joined #RubyOnRails
[07:39:47] bronson: has joined #RubyOnRails
[07:40:38] jhfisc: has joined #RubyOnRails
[07:46:16] jhfisc: has joined #RubyOnRails
[07:50:08] mikecmpbll: has joined #RubyOnRails
[07:54:39] banisterfiend: has joined #RubyOnRails
[08:01:49] jhfisc: has joined #RubyOnRails
[08:02:50] Jameser: has joined #RubyOnRails
[08:08:14] jhfisc: has joined #RubyOnRails
[08:10:39] muzik: has joined #RubyOnRails
[08:12:59] umaaji: has joined #RubyOnRails
[08:13:49] lexileo: has joined #RubyOnRails
[08:14:23] jhfisc: has joined #RubyOnRails
[08:16:23] Rodya_: has joined #RubyOnRails
[08:17:14] spyder55: has joined #RubyOnRails
[08:19:21] banisterfiend: has joined #RubyOnRails
[08:20:19] jhfisc: has joined #RubyOnRails
[08:26:48] jhfisc: has joined #RubyOnRails
[08:26:57] xall: has joined #RubyOnRails
[08:33:12] jhfisc: has joined #RubyOnRails
[08:34:44] workmad3: has joined #RubyOnRails
[08:35:58] banisterfiend: has joined #RubyOnRails
[08:37:00] arBmind: has joined #RubyOnRails
[08:38:39] jhfisc: has joined #RubyOnRails
[08:40:44] Ropeney: has joined #RubyOnRails
[08:41:42] umaaji: has joined #RubyOnRails
[08:42:06] jhfisc: has joined #RubyOnRails
[08:42:29] mostlybadfly: has joined #RubyOnRails
[08:42:53] banisterfiend: has joined #RubyOnRails
[08:59:00] moeabdol1: has joined #RubyOnRails
[08:59:15] jhfisc: has joined #RubyOnRails
[08:59:27] brent__: has joined #RubyOnRails
[09:00:04] muzik: has joined #RubyOnRails
[09:07:26] banisterfiend: has joined #RubyOnRails
[09:08:44] xall_: has joined #RubyOnRails
[09:13:15] jhfisc: has joined #RubyOnRails
[09:17:29] kt: has joined #RubyOnRails
[09:17:49] Rodya_: has joined #RubyOnRails
[09:26:20] jhfisc: has joined #RubyOnRails
[09:31:41] Jameser: has joined #RubyOnRails
[09:35:58] krmela: hello folks i have question let say i have records like user_id and choice and i wish each choice count of their occurency
[09:40:34] GodFather_: has joined #RubyOnRails
[09:40:42] bronson: has joined #RubyOnRails
[09:43:45] tbuehlmann_: krmela: I don't understand the question. what are your models and what columns do they have?
[09:49:40] jhfisc: has joined #RubyOnRails
[09:57:59] cabotto: has joined #RubyOnRails
[09:58:24] krmela: tbuehlmann_: i am find way for grouping and counting order.group(:food).count
[10:03:02] tbuehlmann_: and what's the problem?
[10:04:44] muzik: has joined #RubyOnRails
[10:05:54] jhfisc: has joined #RubyOnRails
[10:12:34] jhfisc: has joined #RubyOnRails
[10:18:41] Rodya_: has joined #RubyOnRails
[10:21:38] Jameser: has joined #RubyOnRails
[10:22:22] krmela: tbuehlmann_: my previous question was : Good Day there, i have question i cant figure out why my controller errors with ActionController::ParameterMissing - param is missing or the value is empty: order: source is on https://gist.github.com/netmoleCBA/42f4c9bf6c43e186bfdc76af5c738b9d
[10:24:16] tbuehlmann_: isn't that a completely unrelated issue?
[10:26:52] arBmind: has joined #RubyOnRails
[10:27:02] jhfisc: has joined #RubyOnRails
[10:27:41] marr: has joined #RubyOnRails
[10:29:44] krmela: tbuehlmann_: well i am asked earlier but nobody knows i am use in that source find_or_create and i dont know where is mistake
[10:30:25] tbuehlmann_: sorry, I can't follow you
[10:32:17] banisterfiend: has joined #RubyOnRails
[10:37:25] krmela: tbuehlmann_: let me rephase it it i am looking how to write code which let me this code work @order=Order.where(:datum => params[:datum] ).where(:user_id => current_user.id).first_or_create order belongs to food but it always ends on cant find food id
[10:38:49] krmela: i am looking for working example of this first_or_create as mine source dont works
[10:39:12] jhfisc: has joined #RubyOnRails
[10:39:40] xhoy: Double checking: this is expected behavior right: https://gist.github.com/xhoy/d3213fed673babbcceb65357bd0f1a72
[10:40:17] cabotto: krmela, does the create fail because it does not know the food id for the new record?
[10:41:04] tbuehlmann_: xhoy: what rails version are you on?
[10:41:09] xhoy: krmela: you dont set a food_id so how should that work
[10:41:14] xhoy: 4.2? is this fix some where?
[10:41:35] tbuehlmann_: try adding the inverse_of option to the associations
[10:41:51] cabotto: krmela, could you use first_or_initialize. This creates a new order and then manually populate the correct associated food record
[10:41:56] xhoy: tbuehlmann_: it workes when it is saved
[10:42:06] ur5us: has joined #RubyOnRails
[10:42:46] xhoy: tbuehlmann_: or moment let me google this first before i respond :)
[10:43:03] tbuehlmann_: well, is it a problem for you?
[10:43:28] krmela: cabotto: yes it fails as it unable find id
[10:43:31] xhoy: well i noticed when doing some validations :)
[10:43:46] banisterfiend: has joined #RubyOnRails
[10:44:02] jhfisc: has joined #RubyOnRails
[10:44:37] krmela: excuse me i check source brb
[10:49:00] xhoy: tbuehlmann_: NICE! Thanks :)
[10:49:09] tbuehlmann_: you're welcome!
[10:49:49] jhfisc: has joined #RubyOnRails
[10:50:15] someuser: has joined #RubyOnRails
[10:51:50] Jameser: has joined #RubyOnRails
[10:52:49] xhoy: tbuehlmann_: is there a reason this isn't default for associations?
[10:53:37] xhoy: aka what are the disadvantages
[10:54:49] cabotto: has joined #RubyOnRails
[10:55:59] krmela: well i am updated https://gist.github.com/netmoleCBA/42f4c9bf6c43e186bfdc76af5c738b9d actually it errors undefined method `food_id' for nil:NilClass looklike order class not pass to form
[10:56:26] xhoy: and your model?
[10:56:39] xhoy: when do you get the error krmela
[10:56:45] xhoy: on create or on edit?
[10:57:03] krmela: on edit where i have @order.food_id
[10:57:12] jhfisc: has joined #RubyOnRails
[10:57:16] xhoy: does @order exsist there?
[10:57:24] xhoy: do you have a better-errors gem?
[10:57:31] xhoy: you get a nice terminal right there :D
[10:57:48] xhoy: krmela: it seems that @order == nil
[10:57:59] xhoy: krmela: https://github.com/charliesome/better_errors << gives you a terminal on your error location
[10:57:59] dangerousdave: has joined #RubyOnRails
[10:58:33] krmela: yes i have better errors second strange is not there
[10:58:52] xhoy: second strange?
[10:59:06] xhoy: well you dont set it in your controller
[10:59:30] xhoy: your controller, edit, should have something like, @order = Order.find(params[:id])
[11:00:30] xhoy: params[:order]=Order.where(:datum => params[:datum] ).where(:user_id => current_user.id).first_or_create ==== broken...
[11:00:45] xhoy: is broken :P
[11:01:11] xhoy: krmela: follow this course: https://www.codecademy.com/learn/learn-rails
[11:01:14] xhoy: to get the basics
[11:05:56] krmela: xhoy well i am looked for way to use .first_or_create
[11:06:20] krmela: anyway ty for help
[11:06:21] cabotto: has joined #RubyOnRails
[11:07:40] andrew91841: has joined #RubyOnRails
[11:08:38] banisterfiend: has joined #RubyOnRails
[11:20:33] Rodya_: has joined #RubyOnRails
[11:23:09] tbuehlmann_: xhoy: it's the default
[11:23:23] dionysus69: any tricks that would allow me to put form submit button and other action buttons on the same line? given that the form submit is part of the form partial :)
[11:26:31] cabotto: has joined #RubyOnRails
[11:31:10] banisterfiend: has joined #RubyOnRails
[11:33:51] HoierM: has joined #RubyOnRails
[11:34:23] apparition47: has joined #RubyOnRails
[11:37:55] Chernobuk: has joined #RubyOnRails
[11:41:47] bronson: has joined #RubyOnRails
[11:41:52] rikkipitt: has joined #RubyOnRails
[11:42:09] conta: has joined #RubyOnRails
[11:42:28] jimms: has joined #RubyOnRails
[11:43:26] banisterfiend: has joined #RubyOnRails
[11:45:07] xhoy: tbuehlmann_: but it doesn't work (by default)
[11:45:35] xhoy: atleast it breaks when you use the accepts_nested_attributes_for
[11:45:52] xhoy: is that a bug then?!?
[11:47:24] xhoy: and its a know bug: https://github.com/rails/rails/issues/26358
[11:48:39] xall_: has joined #RubyOnRails
[11:53:38] xhoy: and it has been fixed in rails 5 https://github.com/rails/rails/pull/26952
[11:55:48] tbuehlmann_: use rails 5? :)
[11:56:07] xhoy: well i didn't read it all but the fix was unmerged again since it brokie a lot of stuff :P
[11:59:30] brent__: has joined #RubyOnRails
[12:17:33] cabotto: has joined #RubyOnRails
[12:21:22] Rodya_: has joined #RubyOnRails
[12:26:34] Ergo: has joined #RubyOnRails
[12:28:35] banisterfiend: has joined #RubyOnRails
[12:39:21] banisterfiend: has joined #RubyOnRails
[12:49:33] Jameser: has joined #RubyOnRails
[12:52:02] banisterfiend: has joined #RubyOnRails
[12:52:05] cabotto: has joined #RubyOnRails
[12:57:22] banisterfiend: has joined #RubyOnRails
[13:03:08] cabotto: has joined #RubyOnRails
[13:04:03] MksN: has joined #RubyOnRails
[13:12:00] MksN: hi I am reading learn enough action cable by michael hartl right now. I am stuck at the point where the receive function should be called. I used google, reread the tutorial, but I can't get the received function being called. anyone encounted this problem?
[13:20:09] banisterfiend: has joined #RubyOnRails
[13:20:27] arBmind: has joined #RubyOnRails
[13:28:58] jphase: has joined #RubyOnRails
[13:42:44] bronson: has joined #RubyOnRails
[13:43:21] Jameser: has joined #RubyOnRails
[13:45:30] banisterfiend: has joined #RubyOnRails
[13:56:43] banisterfiend: has joined #RubyOnRails
[13:57:03] cabotto: has joined #RubyOnRails
[13:58:38] banisterfiend: has joined #RubyOnRails
[14:15:26] theunraveler: has joined #RubyOnRails
[14:21:09] lexileo: has joined #RubyOnRails
[14:22:46] dviola: has joined #RubyOnRails
[14:30:54] futilegames: has joined #RubyOnRails
[14:33:42] chouhoulis: has joined #RubyOnRails
[14:40:40] ascarter: has joined #RubyOnRails
[14:41:37] mikecmpbll: has joined #RubyOnRails
[14:48:04] banisterfiend: has joined #RubyOnRails
[14:55:27] MksN: has joined #RubyOnRails
[14:57:42] jhfisc: has joined #RubyOnRails
[14:57:53] banisterfiend: has joined #RubyOnRails
[15:02:10] cam27: has joined #RubyOnRails
[15:02:30] jhfisc: has joined #RubyOnRails
[15:05:21] ResidentBiscuit: has joined #RubyOnRails
[15:06:43] jamal7: has joined #RubyOnRails
[15:10:10] mikecmpbll: has joined #RubyOnRails
[15:10:31] MksN: hi need still some help. learning some action cable right now. whenever I hit the submit button of my chat, the client gets disconnected from the server and will not receive the data of :received. I only get the log of :disconneced and :connected. tried redis but doesn't work...any tips how to solve this?
[15:15:42] dionysus69: has joined #RubyOnRails
[15:21:47] banisterfiend: has joined #RubyOnRails
[15:21:54] jhfisc: has joined #RubyOnRails
[15:27:05] jhfisc: has joined #RubyOnRails
[15:28:55] banisterfiend: has joined #RubyOnRails
[15:30:15] cabotto: has joined #RubyOnRails
[15:31:06] [Butch]: has joined #RubyOnRails
[15:35:10] waseem_: has joined #RubyOnRails
[15:39:13] jhfisc: has joined #RubyOnRails
[15:39:57] mrbubbles: has joined #RubyOnRails
[15:40:32] mrbubbles: hi folks. I'm struggling with this new "use yarn instead of bundler" thing in rails 5.1. trying to use yarn to install font-awesome. has anyone managed to get that working?
[15:41:16] mrbubbles: I've installed it just fine, included it in my SCSS and then used the $fa-font-path path to specify the font path... all works fine in development. But in production the font files are missing. Maybe not being precompield correctly?
[15:43:23] brent__: has joined #RubyOnRails
[15:43:42] bronson: has joined #RubyOnRails
[15:44:48] brent__: has joined #RubyOnRails
[15:45:13] jhfisc: has joined #RubyOnRails
[15:55:07] DrYockel: has joined #RubyOnRails
[15:58:39] dangerousdave: has joined #RubyOnRails
[16:01:01] ascarter: has joined #RubyOnRails
[16:02:06] krichtof: has joined #RubyOnRails
[16:03:18] krichtof: has left #RubyOnRails: ()
[16:10:58] m13io: has joined #RubyOnRails
[16:11:21] npgm: has joined #RubyOnRails
[16:13:12] jhfisc: has joined #RubyOnRails
[16:18:06] jhfisc: has joined #RubyOnRails
[16:22:08] jhfisc: has joined #RubyOnRails
[16:27:02] brent__: has joined #RubyOnRails
[16:28:03] jhfisc: has joined #RubyOnRails
[16:28:07] brent__: Having an issue w/ RSpec.configure that I can't seem to resolve
[16:28:55] brent__: in my spec_helper.rb it's throwing an error when calling "congig.fixture_path = "#{::Rails.root}/spec/fixtures"", saaying fixture_path is a private method
[16:31:20] phon: has joined #RubyOnRails
[16:38:46] gusrub: has joined #RubyOnRails
[16:40:06] jhfisc: has joined #RubyOnRails
[16:41:35] davic: has joined #RubyOnRails
[16:43:27] sagax: has joined #RubyOnRails
[16:46:16] jhfisc: has joined #RubyOnRails
[16:57:03] srinidhi: has joined #RubyOnRails
[16:59:44] jhfisc: has joined #RubyOnRails
[17:00:12] one_zero: has joined #RubyOnRails
[17:05:20] mtkd: has joined #RubyOnRails
[17:09:53] conta: has joined #RubyOnRails
[17:11:15] jhfisc: has joined #RubyOnRails
[17:17:12] jhfisc: has joined #RubyOnRails
[17:22:29] jhfisc: has joined #RubyOnRails
[17:23:54] hahuang65: has joined #RubyOnRails
[17:26:13] bronson: has joined #RubyOnRails
[17:27:59] jhfisc: has joined #RubyOnRails
[17:28:56] kies: has joined #RubyOnRails
[17:30:59] duderonomy: has joined #RubyOnRails
[17:36:38] jhfisc: has joined #RubyOnRails
[17:41:03] hahuang65: has joined #RubyOnRails
[17:41:12] lord4163: has joined #RubyOnRails
[17:44:31] gusrub: has joined #RubyOnRails
[17:48:49] mcr431: has joined #RubyOnRails
[17:55:45] mcr431: hey all, having some issues with the Generator. When I try to generate a model, nothing happens. There aren't any errors, no ouput, just nothing happens. Generating a scaffold it creates everything except a model and a migration. Google searches told me to try `spring stop` but that throws an error: "/usr/bin/env: ‘ruby2.3’: No such file or directo
[17:55:45] mcr431: hey all having some issues with the Generator. Models & Migrations won't be created. If i generate a scaffold, it makes everything except those. Not too sure what the issue could be. Some questions like this suggested running `spring stop` but I'm not using spring. Any help would be appreciated
[17:55:52] chrisgopher: has joined #RubyOnRails
[18:08:37] moeabdol: has joined #RubyOnRails
[18:22:05] mikecmpbll: has joined #RubyOnRails
[18:22:47] ali_g__: has joined #RubyOnRails
[18:23:29] ali_g__: Hey there. I have an existential doubt about the documentation. here on 3.5 Bi-directional associations:
[18:23:31] ali_g__: http://guides.rubyonrails.org/association_basics.html
[18:24:44] ali_g__: it says active record will not automatically identify bidirectional associations when some options are used (in my case I need to use the :foreign_key option) and then it shows this snippet of code:
[18:24:59] ali_g__: https://www.irccloud.com/pastebin/vdLcaOU7/
[18:25:14] ali_g__: my question is what does :writer stand for there?
[18:25:30] ali_g__: it doesn't look like it has been declared before
[18:25:57] xco: has joined #RubyOnRails
[18:28:13] cjohnson: I'm not great on rails but I think that's the declaration
[18:28:15] cjohnson: it's an alias
[18:28:34] cjohnson: so it's saying that, Book belongs to Author, but in the context of Book, Author should be called writer
[18:30:15] cjohnson: I don't think it's a great example. I would use something like: Ticket and User
[18:30:37] Jameser: has joined #RubyOnRails
[18:31:00] cjohnson: For example, Ticket belongs to author, class User, foreign_key 'author_id'
[18:31:10] cjohnson: Ticket belongs to assignee, class User, foreign_key 'assignee_id'
[18:36:27] gusrub: has joined #RubyOnRails
[18:37:17] weaksauce: has joined #RubyOnRails
[18:39:00] roshanavand: has joined #RubyOnRails
[18:41:02] brent__: ali_g__: writer is the name of the association, you can call them whatever you want, when properly being linked to the other table via forein_key/etc
[18:42:04] ali_g__: Ohhh ok thank you cjohnson and brent__
[18:42:17] ur5us: has joined #RubyOnRails
[18:52:19] guacamole: has joined #RubyOnRails
[19:14:51] Rodya_: has joined #RubyOnRails
[19:15:23] marr: has joined #RubyOnRails
[19:21:29] srinidhi: has joined #RubyOnRails
[19:22:01] dangerousdave: has joined #RubyOnRails
[19:26:26] hahuang65: has joined #RubyOnRails
[19:28:42] dionysus69: when I render a partial and pass a collection to it, can I somehow utilize index inside partial? I assume collection is being rendered with each, could I make it each_with_index?
[19:31:41] gusrub: has joined #RubyOnRails
[19:37:29] cjohnson: My guess is you should just not use the collection shorthand then
[19:37:47] cjohnson: I don't see anything in the docs about letting you track the index along with it
[19:37:56] cjohnson: though honestly needing to know the index seems like a code smell
[19:42:27] brent__: has joined #RubyOnRails
[19:48:46] dionysus69: has joined #RubyOnRails
[19:50:43] hahuang65: has joined #RubyOnRails
[19:51:58] bronson: has joined #RubyOnRails
[19:56:46] cam27: has joined #RubyOnRails
[19:57:05] brendan-: has joined #RubyOnRails
[19:58:18] cam27: I have a User and a current_order helper. WOuld this be enough to handle checkout? or does each checkout order need a unique session?
[19:58:51] cam27: Should I make a Sessions controller, or can I do that after?
[20:01:16] chouhoulis: has joined #RubyOnRails
[20:05:33] hndk: has joined #RubyOnRails
[20:10:15] gusrub: has joined #RubyOnRails
[20:16:22] lxsameer: has joined #RubyOnRails
[20:17:57] ornerymoose: has joined #RubyOnRails
[20:22:03] ornerymoose: Im trying to query a model in a custom rake task. I can run this ruby code in rails console and it returns the correct data. However when I run it as a custom rake task, it returns no data. https://gist.github.com/ornerymoose/0ff8658d02992472c8cf2dd6315caa47 Any idea to why that is?
[20:25:01] fryguy: how are you running the task?
[20:26:36] ornerymoose: fryguy: usually just go into lib/tasks and run rake send_weekly_report
[20:27:58] fryguy: and how are you running the console?
[20:29:34] hahuang65: has joined #RubyOnRails
[20:29:43] ornerymoose: just hop in there via ‘rails console’, and run the ruby code that is stored in the self.send_weekly_report method
[20:34:29] fryguy: and if you run send_weekly_report itself?
[20:36:00] ornerymoose: if i run Ticket.send_weekly_report in rails console, it returns the correct data
[20:37:03] ornerymoose: feel like it may have something to do with the rake environment
[20:37:18] ornerymoose: but ‘task :send_weekly_report => :environment do’ should take care of all environments correct?
[20:37:41] conta3: has joined #RubyOnRails
[20:42:14] ornerymoose: yeah. Task is running fine in dev, but not in production
[20:43:11] ornerymoose: RAILS_ENV=production rake send_weekly_report now returns the correct data
[20:43:18] ornerymoose: wonder why I have to specify that though?
[20:44:37] skinnymg1: has joined #RubyOnRails
[20:46:11] dangerousdave: has joined #RubyOnRails
[20:50:06] fryguy: well, how do you usually run things in production
[20:51:58] bronson: has joined #RubyOnRails
[20:59:29] Or1on: has joined #RubyOnRails
[20:59:52] mlt-: has joined #RubyOnRails
[21:01:10] mlt-: I have self-referencing model. However fixtures don't set parent properly in DB when I use naming. I can explicitly set parent_id, but it is ugly:( Am I missing something?
[21:24:33] xco: has joined #RubyOnRails
[21:30:36] arBmind: has joined #RubyOnRails
[21:34:35] ascarter: has joined #RubyOnRails
[21:37:13] Ergo: has joined #RubyOnRails
[21:37:36] spheric: has joined #RubyOnRails
[21:43:52] banisterfiend: has joined #RubyOnRails
[21:48:03] cjohnson: What's the right way to make a link to a non-standard action?
[21:48:10] cjohnson: I've got resources :my_controller in routes
[21:48:16] cjohnson: and it generates the routes for the 7 basic methods
[21:48:26] cjohnson: but then I add a custom method to the controller
[21:48:34] cjohnson: Do I have to define a custom route just for that action?
[21:50:51] brent__: has joined #RubyOnRails
[21:53:09] cjohnson: I basically just want /admin/my_controller/:id/my_custom_action in addition to /admin/my_controller/:id/edit et al
[21:53:19] SteenJobs: has joined #RubyOnRails
[22:32:18] brent__: Having a hell of a time with getting rspec to run after updating from rails 3.2 => 4.0
[22:32:18] brent__: When I run rspec, every test fails the following stack trace. https://gist.github.com/brentluna/45c8566fdecf756ff566dae6dfb27b5a
[22:32:53] brent__: I monkeypatched a String#to_datetime wiht a byebug in it, and it seems like self was "$LABEL"
[22:32:53] hahuang65: has joined #RubyOnRails
[22:32:54] brent__: which is the reason for the error, but not sure how it's trying to evaulate $LABEL as a date
[22:43:45] gusrub: has joined #RubyOnRails
[22:53:07] bronson: has joined #RubyOnRails
[22:53:47] ecksit: has joined #RubyOnRails
[22:54:51] jhfisc: has joined #RubyOnRails
[23:01:08] fcser_: has joined #RubyOnRails
[23:05:49] GodFather_: has joined #RubyOnRails
[23:18:41] ascarter: has joined #RubyOnRails
[23:25:12] jhfisc: has joined #RubyOnRails
[23:33:00] jhfisc: has joined #RubyOnRails
[23:38:37] jhfisc: has joined #RubyOnRails
[23:47:11] jhfisc: has joined #RubyOnRails
[23:51:50] wethu: has joined #RubyOnRails
[23:53:11] jhfisc: has joined #RubyOnRails
[23:55:46] gusrub: has joined #RubyOnRails