Activity Graph

Page 1 of 3 | Next »


[17:11:57] BrianJ: has joined #RubyOnRails
[17:13:26] BrianJ: any idea how I can in this simple make the 'attendances.is_team_activity': only_team_activities clause go away if only_team_activities is false ?
[23:01:31] BrianJ: Remote host closed the connection


[22:29:01] BrianJ: has joined #ruby
[22:29:21] BrianJ: Um JSON.parse doesnt supported nested objects?
[23:11:54] BrianJ: Remote host closed the connection


[08:31:40] BrianJ: has joined #RubyOnRails
[08:34:26] BrianJ: So I upgraded my rails 5.2.1 to 5.2.2 running in api mode and all of sudden my cors initializer: Rails.application.config.middleware.insert_before 0, Rack::Cors initializer at is giving me errors a FrozenError can't modify frozen Array. Is there a different way to setup cors now?
[08:45:51] BrianJ: nm, tracking it down to a gem


[12:16:44] BrianJ: has joined #ruby
[12:17:36] BrianJ: Is this the right channel to ask for help on factoryBot and associations ? There is no #factorybot channel.. :-/
[12:22:59] BrianJ: apeiros: ill try there, thanks
[12:23:14] BrianJ: has joined #RubyOnRails
[12:26:21] BrianJ: I have an issue with factoryBot, I have a stay belongs to student that belongs to schools..however no matter what I try i keep getting errors that the school doesnt exist, even if its created before hand. If you google factorybot and associations, this seams to be an ongoing problem..anyone here willing to lend a hand? Ill provide a pastie
[12:57:03] BrianJ: Remote host closed the connection


[00:38:01] BrianJ: Remote host closed the connection


[21:11:20] BrianJ: has joined #RubyOnRails
[21:12:35] BrianJ: Hi guys. Can anyone point me to a resource for rails 5 about how to use a worker to do a job while the web request is waiting and then returns with a download url for example? not sure how ppl do this in 2018..
[21:34:22] BrianJ: loincloth: yeah sure
[21:34:44] BrianJ: loincloth: i was unsure wether people would use actioncable, ajax or whatever here in 2018..
[22:26:16] BrianJ: Oh hi Radar, long fucking time no see :-)
[22:27:13] BrianJ: haha, alive and kicking on irc, nice to see. Not many around from that long time ago. I think it must have been atleast 6 years :-)
[22:32:16] BrianJ: Radar: So what are you up to now? I presume your no longer working with dr nic ..but are you still in australia?
[22:32:45] BrianJ: Time flies :-)
[22:33:01] BrianJ: I was mostly here when I was a rails noob ;-)
[22:33:41] BrianJ: yeah I remember your books, the multitenant one ;-)
[22:33:54] BrianJ: where you skipped over the insanely hard parts by purpose..i remember ;-)
[22:34:09] BrianJ: on purpose*
[22:35:19] BrianJ: Radar: and currently we do the emailing the result now like you mentioned, but I wanted to do the other option, just not sure which way to go :-)
[22:36:22] BrianJ: Radar: and the reason I remember you skipping those parts is because I was handling them. Like different views for different customers etc ;-)
[22:40:20] BrianJ: Radar: yeah those are the easy cases..sometimes they have different controllers and you need to keep track of which has to be linked to and not..I use exhibits a lot :-)


[12:02:32] BrianJ: has joined #ruby
[12:02:41] BrianJ: has joined #RubyOnRails
[12:21:05] BrianJ: " " I have an issue with this string.. You probably cant see it cause of client has removed it, but there seams to be a non breaking space..but I cant seam to get rid of it. I basicly just want to remove all charecters that arent part of the email
[12:24:34] BrianJ: any ideas?
[12:25:55] BrianJ: If I convert it to json it says: "​ \""
[14:16:32] BrianJ: ellcs: strip didnt work. I had to use gsub(/[\u200B-\u200D\uFEFF]/, '')
[21:23:20] BrianJ: Remote host closed the connection


[08:52:37] BrianJ: has joined #RubyOnRails
[08:56:46] BrianJ: I have a Student and a Councilor, they both have a has_one relationship with Profile. I am trying to order Student according to their councilor name. I am basicly trying to do: Student.includes(councilor: :profile).order("").referenecs(councilor: :profile). This orders it after the student name, not councilor can I fix this?
[08:57:05] BrianJ: ASC obviously*
[11:35:21] BrianJ: Remote host closed the connection


[04:15:01] BrianJ: has joined #ruby
[04:49:15] BrianJ: Ping timeout: 276 seconds
[18:33:04] BrianJ: has joined #ruby
[19:52:16] BrianJ: Is there a go to sound library that developers use for something like an accept/reject sound?
[20:31:45] BrianJ: Ping timeout: 276 seconds


[19:20:24] BrianJ: has joined #ruby
[22:46:38] BrianJ: Ping timeout: 258 seconds


[21:04:03] BrianJ: has joined #ruby
[21:06:19] BrianJ: Client Quit
[21:08:59] BrianJ: has joined #ruby
[21:21:53] BrianJ: Read error: Connection reset by peer
[21:24:35] BrianJ: has joined #ruby
[21:42:36] BrianJ: Ping timeout: 272 seconds


[05:00:25] BrianJ: Ping timeout: 244 seconds


[02:24:54] BrianJ: has joined #RubyOnRails
[02:24:58] BrianJ: has joined #ruby
[02:26:51] BrianJ: I'm trying to make a rest API call to a teamcity server and I'm getting #<Net::HTTPBadRequest:0x007fcd595c0138> Can anyone take a quick look at my code and let me know if I'm doing something obviously wrong?
[15:33:57] BrianJ: Quit: My MacBook Pro has gone to sleep. ZZZzzz…
[16:22:14] BrianJ: has joined #ruby
[16:22:14] BrianJ: has joined #RubyOnRails


[15:21:00] BrianJ: has joined #RubyOnRails
[18:12:03] BrianJ: Ping timeout: 252 seconds


[18:59:29] BrianJ: so have you tried npm?
[18:59:42] BrianJ: gem (bundler) is much much faster than npm
[22:29:54] BrianJ: ruby ruby ruby
[22:32:39] BrianJ: So yesterday I learned how to turn on and off a computer.
[22:32:58] BrianJ: First I confused turning on with turning off though.
[22:33:06] BrianJ: But both works the same way, isn't this fascinating?
[22:49:31] BrianJ: Is ruby endangered by nodejs?


[22:28:04] BrianJ: What's the best way to make parameters optional?
[22:28:17] BrianJ: pass in an options hash?
[22:28:24] BrianJ: parameters into a methood*
[22:29:04] BrianJ: ya.
[22:29:20] BrianJ: Basically I'd like to make aws_access_key optional
[22:29:37] BrianJ: would i do aws_access_key=nil?
[22:30:33] BrianJ: Is there a reason for not just using a hash?
[22:30:44] BrianJ: opts[:aws_access_key]
[22:31:04] BrianJ: not following
[22:31:36] BrianJ: I suppose it's a bit harder to debug
[22:31:40] BrianJ: w/ a hash
[22:32:45] BrianJ: ah ok. Makes sense


[15:09:56] BrianJ: what is the best way to check with line a word is on in a text file
[15:14:45] BrianJ: lets say I have a file that contains
[15:15:01] BrianJ: nvm, I'm going to just create a pastie and post it
[15:17:13] BrianJ:
[15:18:45] BrianJ: current I'm opening the file and doing an each_line
[15:20:39] BrianJ: i think with_index might solve my problem
[15:20:55] BrianJ: thanks. I'll mess with it a bit


[00:39:21] BrianJ: where it says "files to reference" does that mean I need to download them and put them in my assets dir


[22:54:12] BrianJ: is there a way to give rich text editing to text area?


[01:48:35] BrianJ: I have a search bar and I need it to move positions on the page when a user types something in (similar to google). Can anyone point me in the direction of how to do this? Do I need javascript to load a different page or something?


[18:18:53] BrianJ: Should i be storing my assets like images in my assets/ folder or in a CDN?
[18:23:31] BrianJ: ah ok. Thought there might be a rule of thumb
[18:23:42] BrianJ: i'll start messing around with it.


[14:21:41] BrianJ: Should i be rendering my images on my home page from my app/assets/images/ directory or from my CDN?
[14:21:57] BrianJ: cdn would be AWS cloudfront


[03:27:33] BrianJ: I'm using paperclip and i have a user model that has a has many through relationship with my asset model which is used to upload images. I need to set a "profile" pic from the uploaded assets that are tied to the user.. What is the best way to do this?
[04:37:00] BrianJ: I'm using paperclip and i have a user model that has a has many through relationship with my asset model which is used to upload images. I need to set a "profile" pic from the uploaded assets that are tied to the user.. What is the best way to do this?
[04:42:10] BrianJ: scyllinice: Ok so I need to create a profile_pic_id attribute i assume?
[04:43:08] BrianJ: t27duck: no, a user can upload as many pics as you want and I want them to be able to pick the one they want to be their profile pic. I hope that answers your question
[04:43:47] BrianJ: ok great, thanks
[04:53:07] BrianJ: Ok so I added a profile_pic attribute to my user model, but how do I let my user pick the image?
[04:53:33] BrianJ: do I add a checkbox to each image and if its checked, thats what the profile pic is set to?
[04:58:04] BrianJ: that seems like a better solution
[04:58:08] BrianJ: i'll do that for now
[18:48:36] BrianJ: Been working with this for a while, but not having much luck. I have a Dog model and a has many association with my asset model which uses paperclip for uploading images to AWS s3. My user has several images attached to it. I want my user to be able to choose the an image as the profile picture.
[18:49:02] BrianJ: I added an attribute to my dog model called profile_pic
[18:50:49] BrianJ: lol -.- i meant my dog has several images attached to it
[18:51:18] BrianJ: just replace dog with user in my description
[18:53:51] BrianJ: ya i guess i was vague now that i think about it. The problem is that I can have a collection (drop down) of my assets that are connected to my dog, but i want to be able to show the image and the user to choose that
[18:54:01] BrianJ: or more so… maybe they just select a check box
[18:54:11] BrianJ: next to an image thats already attached
[18:58:59] BrianJ: hm. the only problem is im not sure how to tie that back. I show all of the images, but those are for an upload section.
[18:59:03] BrianJ: here's the code


[02:39:26] BrianJ: I have a static file that I have in s3. I'd like to let my users download it. What is the best way to do this?
[02:39:30] BrianJ: im thinking send_file


[06:02:31] BrianJ: I'm having some issues with forms and removing fields
[06:03:01] BrianJ: for some reason its not letting me remove my "field" when i add a input option
[06:10:48] BrianJ: in my helper. One sec, I'll update the pastie
[06:11:13] BrianJ: new pastie
[06:13:37] BrianJ: macmartine: Not completely sure. I really leveraged railscasts I'm not sure what im doing with javascript
[06:17:31] BrianJ: ugh. the fix consisted of
[06:17:50] BrianJ: moving the %p.fields into the block
[06:18:31] BrianJ: could have sworn I had tried that
[06:23:44] BrianJ: nvm I seem to still be having a problem when I add my :caption into the field


[20:07:17] BrianJ: so i have several "dog" listings where I iterate over them using each.. I need to give them a specific order, what would the best way of doing this be?
[20:15:32] BrianJ: Problem with ordering
[20:17:45] BrianJ: theres no real method to it. Each dog needs to be listed in a specific position on the page
[20:18:53] BrianJ: sarmiena: global
[20:19:06] BrianJ: ill take a look at the railscast
[20:19:24] BrianJ: not sure why I didn't think to look there first -.-
[20:19:38] BrianJ: there will only be like 10-15 at max
[20:20:12] BrianJ: and the reordering is what is throwing me off… I could easily create a list off the bat, but when it needs to change, thats not very easy
[22:31:49] BrianJ: I created a method inside my "parents" controller called females. I then created a method called sort in the parents controller and added it to the parents collection with "post" when I go to update something using the post method I get a 404 saying localhost:300/parents/females is not found
[22:31:51] BrianJ: any ideas?
[22:35:39] BrianJ:
[22:36:00] BrianJ: added syntax highliting:
[22:36:31] BrianJ: lol. generally i do pasties. one sec I'll add it to gist
[22:38:38] BrianJ: ok I added a post alongside my get.
[22:38:54] BrianJ: I'm no longer getting a 404, however my ordering isn't changing
[22:39:18] BrianJ: what I'm trying to do is use jquery ui to change ordering of my dog listings on my page
[22:39:49] BrianJ: when I move my dog up and down it works, but when i refresh it goes backt o original localtion
[22:40:32] BrianJ: I'm doing Parent.update_all
[22:40:54] BrianJ: shouldnt that update the orderings of parent all together?
[22:42:39] BrianJ: workmad3: oic.. I thought thats what this does: $.post($(this).data('update-url'), $(this).sortable('serialize'))
[22:44:59] BrianJ: checking the logs, one sec
[22:46:39] BrianJ: it would seem not:
[22:46:40] BrianJ: Parameters: {"parent"=>["2", "4", "6"]}
[22:46:40] BrianJ: Processing by ParentsController#females as */*
[22:46:40] BrianJ: Started POST "/parents/females" for at 2013-08-26 18:45:15 -0400
[22:46:53] BrianJ: ops, sorry about the multi line post there
[22:57:59] BrianJ: thanks wordmad3
[22:58:10] BrianJ: workmad3 thanks


[14:10:58] BrianJ: how would i go about adding a caption to a photo that gets uploaded via paperclip?
[14:13:24] BrianJ: ok I have an asset model (basically the same thing I think). So I would just need to add an attr_accessible :caption and make that a string?
[14:13:32] BrianJ: and add a db migration etc


[01:19:02] BrianJ: I added a new field to my model and then when I go to update an object of that model i get "cannot mass assign permissions _destroy"
[01:19:04] BrianJ: any ideas?


[23:54:24] BrianJ: I'm using paperclip in my rails app and I have a model called asset that consitss of the image. I also have a join model to connect my model to my asset .. How would i add an extra attribute like "type" to my image that i upload with paperclip?


[06:40:04] BrianJ: In my edit page how do I show what assets have currently been uploaded using paperclip? this gives me just empy file upload fields
[22:00:10] BrianJ: How do i limit an .each to like 5 records returned? for instance @instance.each do |instance| and limit that to 5?
[22:02:37] BrianJ: tbuehlmann: undefined method `take'
[22:03:37] BrianJ: Instance class, active record base
[22:03:49] BrianJ: Instance model
[22:06:18] BrianJ: Instance.all
[22:06:24] BrianJ: Instance.fnd(:all)
[22:08:58] BrianJ: nevermind, i removed the find(:all) and tried using take(5). Once i added the find back, it worked
[22:09:07] BrianJ: thanks tbuehlmann
[22:10:06] BrianJ: Instance.find.imit(5)?
[22:10:14] BrianJ: Instance.find.limit(5)?*


[16:20:12] BrianJ: I have a datetime attribute and I want to display 8 weeks from that date.. how would I do this? Date.parse(@user.due_date.to_s + 56.days)
[16:20:30] BrianJ: is failing due to "can't convert ActiveSupport::Duration into String"
[16:20:47] BrianJ: due_date is a datetime attribute
[16:23:23] BrianJ: can't convert ActiveSupport::TimeWithZone into String
[16:24:50] BrianJ: that worked
[16:25:05] BrianJ: i did a to_date at the end


[01:08:27] BrianJ: having issues with a hash within a hash.. or atleast accessing it. Can anyone tell me what im doing wrong?
[01:08:58] BrianJ: one sec, i'll give you the error
[01:13:11] BrianJ: saying it cant convert symbol to string


[01:11:24] BrianJ: How would i go about making images that i have as thumbnails pop out larger?
[01:11:28] BrianJ: like to the full size?
[02:08:13] BrianJ: has anyone ever had an issue where you can't close a fancybox image?
[02:10:25] BrianJ: I'm using paperclip and when i click on my thumbnail image, it puts up the original sized image, but i cant close it
[02:32:01] BrianJ: i'd think so
[02:32:18] BrianJ: i've been struggling with this for a while now
[02:32:28] BrianJ: no clue whats wrong
[03:33:01] BrianJ: jaymiejones86: I actually figured out the problem. The stylesheets weren't loading. My issue is fixed. I just needed to include fancybox in my application.css
[03:33:40] BrianJ: ya. it's the small things that take up all your time :/


[22:42:42] BrianJ: How do I make a long running sentence go … so that it stays in my css block?
[22:45:00] BrianJ: how would I snip the chars? I found truncate, is that the correct way?
[22:47:45] BrianJ: Leighton: ya I think thats what I just found. It worked perfectly


[04:38:53] BrianJ: how do you get twitter bootstrap thumbnails to show multiple on a single row?
[04:39:26] BrianJ: I have a span of 1
[04:39:51] BrianJ: believe me I wouldnt come here if I hadn't been on that for the past hour or so
[04:40:46] BrianJ:
[04:41:09] BrianJ: it displays each drink on a seperate row
[04:42:44] BrianJ: jaymiejones86: Is that because I have a span of 1?
[04:43:06] BrianJ: because when i change it to span12, the single thumbnail takes up the entire row
[04:47:51] BrianJ: jaymiejones86: awesome, adding a span to the thumbnails worked… not sure why though.. mind explaining?


[00:42:18] BrianJ: How do I run this query from my rails app? I'd like to assign the return values to an @drinks variable
[00:46:29] BrianJ: erlingur: I want to look for all of the drinks that have the ingredients that are listed in my cabinet
[00:47:20] BrianJ: I went through hell and back building that painful sql statement :(
[00:48:14] BrianJ: marchtemp: bootstrap-sass is a good option
[00:55:16] BrianJ: rhizmoe: yes, but if i do Drink.joins(ingredients: :cabinet_ingredients).uniq I get results that don't completely match (only 1 ingredient is in the drink) and it doesnt take in account for the user
[05:45:10] BrianJ: In my has_one relationship why does it do model.1 in the route?
[21:01:06] BrianJ: Anyone know why in my has_one relationship my cabinet is gettting routed to cabinet.1?
[21:08:01] BrianJ: scient: using resources cabinet
[21:08:45] BrianJ: Oic, thought the has_one relationship wanted singular
[21:10:07] BrianJ: multiple cabinets. Each user has one
[21:11:43] BrianJ: Scient: Oh ok. thanks.


[22:15:12] BrianJ: if I wanted to do a sql query for an attribute of a model would it be Object.where(:attribute)?
[22:18:38] BrianJ: I have a has_many through relationship
[22:19:00] BrianJ: My drink has many ingredients… I want to query drinks by ingredients


[01:33:57] BrianJ: in jquery '#book_author_tokens' means that its going to look at the book model and find the author_tokens attribute?
[01:35:18] BrianJ: how would that get set?
[01:35:41] BrianJ: im follwing one of the railscasts, just trying to understand whats going on
[01:43:59] BrianJ: bleh in the railscast they dont show the view
[01:44:10] BrianJ: but ok, I get it… you reference it by the id tag
[01:51:32] BrianJ: So in a book form "f.text_field :author_tokens" would that build the id?
[01:51:52] BrianJ: of book_author_tokens
[01:52:03] BrianJ: im wondering if theres some rails magic going on
[03:52:49] BrianJ: Has anyone tried getting the tokenInput jquery plugin to work with a search box?
[03:53:59] BrianJ: Radar: I would, but I cant find much documentation on how to implement it… I'm having enough trouble just moving what Ryan Bates did with tokeninput to fit my app
[04:02:33] BrianJ: lol, jquery and js are a foriegn language to me right now. I was looking for something written in rails that I could look at and play with
[04:02:49] BrianJ: I'll look through that though.. Thanks