emers2n

Activity Graph

Page 1 of 2 | Next »

2019-07-12

[18:26:25] emers2n: has joined #RubyOnRails
[18:27:16] emers2n: I have a task in lib/tasks that takes awhile to run. Everytime I push to Heroku, it runs the task... How do I skip running tasks on compile?
[18:28:51] emers2n: Detecting rake tasks is the action
[21:20:39] emers2n: Ping timeout: 260 seconds

2019-04-21

[06:35:39] emers2n: Ping timeout: 256 seconds

2019-04-19

[23:03:27] emers2n: has joined #RubyOnRails

2019-03-11

[06:20:24] emers2n: has joined #RubyOnRails
[06:20:59] emers2n: When I push my RoR app to heroku, it runs the tasks once, but I only want the tasks to run when I have them scheduled. How can I prevent tasks from running on init?
[12:23:43] emers2n: Ping timeout: 256 seconds

2019-01-07

[13:17:53] emers2n: has joined #ruby
[13:20:30] emers2n: I'm struggling to format a hash with children to match a JSON request format: https://pastebin.com/raw/pUXGbCNE
[13:21:35] emers2n: has joined #RubyOnRails
[13:21:42] emers2n: I'm struggling to format a hash with children to match a JSON request format: https://pastebin.com/raw/pUXGbCNE
[13:26:14] emers2n: @catbusters Could not parse profiles. I'm assuming I'm not nesting the profiles correctly when manually define the hash
[13:32:09] emers2n: @catbusters Thanks. If my hash syntax isn't wrong it is a problem elsewhere.
[13:41:08] emers2n: go|dfish: Wow, thank you. That's exactly what I was doing wrong, and I've adjusted the code to see successful calls now.
[18:26:57] emers2n: Quit: Page closed

2018-12-05

[08:06:21] emers2n: has joined #RubyOnRails
[08:13:39] emers2n: Question: I have data submitted to a form. I want to take this form data and submit it to the Shopify API. However, I want some steps in the middle. What's the simplest way to temporarily store this data until I'm ready to submit to API without recreating the model? https://pastebin.com/raw/7aNBs7r3
[08:42:22] emers2n: Quit: Page closed

2018-12-01

[07:26:33] emers2n: Quit: Page closed

2018-11-30

[23:52:13] emers2n: has joined #RubyOnRails

2018-11-26

[14:15:20] emers2n: has joined #RubyOnRails
[14:17:20] emers2n: Got a question I've been racking by brain over... I use find to get an active record relation. Then I use a .each to iterate over each object. How the fuck do I end up with records still in @articles? https://dpaste.de/xgMa
[14:19:44] emers2n: I'm left with 2/5 objects after running .each to delete object... If I run the .each again, I'm left with 1 object, and again I'm left with 0
[16:14:04] emers2n: @tubbo It is 5.2.1. Instead of trying to run a .each, I've went with .reject, which is achieving the desired results
[16:14:54] emers2n: That's all I was trying to do, filter them from the active record relation variable
[16:16:54] emers2n: No. To be completely up front I was searching through my Shopify blog posts using the API: "@articles = ShopifyAPI::Article.find(:all, :params => {:limit => 250})". After that was retrieved, I wanted to search them by title and remove articles that don't match title (As API doesn't allow this).
[16:17:41] emers2n: Thank you for your response though!
[16:22:35] emers2n: Ping timeout: 256 seconds

2018-11-23

[16:37:03] emers2n: has joined #RubyOnRails
[16:37:41] emers2n: Happy Thanksgiving! What's the simplest way to fire the built in flash messages with JS/jQuery?
[16:38:24] emers2n: All the StackOverflow questions seemed to involve rolling their own
[18:24:43] emers2n: Ping timeout: 256 seconds

2018-04-29

[06:01:14] emers2n: has joined #RubyOnRails
[07:50:23] emers2n: Quit: Page closed

2018-04-14

[01:23:55] emers2n: Ping timeout: 260 seconds
[06:59:27] emers2n: has joined #RubyOnRails
[07:03:14] emers2n: I have a model that that has an integer field. I have a form in my view where they can edit this field. I want the field in the form for the user to be able to enter a string, after which in the controller I will convert it into an integer to save it. HOWEVER, Ruby on Rails is already converts the field in question to an integer when it sends it to the controller.
[07:04:30] emers2n: For example, I want them the user to be able to enter '1:30pm' in the form field, and then in the controller I want to convert it to an integer (90) to save it. However, when it gets to the controller it's already an integer (1:30am converted to 1)
[07:04:51] emers2n: Is there a simple way to solve this?
[15:26:15] emers2n: Ping timeout: 260 seconds

2018-04-13

[22:45:30] emers2n: has joined #RubyOnRails

2018-04-12

[20:02:31] emers2n: has joined #RubyOnRails
[22:24:35] emers2n: Ping timeout: 260 seconds

2018-04-11

[00:21:20] emers2n: Ping timeout: 260 seconds
[00:25:31] emers2n: has joined #RubyOnRails
[00:25:53] emers2n: snc123: My IRC client timed out... If it wasn't answered... What kind of authentication are you looking for?
[00:31:40] emers2n: +1 for Devise
[00:32:43] emers2n: As a newb to rails I had no problems getting Devise running... Lots of guides and tutorials out there too to follow along
[00:46:25] emers2n: Ping timeout: 260 seconds
[02:58:39] emers2n: has joined #RubyOnRails
[09:58:50] emers2n: Ping timeout: 260 seconds

2018-04-10

[23:45:21] emers2n: has joined #RubyOnRails
[23:46:06] emers2n: Hey all... Got a pretty simple Rails question. If I want to define a function that I need to be able to call from 2 different controllers, where should I define said function?
[23:48:02] emers2n: Radar: Awesome, Ty!
[23:55:47] emers2n: Start coding

2018-04-06

[02:36:58] emers2n: has joined #RubyOnRails
[02:38:46] emers2n: If I wanted to be able to call a Javascript file in my Rails app externally, where would I place the Javascript file to make this possible? For example, if I wanted to be able to call my JS file using a URL like https://calm-retreat-XXX.herokuapp.com/javascripts/script.js
[02:41:22] emers2n: That worked beautifully, appreciate it @sevenseacat
[03:34:55] emers2n: Ping timeout: 260 seconds

2017-11-19

[22:19:50] emers2n: has joined #RubyOnRails
[22:38:45] emers2n: Ping timeout: 260 seconds

2017-11-13

[03:39:11] emers2n: has joined #ruby
[03:40:08] emers2n: has joined #RubyOnRails
[13:07:59] emers2n: Quit: Page closed

2017-10-27

[03:29:12] emers2n: Quit: Page closed

2017-10-26

[21:23:26] emers2n: has joined #RubyOnRails

2017-10-25

[00:54:35] emers2n: Ping timeout: 260 seconds

2017-10-24

[22:53:21] emers2n: has joined #RubyOnRails

2017-08-16

[07:23:17] emers2n: has joined #RubyOnRails
[07:23:54] emers2n: local host or production
[09:30:14] emers2n: Ping timeout: 260 seconds

2017-08-15

[20:32:12] emers2n: has joined #RubyOnRails
[22:14:44] emers2n: Ping timeout: 260 seconds

2017-08-14

[03:20:49] emers2n: has joined #RubyOnRails
[07:53:42] emers2n: hackeron check config/cable.yml
[07:55:37] emers2n: If you don't need redis then why not comment that out
[08:02:01] emers2n: https://stackoverflow.com/questions/13096531/deploying-redis-on-heroku-when-manually-precompiling-assets
[08:08:51] emers2n: This is probably retarded but would wrapping in a try allow you to slip through in assets:precompile?
[08:10:48] emers2n: Ah I see. Beyond my current understanding and skill level, but gl
[08:26:17] emers2n: Cause it aint on the list prolly https://docs.python.org/2/library/time.html
[08:28:52] emers2n: Use DateTime
[08:29:23] emers2n: Which shows %3N is valid: https://apidock.com/ruby/DateTime/strftime
[08:29:48] emers2n: Lol Oh my I linked Python earlier
[08:29:56] emers2n: Just disregard everything i said
[08:35:49] emers2n: dazonic use %L instead of %3N
[08:43:55] emers2n: Yep cheers. You can print with %L too, but %N is the fractional digit seconds, so %3N is milliseconds or 3 digits, %6N microseconds or 6 digits, etc
[09:41:59] emers2n: Ping timeout: 260 seconds
[18:38:20] emers2n: has joined #RubyOnRails
[19:20:10] emers2n: I'm attempting to add click to load javascript pagination with the will_paginate plugin. I'm getting the javascript error GET http://localhost:3000/?page=2 500 (Internal Server Error), but when I visit the page myself it works fine. Any debug tips?
[19:22:09] emers2n: Nvm, figured it out
[20:06:44] emers2n: Ping timeout: 260 seconds
[22:40:25] emers2n: has joined #RubyOnRails
[23:22:09] emers2n: Ping timeout: 260 seconds

2017-08-12

[02:35:21] emers2n: has joined #RubyOnRails
[03:42:44] emers2n: Ping timeout: 260 seconds
[04:34:16] emers2n: has joined #RubyOnRails
[06:37:44] emers2n: Ping timeout: 260 seconds

2017-08-11

[22:30:15] emers2n: has joined #RubyOnRails
[23:07:24] emers2n: Ping timeout: 260 seconds

2017-08-09

[03:35:25] emers2n: has joined #RubyOnRails
[03:35:48] emers2n: Can the ruby gem Crono be used with Heroku, or do I need to use the Heroku scheduler?
[04:18:58] emers2n: Just got my 3rd free rails app finished and on Heroku!!!!
[04:19:17] emers2n: I made an Amazon price checker. Check it out: http://www.pastpricing.com/
[04:20:15] emers2n: Shout out to havenwood for helping with the graph date mapping
[04:21:23] emers2n: Thank you kindly Radar!
[04:56:48] emers2n: Thanks sevenseacat. What do you think about the design?
[06:23:04] emers2n: If I had the following code: if(!first_matching_item_hash["ItemAttributes"]["ListPrice"]["FormattedPrice"].nil?)
[06:23:24] emers2n: And ListPrice is defined but FormattedPrice isn't, it works fine. But if ListPrice isn't defined it breaks.
[06:23:50] emers2n: Is it possible to include the parent elements in the .nil check easily?
[07:17:37] emers2n: Has anyone here used a Procfile w/ Heroku?
[10:01:09] emers2n: Ping timeout: 260 seconds

2017-08-08

[06:18:20] emers2n: has joined #RubyOnRails
[07:32:44] emers2n: Ping timeout: 260 seconds
[07:47:28] emers2n: has joined #RubyOnRails
[07:49:05] emers2n: Is it possible to get the development error pages on product (heroku app)? http://i.imgur.com/nVxJCz9.png
[07:49:11] emers2n: production*
[07:57:56] emers2n: I'll just stick to the logs in that case, thanks
[10:10:49] emers2n: Ping timeout: 260 seconds
[19:53:41] emers2n: has joined #RubyOnRails
[21:53:44] emers2n: Ping timeout: 260 seconds

2017-08-07

[02:48:29] emers2n: has joined #RubyOnRails
[02:49:21] emers2n: So my devise gem sends mail but my own attempts at sending mail locally have failed.
[02:54:36] emers2n: Any debug tips?
[02:58:18] emers2n: Can't find one unfortunately
[02:58:30] emers2n: I've checked the console log and the debug log
[02:58:44] emers2n: The mail is sent within a job which might have something to do with it
[02:59:12] emers2n: I followed this guide (Except for the last step to use sendgrid): https://sendgrid.com/docs/Integrate/Frameworks/rubyonrails.html
[03:05:35] emers2n: For now I want to just send it via localhost like the Devise Mailer is able to do somehow?
[03:06:25] emers2n: It sound silly you'd be able to send mail without entering SMTP info for sending but Devise does it
[03:08:07] emers2n: Nope - the devise gem can send mail on development out of the box
[03:08:33] emers2n: Let's bet $5
[03:14:42] emers2n: Yep, I receive mail from please-change-me-at-config-initializers-devise@example.com (default) at my gmail account for password reset and other devise functions
[03:16:44] emers2n: What's interesting is if you change the sending address it breaks though
[03:17:26] emers2n: True story
[03:18:24] emers2n: It only works if it's set to please-change-me-at-config-initializers-devise@example.com
[03:19:00] emers2n: Yes breaks meaning I don't see the mail anymore
[03:20:25] emers2n: What y'all are saying is if you do the following steps (1) Create New Rails App (2) Install Devise Gem & Follow Devise Setup Instructions, mail won't actually be delivered?
[03:22:10] emers2n: Is this configuring a mail method? Adding: config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } to config/environments/development.rb
[03:22:46] emers2n: Or by configuring some mail method do you mean the SMTP outgoing settings?
[03:25:39] emers2n: No it works but it appears only if you use an "@example.com" email
[03:26:03] emers2n: So to use any other email address you do need the outgoing settings but for some reason xyz@example.com emails are delivered
[03:26:37] emers2n: Lol yes, it is
[03:26:42] emers2n: Only example.com though
[03:26:46] emers2n: Obviously I can't use gmail.com
[03:27:39] emers2n: Lol I promise
[03:27:53] emers2n: Give me one of your emails and I'll send you a password reset email from test@example.com
[03:29:10] emers2n: in development it is set to :smtp
[03:30:00] emers2n: Is it possible example.com has set up their smtp settings to be allowed mail testing?
[03:30:24] emers2n: Well no, that is default
[03:32:34] emers2n: Sorry, yes you both are correct
[03:33:13] emers2n: So example.com is basically set up as a utility to allow for email testing? Still confused why emails are delivered
[03:34:00] emers2n: Doesn't SMTP need like a username, password, outgoing server, port #, etc?
[03:35:24] emers2n: Like are you saying the emails from test@example.com aren't being delivered?
[03:38:17] emers2n: matthewd: I am simply trying to deliver my own email in the development similiar to how devise is able to
[03:42:28] emers2n: I don't want to change the sender address. I want to send mail from test@example.com so I can test out the mailer in the development environment similiar to how devise does it. No worries though, I'm going to look more into the mailer functions so I have a better grasp of what's going on
[03:46:50] emers2n: weiyang: I'm pretty good with frontend if you have a live example I can take a look
[03:51:04] emers2n: I installed the app weiyang
[03:51:13] emers2n: It's because of the 'collapse' class
[03:52:37] emers2n: weiyang: The 'collapse' class on the parent element has a default style of display none, and only show's display block when the screen width is greater than 768px
[03:52:59] emers2n: <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
[03:53:46] emers2n: #bs-example-navbar-collapse-1 { display: block !important; }
[03:53:52] emers2n: That's shitty but it should work
[03:54:10] emers2n: Well it does work I already tested it
[03:55:28] emers2n: sevenseacat: Are you sighing at my dirty code?
[03:56:54] emers2n: I told him exactly what his problem is. How is the advice bad? Yes the code is poor practices but the only thing I can recommend without going in depth into his code
[03:58:39] emers2n: Cool. How is my advice bad?
[03:59:27] emers2n: There's a difference between my bad code and my bad advice apparently
[03:59:38] emers2n: > Are you sighing at my dirty code?
[03:59:42] emers2n: > and your bad advice
[04:05:50] emers2n: Here's the official correct fix weiyang: https://pastebin.com/raw/Gw3Ttw6M
[06:23:32] emers2n: Quit: Page closed

2017-08-05

[01:00:50] emers2n: has joined #RubyOnRails
[02:43:14] emers2n: Ping timeout: 260 seconds

2017-08-03

[04:09:18] emers2n: has joined #RubyOnRails
[04:10:15] emers2n: Could someone explain what the multiplication/asterisk (*) means here: myCustomHash.inject(Hash[ *myCustomHash.first ]) do |tmp,kv|
[04:13:23] emers2n: has joined #ruby
[04:13:26] emers2n: Could someone explain what the multiplication/asterisk (*) means here: myCustomHash.inject(Hash[ *myCustomHash.first ]) do |tmp,kv|
[04:30:07] emers2n: Radar: So it's being used in this case to grab the first item without altering the hash?
[04:31:31] emers2n: Radar: Okay, thank you.
[04:39:04] emers2n: Yep, I see the difference. Thanks.
[04:53:54] emers2n: I have a piece of code which is very close to behaving how I want. Doodle here w/ comments : Any help would be appreciated
[04:53:56] emers2n: https://www.jdoodle.com/a/4Wn
[04:58:14] emers2n: still need that worknick?
[05:00:59] emers2n: any idea Radar?
[05:06:56] emers2n: krmela: I'll tell you if you can solve this: https://www.jdoodle.com/a/4Wn
[05:28:14] emers2n: havenwood: I've been trying to figure this out for past two hours > any ideas?
[05:28:20] emers2n: https://www.jdoodle.com/a/4Wn
[05:29:39] emers2n: I'm sorry?
[05:31:04] emers2n: Thanks, but my question is how to essentially reverse a part of the code here: https://www.jdoodle.com/a/4Wn
[05:32:34] emers2n: havenwood: Cheers. Compare Desired vs Actual Output to see what the issue is the quickest
[05:46:08] emers2n: havenwood: awesome, I'll check that out. Thanks so much
[05:49:05] emers2n: havenwood: Well now that I have that I can just loop through from the start date and if null is encountered it is set to the previous date's vale
[09:39:49] emers2n: Ping timeout: 260 seconds

2017-08-01

[04:29:45] emers2n: has joined #ruby
[04:30:11] emers2n: Yo check out this totally insane question
[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:53] emers2n: I was hoping man
[04:34:34] emers2n: I was hoping
[05:15:58] emers2n: Could anyone let me know what this 13 digit date format seen here called: https://jsfiddle.net/Regisc/kbdn6dpp/
[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:23:26] emers2n: sevenseacat: Thanks! You are correct. Very helpful! "unix timestamp milliseconds ruby" in google lead to the right answer.
[05:31:36] emers2n: cjohnson: good to know
[08:15:54] emers2n: Ping timeout: 260 seconds

2017-07-31

[19:17:10] emers2n: 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?
[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
[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:24] emers2n: Well you're gonna learn today
[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: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:55:28] emers2n: Exactly, it makes sure that it performs exactly the way Rails expects

2017-07-25

[02:06:54] emers2n: I have a table called priceHistories where I check the price of a certain Amazon product every few hours and save it. If I wanted to go about graphing this data, any ideas on how I could go about removing some of the excess data (Adjusting hourly data to a daily price)?
[02:12:28] emers2n: agent_white: So I have price checks every 4 hours (so I have 6 price checks per day). I essentially want to get the last price check for every day so I can graph the price as a daily price graph
[02:12:54] emers2n: Not really sure where to begin in rails for doing that sort of a query
[02:13:53] emers2n: That's a much simpler way to put it, yes
[02:14:05] emers2n: good idea muzik
[02:14:30] emers2n: If I have months of pricing data though, will that be slow do you think?
[02:14:45] emers2n: in which case I could build a separate table with only the daily prices
[02:15:57] emers2n: Because the primary function of the app is to detect price changes. For example if I want to be notified if a amazon product goes below the price xyz, so it makes sense to check multiple times in this case
[02:16:35] emers2n: I'm basically making my own version of this: https://thetracktor.com/detail/B00YPISRR6/
[02:17:09] emers2n: I thought about that muzik
[02:18:32] emers2n: In order to notify if the price changes
[02:19:22] emers2n: It doesn't matter only at the end of the day
[02:19:35] emers2n: If the price changes in the middle of the day and it hits my price point I want to be notified of it
[02:19:58] emers2n: But for the secondary function (the daily graph), I only need a daily price point
[02:21:46] emers2n: Yes, I am going to try that. Thank you for the suggestion. I was just trying to answer your questions
[02:22:30] emers2n: I have 4 price checks saved for day, but I want only 1 price for each day, yes.
[02:23:35] emers2n: the last one probably makes the most sense
[02:24:16] emers2n: It would make sense if I only saved the price if it has changed, but then it is more difficult to tell if something went wrong
[02:30:03] emers2n: muzik: Yeah great point there. I can certainly clean up the price checks after the day is over
[02:30:09] emers2n: Thanks for the insight!
[02:43:06] emers2n: agent_white: because the primary function of the app is to alert the user if the amazon price goes below their desired price, so they are able to buy it.
[02:43:45] emers2n: Happy to hear
[08:59:39] emers2n: Ping timeout: 260 seconds

2017-07-24

[22:51:58] emers2n: Hey y'all. Got a complicated query question I was hoping someone could point me in the right direction on. Snippet here: https://pastebin.com/raw/z7EvmV30
[22:52:43] emers2n: Basically I want to group by both date and price
[22:58:32] emers2n: Afternoon Tim