« Back to channel list

#RubyOnRails - 19 July 2016

« Back 1 day Forward 1 day »
[00:00:24] cnk: OK delete when they apply a reversing ledger entry
[00:00:38] cnk: how do they resolve open deposits?
[00:00:53] cnk: 'cause you can't keep my $$$
[00:02:01] amperry: application fees are non-refundable
[00:02:27] amperry: the deposit is applied to the first month's rent
[00:06:22] amperry: that's why I don't know what the best thing to do is: create a new Model which duplicates information in other tables, or use some kind of hybrid controller?
[00:06:28] amperry: or something else?
[00:08:31] mdw: has joined #RubyOnRails
[00:08:37] quazimodo: has joined #RubyOnRails
[00:08:40] quazimod1: has joined #RubyOnRails
[00:09:03] amperry: also, it should be noted that I'm basing this on a 20-year old gui frontend to an MS-Access data set, and the client has no idea what the code actually does, but doesn't want to change their modus operandi. The original code is inaccessible and the original programmer is no longer in contact with them.
[00:09:32] flashpoint9: has joined #RubyOnRails
[00:13:37] dennis__: has joined #RubyOnRails
[00:14:33] flashpoint9: has joined #RubyOnRails
[00:15:09] dennis__: I need to render a modal from a controller, any idea on how can I do this?
[00:17:50] amperry: dennis__: that's kind of MVC in a nutshell, and Rails' raison d'etre. Are you saying you need to render it in some other format than in an html view?
[00:19:29] dennis__: hello amperry, what I need is, when I clcik on a button I need to check if the user doesn’t have a profile picture, if that’s the case I need to render a modal so the user can add his profile picture, after that I need to send an email
[00:21:13] amperry: dennis__: ah... a modal dialogue, and not a model, yes?
[00:21:16] Velizar: has joined #RubyOnRails
[00:21:21] amperry: or a modal *something*
[00:21:51] dennis__: a modal dialogue
[00:25:03] flashpoint9: has joined #RubyOnRails
[00:27:34] amperry: dennis__: not sure... I don't quite know what you mean by "from the controller", but if I were to want to do something like that, I'd have a form field for that in the view, and use javascript to determine if it has been populated when the user clicks "submit". You could also hide it with css and only have it show if it hasn't been filled, but again, that's view and javascript stuff.
[00:28:15] dennis__: got it thanks amperry
[00:29:02] zacts: has joined #RubyOnRails
[00:29:34] amperry: good luck, and maybe someone else might be able to help with the email stuff. I don't do anything with it myself, but maybe this could point you in the right direction: http://guides.rubyonrails.org/action_mailer_basics.html
[00:30:03] dennis__: what I mean about “from the controller” is that in the case the user already have a profile picture I just need to send the email
[00:30:28] dennis__: but if the user doesn’t have a profile picture I need to show the modal
[00:30:59] amperry: dennis__: yeah, pretty sure css and js in the view is the thing you'd want, then.
[00:32:14] ElFerna: has joined #RubyOnRails
[00:35:31] Jasaka|NA: has joined #RubyOnRails
[00:35:58] mikeiniowa: has joined #RubyOnRails
[00:37:04] blackmesa: has joined #RubyOnRails
[00:43:40] ekinmur: has joined #RubyOnRails
[00:44:57] djbkd: has joined #RubyOnRails
[00:46:38] Velizar: Is it possible to have multiple forms of the same model at the same page? Because the ids of the input fields are repeating: each Trip's form has an input with id='trip_completed'.
[00:47:45] Velizar: actually I think I just found a solution
[00:48:29] ElFerna: has joined #RubyOnRails
[00:51:29] rodfersou: has joined #RubyOnRails
[00:54:42] cd-rum: has joined #RubyOnRails
[00:58:45] AndrewIsHere: has joined #RubyOnRails
[00:58:58] cd-rum_: has joined #RubyOnRails
[00:59:00] antgel: has joined #RubyOnRails
[01:02:53] xall_: has joined #RubyOnRails
[01:03:29] superlou: has joined #RubyOnRails
[01:03:44] flashpoint9: has joined #RubyOnRails
[01:07:41] Oliphaunte: has joined #RubyOnRails
[01:10:19] User458764: has joined #RubyOnRails
[01:11:38] sevenseacat: has joined #RubyOnRails
[01:14:07] zacts: has joined #RubyOnRails
[01:15:31] wd40s: has joined #RubyOnRails
[01:18:14] oystersauce8: has joined #RubyOnRails
[01:20:16] jstransky: has joined #RubyOnRails
[01:21:32] moeabdol3: has joined #RubyOnRails
[01:22:35] AntiSpamMeta: has joined #RubyOnRails
[01:24:28] A_Drone: has joined #RubyOnRails
[01:27:52] AntiSpamMeta: has joined #RubyOnRails
[01:29:34] tanuki: has joined #RubyOnRails
[01:37:47] A_Drone: has joined #RubyOnRails
[01:39:39] blackmesa: has joined #RubyOnRails
[01:40:59] AntiSpamMeta: has joined #RubyOnRails
[01:44:25] rafaelflores: has joined #RubyOnRails
[01:48:50] andrecastelo: has joined #RubyOnRails
[01:50:38] andrecastelo: guys I'm having an issue -> using MySQL, I can't connect to the database using rake db:migrate. I'm certain the password is set to an env variable, and I can login to mysql using the user/pass I've set up
[01:50:42] roamingdog: has joined #RubyOnRails
[01:51:00] andrecastelo: however rake keeps complaining about access denied. I've checked phpmyadmin and I have access to the database
[01:51:12] andrecastelo: (using the user/pass in the config)
[01:51:52] andrecastelo: also have all privileges on the database associated with rails
[01:52:43] fryguy: andrecastelo: show your database.yml file
[01:53:56] andrecastelo: fryguy: http://hastebin.com/ukihiziqab.vala
[01:55:12] fryguy: andrecastelo: and what environment are you running in
[01:55:31] fryguy: and how are you running db:migrate
[01:55:31] paradisaeidae_: has joined #RubyOnRails
[01:55:55] andrecastelo: rake db:migrate
[01:56:05] fryguy: is RAILS_ENV set?
[01:56:44] A_Drone: has joined #RubyOnRails
[01:56:55] fryguy: then you aren't in production
[01:56:58] fryguy: you need to set that
[01:57:00] xall_: has joined #RubyOnRails
[01:57:20] andrecastelo: I had set that on the apache config
[01:57:31] andrecastelo: like: RailsEnv production
[01:57:50] andrecastelo: oh, I need to export it too
[01:58:15] andrecastelo: awesome, thanks fryguy, it worked
[01:58:28] ekinmur: has joined #RubyOnRails
[02:00:03] AndrewIsHere: has joined #RubyOnRails
[02:01:17] fryguy: your apache config isn't in effect from the terminal
[02:02:33] A_Drone_: has joined #RubyOnRails
[02:03:59] amperry: has joined #RubyOnRails
[02:05:08] amperry: hi all, anyone want to take a look at https://gist.github.com/amp108/243573e33e0844af0a1cef15d1dbfe61 and say what the ActiveRecord Query equivalent of that sql would look like?
[02:05:20] A_Drone: has joined #RubyOnRails
[02:09:29] triptec: has joined #RubyOnRails
[02:17:52] CanTonic: has joined #RubyOnRails
[02:18:41] xall_: has joined #RubyOnRails
[02:23:27] andrecastelo: fryguy: another issue, unrelated to the first one: i restarted apache but apparently passenger didn't restart the app. when I run passenger-status I get back that passenger isn't serving any apps
[02:23:31] andrecastelo: same with passenger-config restart
[02:24:03] A_Drone: has joined #RubyOnRails
[02:24:14] andrecastelo: passenger-config validate-install returns everything is correct
[02:24:46] Mirubiri: amperry: it should be that exact query?
[02:25:44] ekinmur: has joined #RubyOnRails
[02:26:06] weaksauce: has joined #RubyOnRails
[02:29:44] amperry: Mirubiri: very close to that
[02:30:00] Mirubiri: very close mmm
[02:31:33] wd40s: has joined #RubyOnRails
[02:31:37] GnuYawk: has joined #RubyOnRails
[02:32:01] phredus: has joined #RubyOnRails
[02:32:48] amperry: Mirubiri: i.e., I could take everything from both models, I don't just need the name from Resident.
[02:37:10] andrecastelo: any ideas on the issue re: passenger not serving any apps?
[02:39:54] A_Drone_: has joined #RubyOnRails
[02:40:54] nettoweb: has joined #RubyOnRails
[02:41:02] blackmesa: has joined #RubyOnRails
[02:43:46] capin: good evening, anyone here use the stripe API before in rails app
[02:44:38] Mirubiri: amperry: try this, I didn't wrote an ActiveRecord query for a while so: Ledger.join(:residents).where(residents:{is_active: 1,apt_id:nil,lease_id:nil},ledgers:{transaction_type_id:nnn})
[02:45:21] Mirubiri: amperry: you can switch join to include depending on your models
[02:45:49] edwinvdgraaf: has joined #RubyOnRails
[02:46:02] A_Drone: has joined #RubyOnRails
[02:46:05] benlieb: has joined #RubyOnRails
[02:46:05] carpeliam: has joined #RubyOnRails
[02:46:17] andrecastelo: Mirubiri: do you have experience with passenger + apache?
[02:46:33] Mirubiri: nop, sorry :\
[02:47:00] andrecastelo: I'm pretty new, and when I restarted apache somehow passenger didn't start the app too
[02:47:36] Mirubiri: I have found this andrecastelo
[02:47:38] Mirubiri: https://www.phusionpassenger.com/library/admin/apache/restart_app.html
[02:47:42] Mirubiri: hope it helps
[02:48:59] dkam: has joined #RubyOnRails
[02:49:45] andrecastelo: thanks for the docs Mirubiri
[02:50:00] andrecastelo: however one key feature it talks about is how restarting apache automatically restarts passenger + apps
[02:50:02] andrecastelo: but it didn't work here
[02:51:14] andrecastelo: dunno, it only says Passenger isn't serving any applications
[02:52:40] amperry: Mirubiri: not quite, but I think I'll be able to work with that and find what I need, thanks.
[02:53:40] Mirubiri: andrecastelo: and your app is started?
[02:53:45] andrecastelo: Phusion Passenger is currently not serving any applications.
[02:53:45] andrecastelo: Phusion Passenger is currently not serving any applications.
[02:54:00] andrecastelo: sorry for the flood, btw
[02:54:08] Mirubiri: so you want it to start automatically
[02:54:29] andrecastelo: yeah, or not, I just want it to start :D
[02:54:54] Mirubiri: do you have a shell?
[02:55:10] andrecastelo: what do you mean ?
[02:55:33] Mirubiri: can you start it manually with a command?
[02:55:50] A_Drone: has joined #RubyOnRails
[02:55:50] andrecastelo: I don't think so
[02:56:03] andrecastelo: Passenger has a stand alone version, but for some other reason it is not working
[02:56:27] Mirubiri: but you should have a configuration file or something like that
[02:56:47] andrecastelo: yeah, I have the apache configs
[02:57:36] carpeliam: I’m deploying an app with ActionCable to Cloud Foundry, and getting a 404 on the websocket connection - really struggling to figure out how to debug this. anybody have any advice?
[02:58:50] ekinmur: has joined #RubyOnRails
[02:59:15] CodingWolf: has joined #RubyOnRails
[03:00:56] dguettler: has joined #RubyOnRails
[03:02:02] hinbody: has joined #RubyOnRails
[03:02:12] cd-rum: has joined #RubyOnRails
[03:02:51] Mirubiri: andrecastelo I can't help you, I don't have enough knowledge about passenger
[03:03:29] andrecastelo: Mirubiri: thanks anyways!
[03:03:41] Mirubiri: you're welcome
[03:03:49] kevr: has joined #RubyOnRails
[03:03:59] A_Drone: has joined #RubyOnRails
[03:05:14] dguettler: Hi, does anybody know if the behavior between Rails 4.2 and 5.0 changed in regards to `helper_methods` defined in a controller which raise a ActiveRecord::RecordNotFound exception. Observed behavior; Rails 4.2 the ActiveRecord::RecordNotFound is handled by declared `rescue_from` clause when tripped in the rendered template. In Rails 5 a 500 Exception is
[03:07:56] leea: has joined #RubyOnRails
[03:09:22] wd40s: has joined #RubyOnRails
[03:10:29] sevenseacat: dguettler: a 500 should never be thrown by a RecordNotFound
[03:11:43] pawnbox: has joined #RubyOnRails
[03:12:09] dguettler: @sevenseacat well it is, if the ActiveRecord::RecordNotFound is thrown within the template (haml). We triggered within the controller action, the `rescue_from` declaration kicks in correctly
[03:12:28] sevenseacat: dguettler: why are you looking up records in a view
[03:13:03] pawnbox: has joined #RubyOnRails
[03:13:34] dguettler: sevenseacat: I'm not exactly looking up records in the view. I define a method on the controller (exposed as a helper_method) which does the lookup lazily.
[03:13:52] sevenseacat: dguettler: can you gist your code/error/etc?
[03:15:47] braincrash: has joined #RubyOnRails
[03:16:05] dguettler: sure hold on, putting an example together...
[03:16:25] sevenseacat: let's use your actual code, not a contrived example
[03:16:27] wd40s: has joined #RubyOnRails
[03:17:19] A_Drone: has joined #RubyOnRails
[03:19:59] zacts: has joined #RubyOnRails
[03:21:00] k3rn31: has joined #RubyOnRails
[03:23:03] jishankai: has joined #RubyOnRails
[03:23:21] treaki__: has joined #RubyOnRails
[03:26:00] wethu: has joined #RubyOnRails
[03:28:26] A_Drone_: has joined #RubyOnRails
[03:32:34] A_Drone: has joined #RubyOnRails
[03:34:53] wd40s: has joined #RubyOnRails
[03:38:41] zacts: has joined #RubyOnRails
[03:40:21] dguettler: sevenseacat: here you go https://gist.github.com/dguettler/93673b10fa74612e9b2d023b4d898d2e
[03:41:42] dguettler: however meanwhile I also figured out that using a contrived example in a fresh Rails app using erb template I'm unable to reproduce the issue
[03:41:47] blackmesa: has joined #RubyOnRails
[03:43:43] A_Drone: has joined #RubyOnRails
[03:45:35] AndrewIsHere: has joined #RubyOnRails
[03:48:21] dguettler: Umm, now the fun part begins, comparing which gem dependency makes the difference...
[03:48:47] A_Drone: has joined #RubyOnRails
[03:53:06] Radar: guardian.evaluation_templates.find(params[:id].to_i)
[03:53:07] Radar: Why to_i?
[03:54:31] sevenseacat: I would think the 500 is not caused by the AR::RecordNotFound
[03:54:45] sevenseacat: but by something else
[03:54:48] sevenseacat: what do your logs say?
[03:57:19] kevr: has joined #RubyOnRails
[03:57:22] dguettler: sevenseacat: I included them in the Gist. Earlier today, I explicitly captured and re-raised the AR Exception causing described issue in the template
[03:58:34] dguettler: Radar: yeah I know it's probably not required anymore. It is a left over of a security audit from a company which doesn't know much about Rails
[03:59:02] sevenseacat: ok, so what's on the error page when it renders a 500?
[04:00:05] dguettler: don't know actually, only running by test cases. The issue was reported by a co-worker
[04:00:14] sevenseacat: time to look :)
[04:01:47] wd40s: has joined #RubyOnRails
[04:03:29] dguettler: it shows the expected development error message from Rails: ActiveRecord::RecordNotFound in EvaluationTemplatesController#show and a 500 error in the logs
[04:06:26] kevr: has joined #RubyOnRails
[04:11:34] daffy_duck_2: has joined #RubyOnRails
[04:13:08] djbkd: has joined #RubyOnRails
[04:17:14] papabur: has joined #RubyOnRails
[04:18:08] papabur: anyone here know ezmobious?
[04:18:27] papabur: Helped create EngineYard
[04:18:32] xall_: has joined #RubyOnRails
[04:19:08] Radar: papabur: Do you mean know him personally?
[04:19:16] dguettler: papabur: specify "know"
[04:19:58] dguettler: sevenseacat: I added a comment to the Gist explaining the source of the issue - in case you're interested
[04:21:12] dguettler: papabur: and "know" is probably the wrong time, saidly Ezra died 2 years ago
[04:21:26] triptec: has joined #RubyOnRails
[04:21:31] papabur: he was a close friend of mine
[04:21:37] papabur: i helped design the aluminatus
[04:21:39] papabur: at trinitylabs
[04:21:43] sevenseacat: dguettler: that description doesnt make a lot of sense
[04:22:01] papabur: im looking to start learning RoR in his memory, I also have a website dedicated to him where i sell 3d printer kits: http://mobious.org
[04:22:04] sevenseacat: but I'll take your word for it
[04:22:09] dguettler: sevenseacat: what doesn't make much sense?
[04:22:09] papabur: i have a decent grasp on it
[04:22:32] papabur: Radar: not so much personally, jus familiar with the name i suppose
[04:23:42] Radar: papabur: Well, he built merb which inspired quite a lot of the changes in Rails 3. He was going to write the Rails 3 in Action book with Yehuda Katz, but both backed out of that project. I then took it over.
[04:24:09] Radar: sorry, he was going to write "Merb in Action", which then BECAME Rails 3 in Action... I'll get my history right one day.
[04:24:14] sevenseacat: didn't know that part
[04:24:36] papabur: thats cool man
[04:24:51] papabur: he was a good guy.
[04:24:56] papabur: taught me so much..
[04:25:06] papabur: i was out of town the day he went down
[04:25:26] papabur: anywho, nice to meet yo uRadar
[04:25:47] Radar: Yeah he was a great member of the community. Sad to have lost him.
[04:25:52] Radar: Good to meet you too, papabur.
[04:26:22] dguettler: papabur: thanks for keeping his memories alive, I only "knew" him briefly from some email conversations long time ago umm must have been around Rails 1.x
[04:27:39] carpeliam: has joined #RubyOnRails
[04:28:48] whathappens: has joined #RubyOnRails
[04:29:12] Hyuk: has joined #RubyOnRails
[04:31:39] carpeliam: anybody know why an ActionCable request would get a 404 only in production? All I see in the rails log is `Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: close, HTTP_UPGRADE: )`
[04:32:22] wd40s: has joined #RubyOnRails
[04:35:14] dkam: has joined #RubyOnRails
[04:36:10] A_Drone: has joined #RubyOnRails
[04:42:40] DoctorMonocular: has joined #RubyOnRails
[04:43:11] blackmesa: has joined #RubyOnRails
[04:48:45] shinnya: has joined #RubyOnRails
[04:53:14] matthewd: carpeliam: "HTTP_UPGRADE: " sounds relevant
[04:53:52] carpeliam: matthewd: i think so :) but i’m not sure why it’s unable to upgrade
[04:54:33] matthewd: That's saying the HTTP request doesn't have an Upgrade: header
[04:55:06] AndrewIsHere: has joined #RubyOnRails
[04:55:25] matthewd: Best guess, you have a proxy (nginx/Apache?) in the way, that's consuming or stripping it
[04:56:54] dminuoso: has joined #RubyOnRails
[04:59:39] carpeliam: matthewd: that makes sense… i’m using Cloud Foundry, I’ll look into how they route the request
[05:02:57] papabur: ACTION nods
[05:03:18] Hyuk: has joined #RubyOnRails
[05:03:29] dragon9783: has joined #RubyOnRails
[05:05:35] harfangk: has joined #RubyOnRails
[05:09:26] Hyuk: has joined #RubyOnRails
[05:10:26] DoctorMonocular: has joined #RubyOnRails
[05:13:13] armyriad: has joined #RubyOnRails
[05:13:49] alfiemax: has joined #RubyOnRails
[05:15:57] roamingdog: has joined #RubyOnRails
[05:17:08] wd40s: has joined #RubyOnRails
[05:20:27] whathappens: has joined #RubyOnRails
[05:22:32] A_Drone: has joined #RubyOnRails
[05:22:54] Hyuk: has joined #RubyOnRails
[05:25:15] rafaelfranca: has joined #RubyOnRails
[05:26:30] rhett: has joined #RubyOnRails
[05:26:39] rhett: how do I log post parameters from inside an engine?
[05:26:50] Radar: The same way you log it in an application.\
[05:27:13] rhett: i don't have access to params like in a controller
[05:27:24] rhett: is there a way to set it in the configuration?
[05:28:33] Radar: rhett: !rule0
[05:28:33] helpa: rhett: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[05:28:41] Radar: rhett: !engines
[05:28:41] helpa: rhett: http://guides.rubyonrails.org/engines.html - Engines Guide - Written by Ryan Bigg
[05:28:45] Radar: ACTION wrote ^ that guide
[05:29:17] Radar: You can access params in controllers in engines the exact same way you access them in controllers which are in applications. They are identical in implementation.
[05:29:28] Radar: rhett: If it's not possible for you to access those params, I would really like to know how/why.
[05:30:20] rhett: Radar, I'm using this gem, like its docs describe for rails https://github.com/hyperoslo/facebook-messenger
[05:30:55] Radar: rhett: Show us your code please.
[05:32:13] rhett: https://gist.github.com/heyrhett/7b47ca7a828818d21e36ec87e177ef6f
[05:34:13] Sashimi: has joined #RubyOnRails
[05:36:30] Radar: Oh right, it's not an engine. It's a piece of Rack middleware.
[05:36:44] Radar: Everything that you need to access should be available in message
[05:36:51] mwcmitchell: has joined #RubyOnRails
[05:37:29] lxsameer: has joined #RubyOnRails
[05:37:31] rhett: except their code is broken, and I want to see the params facebook is posting to it to break it
[05:37:41] rhett: thanks for pointing out what it really is
[05:38:01] futilegames: has joined #RubyOnRails
[05:38:09] atomx: has joined #RubyOnRails
[05:38:24] A_Drone: has joined #RubyOnRails
[05:39:00] atomx: Hi, in a line such as "validates :name, presence: true", `name` is a symbol and `presence:true` is a hash, while `presence` is a symbol in this hash, right?
[05:39:06] Radar: atom_: yes
[05:39:07] atomx: ACTION getting a little bit confused
[05:39:18] atomx: Radar: ok perfect! thanks!
[05:39:27] Radar: atom_: Would writing it as validates(:name, { presence: true }) help?
[05:39:47] Sashimi: has joined #RubyOnRails
[05:40:07] futilegames: has joined #RubyOnRails
[05:40:16] atomx: it would :D but I'm following michael hartl's tutorial and he writes it that way so I was trying to understand
[05:40:56] Radar: atom_: ok np. How he writes it is the normal way to write it.
[05:42:32] abhvl: has joined #RubyOnRails
[05:42:46] Hyuk: has joined #RubyOnRails
[05:42:50] lizard2010: it is a ruby «magic»
[05:43:07] rhett: ahh Radar, I think you're right about everything
[05:43:18] Sashimi: has joined #RubyOnRails
[05:43:18] Radar: rhett: this tends to happen
[05:43:20] rhett: been a huge fan for a long time, thanks so much for the help, you're a superhero
[05:43:30] lizard2010: if last parameter is a hash, you can miss bracket
[05:44:33] blackmesa: has joined #RubyOnRails
[05:45:25] hastur: has joined #RubyOnRails
[05:45:57] hastur: hey, what's the best way to make sure only logged-in users can post forms?
[05:46:07] hastur: 1. check in the model
[05:46:08] abhinav: has joined #RubyOnRails
[05:46:17] Radar: hastur: check in the controller
[05:46:17] hastur: 2. check in the model controller
[05:46:21] Radar: hastur: !r4ia has exactly this use case
[05:46:21] helpa: hastur: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[05:46:28] Sashimi: has joined #RubyOnRails
[05:47:43] futilegames: has joined #RubyOnRails
[05:47:53] futilegames: has left #RubyOnRails: ()
[05:48:37] lizard2010: there is Rails 5 in Action? (
[05:49:05] sevenseacat: i dont think they can fit any more names on the cover
[05:49:35] dminuoso: has joined #RubyOnRails
[05:49:48] A_Drone: has joined #RubyOnRails
[05:50:20] Sashimi: has joined #RubyOnRails
[05:51:06] dionysus69: has joined #RubyOnRails
[05:52:20] Hyuk: has joined #RubyOnRails
[05:52:26] papabur: has joined #RubyOnRails
[05:53:52] Radar: lizard2010: Never ever.
[05:54:05] Sashimi: has joined #RubyOnRails
[05:56:52] A_Drone_: has joined #RubyOnRails
[05:57:03] Sashimi: has joined #RubyOnRails
[05:57:34] tego101: has joined #RubyOnRails
[05:57:55] Cohedrin: has joined #RubyOnRails
[05:58:54] Dimik--: has joined #RubyOnRails
[05:59:37] xall_: has joined #RubyOnRails
[06:00:28] Macaveli: has joined #RubyOnRails
[06:03:11] yfeldblum: has joined #RubyOnRails
[06:06:47] A_Drone: has joined #RubyOnRails
[06:09:11] pawnbox_: has joined #RubyOnRails
[06:13:11] moeabdol: has joined #RubyOnRails
[06:15:47] A_Drone: has joined #RubyOnRails
[06:16:06] davidklsn: has joined #RubyOnRails
[06:20:23] roamingdog: has joined #RubyOnRails
[06:21:20] KnownSyntax_: has joined #RubyOnRails
[06:21:20] KnownSyntax_: has joined #RubyOnRails
[06:24:15] dminuoso_: has joined #RubyOnRails
[06:26:17] yfeldblum: has joined #RubyOnRails
[06:28:11] conta: has joined #RubyOnRails
[06:28:19] A_Drone: has joined #RubyOnRails
[06:28:47] Sashimi: has joined #RubyOnRails
[06:30:45] apotry: has joined #RubyOnRails
[06:32:25] srinidhi: has joined #RubyOnRails
[06:32:26] Sashimi: has joined #RubyOnRails
[06:33:21] triptec: has joined #RubyOnRails
[06:35:57] Sashimi: has joined #RubyOnRails
[06:36:32] ur5us: has joined #RubyOnRails
[06:39:26] Sashimi: has joined #RubyOnRails
[06:39:34] dionysus69: has joined #RubyOnRails
[06:40:11] Nuck: has joined #RubyOnRails
[06:40:29] mark_66: has joined #RubyOnRails
[06:42:11] AntiSpamMeta: has joined #RubyOnRails
[06:42:57] Sashimi: has joined #RubyOnRails
[06:44:51] jishankai: has joined #RubyOnRails
[06:45:37] TomyWork: has joined #RubyOnRails
[06:45:59] blackmesa: has joined #RubyOnRails
[06:46:08] Sashimi: has joined #RubyOnRails
[06:47:54] paradisaeidae_: has left #RubyOnRails: ()
[06:49:59] Sashimi: has joined #RubyOnRails
[06:52:43] darutoko: has joined #RubyOnRails
[06:53:10] Sashimi: has joined #RubyOnRails
[06:54:34] edwinvdgraaf: has joined #RubyOnRails
[06:56:23] AndrewIsHere: has joined #RubyOnRails
[06:56:46] Sashimi: has joined #RubyOnRails
[06:56:58] dminuoso: has joined #RubyOnRails
[06:57:07] errakeshpd: has joined #RubyOnRails
[06:59:21] ejnahc: has joined #RubyOnRails
[07:00:18] A_Drone_: has joined #RubyOnRails
[07:02:59] watersoul: has joined #RubyOnRails
[07:03:11] Guest82041: has joined #RubyOnRails
[07:03:36] Sashimi: has joined #RubyOnRails
[07:03:49] arBmind: has joined #RubyOnRails
[07:05:05] triptec: has joined #RubyOnRails
[07:05:15] aganov: has joined #RubyOnRails
[07:06:06] arup_r: has joined #RubyOnRails
[07:08:00] A_Drone: has joined #RubyOnRails
[07:12:05] A_Drone_: has joined #RubyOnRails
[07:13:09] qejk: has joined #RubyOnRails
[07:13:12] fox_mulder_cp: lizard2010: no, it's only rails 4 :)
[07:13:32] fox_mulder_cp: lizard2010: rails5 released ~< month ago
[07:13:44] xall_: has joined #RubyOnRails
[07:13:49] lizard2010: active cable cool (
[07:14:03] dminuoso: Well, it's quite late honestly.
[07:14:13] fox_mulder_cp: u use in in non-chat app?)
[07:14:24] lizard2010: never use yet (=
[07:15:12] dragon9783: has joined #RubyOnRails
[07:15:48] dminuoso: I mean browser support has been around for 7 years for WebSocket..
[07:18:19] blackmesa: has joined #RubyOnRails
[07:23:04] DoctorMonocular: has joined #RubyOnRails
[07:24:48] solars: has joined #RubyOnRails
[07:25:40] A_Drone: has joined #RubyOnRails
[07:26:18] pawnbox: has joined #RubyOnRails
[07:26:52] Ergo: has joined #RubyOnRails
[07:27:11] antgel: has joined #RubyOnRails
[07:28:09] pawnbox: has joined #RubyOnRails
[07:29:47] A_Drone_: has joined #RubyOnRails
[07:30:47] tvw: has joined #RubyOnRails
[07:32:10] Devalo: has joined #RubyOnRails
[07:32:20] artto: has joined #RubyOnRails
[07:32:58] errakeshpd: has joined #RubyOnRails
[07:33:52] jstransky: has joined #RubyOnRails
[07:34:49] A_Drone: has joined #RubyOnRails
[07:42:46] A_Drone: has joined #RubyOnRails
[07:46:43] fox_mulder_cp: dminuoso: browserm but front and back must be support it too )
[07:48:01] wd40s: has joined #RubyOnRails
[07:48:02] DrYockel: has joined #RubyOnRails
[07:49:29] k3rn31: has joined #RubyOnRails
[07:54:14] the_drow: has joined #RubyOnRails
[07:54:56] A_Drone: has joined #RubyOnRails
[07:57:49] A_Drone: has joined #RubyOnRails
[07:58:57] pawnbox: has joined #RubyOnRails
[08:02:41] ewelina_: has joined #RubyOnRails
[08:03:26] edwinvdg_: has joined #RubyOnRails
[08:06:08] armyriad: has joined #RubyOnRails
[08:06:56] arup_r: has joined #RubyOnRails
[08:09:25] srinidhi: has joined #RubyOnRails
[08:09:33] roshanavand: has joined #RubyOnRails
[08:13:55] Kedare: has joined #RubyOnRails
[08:15:33] AzaToth: has joined #RubyOnRails
[08:17:03] DoubleMalt: has joined #RubyOnRails
[08:24:24] lizard2010: class AddRememberDigestToUsers < ActiveRecord::Migration[5.0]
[08:27:08] pawnbox: has joined #RubyOnRails
[08:27:45] A_Drone: has joined #RubyOnRails
[08:30:18] browndawg: has joined #RubyOnRails
[08:30:42] browndawg: Hi all! What do you peolpe suggest I use as a single sign on solution for multiple apps (not necessarily rails based)?
[08:30:47] snowy: has joined #RubyOnRails
[08:31:06] browndawg: Has anyone used this in production? https://rubycas.github.io/
[08:34:55] fermonkus: has joined #RubyOnRails
[08:35:10] ur5us: has joined #RubyOnRails
[08:39:34] armyriad: has joined #RubyOnRails
[08:40:27] A_Drone: has joined #RubyOnRails
[08:42:27] lkz: has joined #RubyOnRails
[08:43:31] A_Drone: has joined #RubyOnRails
[08:46:12] yfeldblum: has joined #RubyOnRails
[08:46:50] pawnbox: has joined #RubyOnRails
[08:46:57] DaniG2k: has joined #RubyOnRails
[08:49:04] pawnbox: has joined #RubyOnRails
[08:53:14] A_Drone_: has joined #RubyOnRails
[08:55:41] fermonkus: has joined #RubyOnRails
[08:55:51] alaing: has joined #RubyOnRails
[08:56:04] alaing: has joined #RubyOnRails
[08:56:43] alaing: hi, I have this line of code Rails.configuration.action_mailer.asset_host = 'http://localhost:3000' is there a way to pick up this info dynamically ?
[08:57:36] A_Drone: has joined #RubyOnRails
[08:58:32] Megamos: has joined #RubyOnRails
[08:59:27] skroon: has joined #RubyOnRails
[09:01:04] A_Drone: has joined #RubyOnRails
[09:03:03] arup_r: alaing: what info you want to pick up from there
[09:03:13] Dimik: has joined #RubyOnRails
[09:03:44] blackmesa: has joined #RubyOnRails
[09:04:49] alaing: the first part of the link for absolute url. this is relaying on the rails server running on port 3000 and its fine for local dev but then in production the url maybe different and is subject to change too
[09:05:00] arup_r: yesterday when I came back, i found you offline. So the image or any view helpers need this settings http://guides.rubyonrails.org/action_mailer_basics.html#generating-urls-in-action-mailer-views .. I hope you did it
[09:05:21] alaing: 'http://localhost:3000'
[09:05:33] arup_r: alaing: that seetings you have in which file?
[09:08:39] alaing: config/environments.rb
[09:08:46] alaing: http://guides.rubyonrails.org/action_mailer_basics.html#adding-images-in-action-mailer-views
[09:10:23] lizard2010: alaing, how you call a mailer? via web request? or from command line?
[09:10:43] arup_r: alaing: that settings has to go to the environment specific files
[09:11:05] alaing: lizard2010: its in my controller action
[09:11:17] arup_r: the settings now you have should go to development.rb, and production related changes should be in production.rb file
[09:11:41] alaing: arup_r: sure, that makes sense but i wonder if there was a way i could grab the host and port dynamically for each environment
[09:11:49] arup_r: first thing remove it from environments.rb .. because this holds generall settings which are true for all environments'
[09:11:51] lizard2010: alaing, http://stackoverflow.com/a/17574412
[09:12:29] matthewd: That's a really bad idea
[09:13:24] alaing: matthewd: what a bad idea?
[09:14:22] blackmesa: has joined #RubyOnRails
[09:14:48] matthewd: The SO link lizard2010 posted -- changing a global config setting based on an incoming request
[09:15:27] matthewd: But consequently, there isn't a way to do what you want -- that's why it's a config setting
[09:19:06] kedare1: has joined #RubyOnRails
[09:25:21] oystersauce8: has joined #RubyOnRails
[09:27:43] A_Drone: has joined #RubyOnRails
[09:28:23] alfiemax: has joined #RubyOnRails
[09:28:40] workmad3: has joined #RubyOnRails
[09:31:00] arBmind: has joined #RubyOnRails
[09:35:07] oqui: has joined #RubyOnRails
[09:36:26] Mia: has joined #RubyOnRails
[09:36:54] AimlessRAven: has joined #RubyOnRails
[09:36:56] AimlessRAven: https://gist.github.com/anonymous/09d4fac9b6d2b0a345adcb3f10a772f7
[09:37:00] AimlessRAven: i have loop in my prawn.pdf
[09:37:14] AimlessRAven: and at the end of loop i have pdf.start_new_page
[09:37:33] AimlessRAven: who generate me the loop content pages but the problem is prawn.pdf always generate 1 page more
[09:37:38] AimlessRAven: the last page is always blank
[09:37:39] oqui: Hello, I've made some changes to my application.css. The changes are seen on my development enviroment but not on production system however much I try to restart apache. What can I do about this
[09:38:01] sevenseacat: oqui: did you precompile your assets when you deployed the changes to production?
[09:38:48] mr_hubot: has joined #RubyOnRails
[09:39:17] tamole: has joined #RubyOnRails
[09:39:37] oqui: am totally new to rails and am maintaining a system I didn't develop. Do you mean like running bundle exec rake assets:precompile ?
[09:39:43] lkz: I meet a problem on my code, I do not how see declaring a class after to have to modify a migration with rake. I just have to add a column in my table. This is to connect a class with a content.info action.
[09:40:18] lkz: This action has to call individually a contents for every page of article.
[09:41:14] oqui: sevenseacat: should I precompile before deploying or after deploying?
[09:41:55] triptec: has joined #RubyOnRails
[09:42:31] sevenseacat: oqui: usually its a step done as part of the deployment.
[09:43:30] oqui: so I run "bundle exec rake assets:precompile" and then deploy the entire assets folder to the production system?
[09:44:31] sevenseacat: you would typically precompile on the server itself
[09:45:28] daffy_duck_3: has joined #RubyOnRails
[09:45:41] arup_r: has joined #RubyOnRails
[09:46:29] oqui: sevenseacat: I've a problem with that. Am running into path/enviroment issues with the bundle/rails/rake etc commands on the production enviroment. It's running on freebsd which am not so familiar with. Is there any other way of precompilng the assets on my dev enviroment and then push to the production system
[09:49:05] mr_hubot: I take a course about Ruby on Rails on codecademy but I've problem with exercise on lesson Associations II
[09:50:01] A_Drone: has joined #RubyOnRails
[09:50:56] Guest: has joined #RubyOnRails
[09:51:19] tris: has joined #RubyOnRails
[09:54:00] srinidhi: has joined #RubyOnRails
[10:03:25] rbr: mr_hubot: !code
[10:05:09] A_Drone: has joined #RubyOnRails
[10:05:43] AimlessRAven: https://gist.github.com/anonymous/09d4fac9b6d2b0a345adcb3f10a772f7
[10:05:50] AimlessRAven: i generate new page at the end of loop
[10:06:10] AimlessRAven: but the problem is prawn pdf always generate one blank page at the end
[10:06:12] AimlessRAven: how to remove it
[10:07:14] mikecmpbll: has joined #RubyOnRails
[10:08:43] arup_r: mr_hubot: !code
[10:08:43] helpa: mr_hubot: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[10:09:13] rbr: helpa doesn't like me :/
[10:09:41] arup_r: rbr some people have access those tool. don't feel bad ... :(
[10:10:16] rbr: Hehe, I figured ;))
[10:12:03] A_Drone: has joined #RubyOnRails
[10:13:40] A_Drone: has joined #RubyOnRails
[10:16:13] k3dare: has joined #RubyOnRails
[10:16:49] blackmesa: has joined #RubyOnRails
[10:16:54] cgfbee: has joined #RubyOnRails
[10:18:18] universa1: rbr: !unworthy *chuckle*
[10:18:18] helpa: rbr: You are not worthy of this bot!
[10:19:03] universa1: AimlessRaven: so don't call pdf_start_new_page for the last page... ...and how long are you here? when do you learn to at least enable syntax highlighting in your gists?!
[10:20:01] AimlessRAven: universa1: hm, ok but i generete pages in my loop how to stop last page
[10:21:11] universa1: AimlessRaven: you have the index...
[10:21:24] flashpoint9: has joined #RubyOnRails
[10:21:48] rbr: universa1: Harsch!
[10:23:06] sevenseacat: not so harsh.
[10:23:20] universa1: i guess he was referring to unworthy ;)
[10:26:22] xall_: has joined #RubyOnRails
[10:28:29] fermonkus: has joined #RubyOnRails
[10:41:05] aazsdk: has joined #RubyOnRails
[10:42:25] Guest683: has joined #RubyOnRails
[10:42:44] k3rn31: has joined #RubyOnRails
[10:44:56] marr: has joined #RubyOnRails
[10:47:53] mdw: has joined #RubyOnRails
[10:49:14] aazsdk: has joined #RubyOnRails
[10:51:05] Jet4Fire: has joined #RubyOnRails
[10:52:35] Juanchito: has joined #RubyOnRails
[10:55:37] blackhuey: has joined #RubyOnRails
[10:56:27] artto: has joined #RubyOnRails
[10:56:32] Giov: has joined #RubyOnRails
[10:57:04] rodfersou: has joined #RubyOnRails
[10:57:16] Depili: has joined #RubyOnRails
[10:57:45] Giov: Hello, if I have a f.collection_select(:category_id, ... item in my form, is it correct to read it with params.require(:post).fetch 'category_id' in the create method?
[10:58:41] AndrewIsHere: has joined #RubyOnRails
[10:58:58] arup_r: yes seems so.. ok what is the issue you got now? Giov
[10:59:16] dminuoso: Giov: Using strong params (or any other method of whitelisting) is a wise thing.
[10:59:35] Giov: hi arup_r, that works it is just that I couldn't find any example online to check it
[10:59:53] Giov: so I was wondering if there's a better way
[11:00:00] dminuoso: Giov: What do you think is wrong with it?
[11:00:10] arup_r: Giov: http://api.rubyonrails.org/classes/ActionController/Parameters.html#method-i-fetch
[11:00:42] GodFather: has joined #RubyOnRails
[11:00:52] arup_r: dminuoso: probably OP is thinking why it is working when he is not seeing any documentation of it kind of I guess :)
[11:01:06] dminuoso: Let's not guess, let's wait what he says.
[11:01:11] dminuoso: Or *they* say
[11:01:12] Giov: dminuoso: general I always found CRUD examples where the id of the parent resource is passed using the route so then it is read as params[:category_id] for example
[11:01:34] arup_r: dminuoso: not a guess, OP said *that works it is just that I couldn't find any example online to check it*
[11:01:46] Giov: e.g. https://youtu.be/OaDhY_y8WTo?t=12m28s
[11:02:58] arup_r: Giov: read the introduction part of this http://api.rubyonrails.org/classes/ActionController/Parameters.html and you will get the idea of how to use it.
[11:03:25] arup_r: it said every thing about the tool
[11:03:41] Miccet: has joined #RubyOnRails
[11:03:42] Giov: dminuoso: how would it be without strong params?
[11:05:01] dminuoso: Giov: Something else of your choising. Perhaps you manually test the rack params.
[11:05:02] Giov: arup_r: if I understand correctly, params.require gets the set of parameters sent by the form and then I fetch the one I need. While when reading params from the route, they are straight away into params, right?
[11:05:12] dminuoso: Giov: Though if you just start out, use the strong params.
[11:05:13] Giov: arup_r: I'll have a look at the link, thanks
[11:05:32] mikecmpbll: i'm using doorkeeper for rails as an oauth provider. i'd like client apps to be able to get some info from the user's session at the auth provider, but i can't think how best to achieve this
[11:05:56] mikecmpbll: basically, when they log in at the provider they can optionally use 2-factor auth, i want to let client apps know whether they have or not.
[11:06:22] mikecmpbll: (securely, obviously, because client apps may implement security based on it)
[11:06:22] Giov: dminuoso: sorry, I'm not sure what strong params are but I'm going to have a look
[11:06:33] dstarh: has joined #RubyOnRails
[11:06:38] dminuoso: Giov: params.require(:post)
[11:06:43] dminuoso: That bit is an example of StrongParameters
[11:06:49] arup_r: Giov: yes all will be in params. but when you would like to do *mass assignment* then `permit` is a handy tool as the link example is shwing
[11:07:11] dminuoso: Giov: The idea of strong parameters is to wrap the logic of enforcing what fields *must* be presents and what fields *may* be present.
[11:07:41] mikecmpbll: hmm, i could update the user in the db when they log in, i suppose
[11:08:39] stardiviner: has joined #RubyOnRails
[11:09:20] edwinvdgraaf: has joined #RubyOnRails
[11:10:34] Giov: arup_r: yes I'm using permit for mass assignment. that's a concept I'm familiar with from another framework, but I'm probably mainly not sure about require when reading a single parameter
[11:10:59] Giov: for example if I do just params.fetch('category_id') it won't work
[11:11:21] yfeldblum: has joined #RubyOnRails
[11:12:39] matthewd: Giov: But params['post']['category_id'] / params.fetch('post').fetch('category_id') will, if that helps your understanding
[11:12:41] Giov: I guess I should do params.fetch(:post['category_id']) ? and this would not be strong?
[11:13:05] stardiviner: has left #RubyOnRails: ()
[11:13:23] Giov: oh ok got the confusing bit: https://github.com/rails/rails/blob/41b7b8216c11736e0651a6b78a653458c1c40690/actionpack/lib/action_controller/metal/strong_parameters.rb#L302
[11:13:37] Giov: require make sure it is there and also returns it
[11:14:06] Giov: so then fetch is done on the returned parameter which in my example was post
[11:14:51] Giov: so the same as params['post']['category_id'] plus checking that it is there, got it. thanks arup_r dminuoso & matthewd
[11:16:18] dionysus69: has joined #RubyOnRails
[11:16:37] abhinav: how can i set an object to read ony?
[11:17:22] arup_r: abhinav: http://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-readonly
[11:18:29] Depili: has joined #RubyOnRails
[11:18:45] abhinav: arup_r: is it available for r3?
[11:19:13] arup_r: mainly r4 guy.. will become r5 soon :)
[11:19:32] arup_r: abhinav: try in rails console and see if it works or not. goos and quick way to test
[11:20:09] syndikate: has joined #RubyOnRails
[11:21:05] abhinav: undefiened method.
[11:21:23] arup_r: sorry to hear :(
[11:22:31] blackmesa: has joined #RubyOnRails
[11:25:36] syndikate: Hello people
[11:26:19] syndikate: I am stuck with a problem in rspec, where in which I have a method inside a method in my model. I need to stub the deepest method, but I am not able to figure out how..
[11:30:38] jhass: ?code syndikate
[11:30:46] helpa: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[11:33:43] quazimodo: has joined #RubyOnRails
[11:33:52] quazimod1: has joined #RubyOnRails
[11:35:30] artto: has joined #RubyOnRails
[11:35:42] syndikate: @jhass, can't share the exact so here is a skeleton
[11:35:42] syndikate: https://gist.github.com/anonymous/3bae70bebf495df06b62597282ce45f9
[11:36:24] dminuoso: syndikate: If you are under an NDA and cannot share a testcase that demonstrates your problem, please hire a consultant.
[11:37:32] dminuoso: syndikate: Have you read this documentation though? https://www.relishapp.com/rspec/rspec-mocks/docs
[11:37:36] jhass: syndikate: allow(random_model_instance).to receive(:random_api_method_call).and_return(foobar)
[11:37:42] dminuoso: (Note it's not _calls_ that are stubbed, but methods)(
[11:37:50] jhass: also read the readme of rspec-mocks
[11:37:57] ldnunes: has joined #RubyOnRails
[11:40:34] nettoweb: has joined #RubyOnRails
[11:42:58] Depili: has joined #RubyOnRails
[11:45:01] syndikate: @jhass, Yeah I did read and following your example what I recieve is that the random_model_instance does not implement :random_api_method_call()
[11:46:24] jhass: syndikate: it's impossible to help you without an example that we can run and that reproduces
[11:47:58] bryanculver_: has joined #RubyOnRails
[11:56:18] umdstu: has joined #RubyOnRails
[11:57:03] Detch: has joined #RubyOnRails
[11:58:18] conta1: has joined #RubyOnRails
[11:58:51] fermonkus: has joined #RubyOnRails
[12:10:16] triptec: has joined #RubyOnRails
[12:12:11] jmignault: has joined #RubyOnRails
[12:13:03] oystersauce8: has joined #RubyOnRails
[12:17:16] artto_: has joined #RubyOnRails
[12:18:12] yfeldblum: has joined #RubyOnRails
[12:23:53] blackmesa: has joined #RubyOnRails
[12:24:00] snowy: has joined #RubyOnRails
[12:25:29] lxsameer: has joined #RubyOnRails
[12:28:26] artto: has joined #RubyOnRails
[12:28:46] quazimodo: has joined #RubyOnRails
[12:28:49] quazimod1: has joined #RubyOnRails
[12:29:11] ElFerna: has joined #RubyOnRails
[12:35:26] c355E3B: has joined #RubyOnRails
[12:41:29] Oliphaunte: has joined #RubyOnRails
[12:45:57] JakFrist: has joined #RubyOnRails
[12:47:57] cd-rum: has joined #RubyOnRails
[12:59:26] Oliphaunte: has joined #RubyOnRails
[12:59:56] AndrewIsHere: has joined #RubyOnRails
[13:02:41] artto: has joined #RubyOnRails
[13:03:22] Macaveli: has joined #RubyOnRails
[13:04:27] tamole: has joined #RubyOnRails
[13:05:38] xall_: has joined #RubyOnRails
[13:09:49] artto_: has joined #RubyOnRails
[13:10:51] ramortegui: has joined #RubyOnRails
[13:12:23] Detch: has joined #RubyOnRails
[13:12:31] ewelina_: has joined #RubyOnRails
[13:14:48] fmcgeough: has joined #RubyOnRails
[13:14:56] Detch: has joined #RubyOnRails
[13:17:13] speakingcode: has joined #RubyOnRails
[13:17:18] Detch: has joined #RubyOnRails
[13:18:16] isberg: has joined #RubyOnRails
[13:18:48] ekinmur: has joined #RubyOnRails
[13:18:52] skroon: i've got a hardware device which is doing a HTTP POST as content-type text, but the data it's posted is formencoded, is there a way to force rails to read that incoming data as formencoded data? This way my params will get filled with data
[13:23:14] jhass: I guess you have to write a rack middleware that patches the correct type into place. Or do it at your reverse proxy already
[13:23:36] dvinciguerra_: has joined #RubyOnRails
[13:24:11] DrYockel: has joined #RubyOnRails
[13:24:17] thesubr00t: has joined #RubyOnRails
[13:24:18] jhass: http://guides.rubyonrails.org/rails_on_rack.html#action-dispatcher-middleware-stack
[13:24:58] Megamos: has joined #RubyOnRails
[13:25:02] thesubr00t: Is anyone experiencing duplicate nested records upon CREATION with ActiveAdmin?
[13:26:16] conta1: has joined #RubyOnRails
[13:26:19] yfeldblum: has joined #RubyOnRails
[13:26:59] blackmesa: has joined #RubyOnRails
[13:27:37] aegis3121: has joined #RubyOnRails
[13:28:52] Giov: has left #RubyOnRails: ()
[13:30:21] arBmind: has joined #RubyOnRails
[13:30:40] conta1: has joined #RubyOnRails
[13:32:36] mostlybadfly: has joined #RubyOnRails
[13:38:08] conta1: has joined #RubyOnRails
[13:39:23] A_Drone: has joined #RubyOnRails
[13:43:06] njero: has joined #RubyOnRails
[13:47:10] Oliphaunte: has joined #RubyOnRails
[13:49:39] wd40s: has joined #RubyOnRails
[13:51:00] alfiemax: has joined #RubyOnRails
[13:51:23] srinidhi: has joined #RubyOnRails
[13:54:47] Megamos: has joined #RubyOnRails
[13:56:07] l4v2: has joined #RubyOnRails
[14:01:17] xall_: has joined #RubyOnRails
[14:02:06] ewelina_: has joined #RubyOnRails
[14:03:09] tycoon177: is anyone else having issues reaching ruby-doc.org?
[14:05:07] isberg: has joined #RubyOnRails
[14:06:08] morfin: has joined #RubyOnRails
[14:06:21] ewelina__: has joined #RubyOnRails
[14:06:37] morfin: how you usually deploy your applications assuming you have only clean OS(VM created from "template")
[14:07:16] sypheren: has joined #RubyOnRails
[14:08:06] tycoon177: morfin: are you talking about deploying a rails application to something like digital oceam?
[14:08:14] tycoon177: I cannot type today
[14:08:39] morfin: well, i meant VDS(having Centos 7)
[14:09:57] tycoon177: if you google "Deploy rails app to Centos", the first link is this: https://www.digitalocean.com/community/tutorials/how-to-deploy-rails-apps-using-passenger-with-nginx-on-centos-6-5 which should still work
[14:10:58] flashpoint9: has joined #RubyOnRails
[14:12:51] morfin: i mean automated process
[14:13:05] Megamos: has joined #RubyOnRails
[14:13:11] morfin: of course i can write script which will do that "automatically"
[14:13:25] morfin: but what do you think about using Docker?
[14:14:42] jhack: has joined #RubyOnRails
[14:14:47] tycoon177: Docker is for running the server, not for deployment
[14:14:50] tycoon177: You could use capistrano
[14:15:01] isberg: has joined #RubyOnRails
[14:15:17] eljimbo: has joined #RubyOnRails
[14:15:23] shinnya: has joined #RubyOnRails
[14:15:33] tycoon177: https://github.com/capistrano/rails
[14:15:57] tycoon177: If you want something super easy to use (And can scale easily) you could try heroku
[14:16:04] tycoon177: Deployment is just pushing to a git repo
[14:16:37] tycoon177: But you'll want to keep your code in a private repo like bitbucket, because some sensitive files have to be checked into git
[14:18:05] whathappens: has joined #RubyOnRails
[14:18:51] adavia: has joined #RubyOnRails
[14:19:22] morfin: i use capistrano
[14:21:27] agent_white: has joined #RubyOnRails
[14:21:39] morfin: but before i can run my app i should 1. Install all required packages. 2. Add some services to autostart. 3. Create symlinks for God(i run god with system ruby). 4. Install rbenv. 5. Install ruby-build into rbenv. 6. Build ruby. 7. Install bundler. 8. Create database and database user, grant permissions. 9. deploy and app
[14:22:31] tycoon177: I mean, you could use docker for that if you wanted to
[14:22:42] tycoon177: But that should be a one time setup on the machine
[14:23:07] morfin: and you have to do that every time
[14:23:13] morfin: for every new app
[14:24:01] tycoon177: Is heroku out of the question? It seems like the sysadmin stuff isnt what you want to do.
[14:24:33] morfin: basically i have similar list of packages i use: Mariadb, Nginx, Redis, Memcached, ruby(for god) and some other stuff
[14:24:55] tycoon177: You don't want to run all of those on a single docker image
[14:25:04] tycoon177: that'd be one for the db, one for rails, etc
[14:25:10] morfin: yes i know
[14:25:19] morfin: ah of course also git :)
[14:25:34] CodingWolf: has joined #RubyOnRails
[14:26:36] thesubr00t: Why is ActiveAdmin creating duplicate attributes for nested models? (only in create action, edit works fine)
[14:27:08] thesubr00t: duplicate records*
[14:27:53] yfeldblum: has joined #RubyOnRails
[14:28:20] blackmesa: has joined #RubyOnRails
[14:32:01] ekinmur: has joined #RubyOnRails
[14:32:38] GodFather: has joined #RubyOnRails
[14:32:49] kanzure: has joined #RubyOnRails
[14:33:03] incidence: has joined #RubyOnRails
[14:33:09] isberg: has joined #RubyOnRails
[14:33:23] Jon30: has joined #RubyOnRails
[14:33:23] Jon30: has joined #RubyOnRails
[14:33:32] incidence: has joined #RubyOnRails
[14:33:33] rafaelflores: has joined #RubyOnRails
[14:33:33] Oliphaunte: has joined #RubyOnRails
[14:33:39] pawnbox: has joined #RubyOnRails
[14:34:22] zrl: has joined #RubyOnRails
[14:34:41] Guest4184_______: has joined #RubyOnRails
[14:35:16] bedouin: has joined #RubyOnRails
[14:35:18] HalcyonicStorm: agent_white: how rude
[14:35:36] rafaelflores: has joined #RubyOnRails
[14:36:15] SteenJobs: has joined #RubyOnRails
[14:38:38] pawnbox_: has joined #RubyOnRails
[14:39:53] dminuoso: has joined #RubyOnRails
[14:43:13] iceden: has joined #RubyOnRails
[14:43:16] tycoon177: morning agent_white. didn't know you were in this channel too ;P
[14:43:31] whoughton: has joined #RubyOnRails
[14:43:37] MissionCritical: has joined #RubyOnRails
[14:46:33] fox_mulder_cp: hi. how to pass to rake tasks RAILS_ENV variable? now it fails 'secret key not set' but i want reset production database
[14:47:02] fox_mulder_cp: when i try RAILS_ENV=production bundle exec rake db:reset -> rake aborted! Devise.secret_key was not set.
[14:47:54] alfiemax: fox_mulder_cp, there are alot of ways to set env vars and use it in rails
[14:48:07] alfiemax: i use dotenv-rails, figaro, etc
[14:49:09] fox_mulder_cp: alfiemax: i want to drop and recreate prod database. i don't want use some shits
[14:49:24] SteenJobs: anyone use rvm1-capistrano3? i have a cap task that needs to run bundle exec, so i added rvm1-cap, but now “/home/root/apps/my_app/rvm1scripts/rvm-auto.sh . bundle install --path” is throwing an error “bundle: not found”
[14:49:59] fryguy: SteenJobs: do you have bundler installedc
[14:50:01] banisterfiend: hi, i want to move the admin section of my app into a rails engine, my concern is that 'auto reloading' won't work for the engine and the app, is this something i need to worry about? or will 'auto reloading' just work fine for both the rails engine (incorporated via a gem 'admin_engine', path: /path/to/admin) and my main app
[14:50:01] SteenJobs: previously it was “/usr/local/rvm/bin/rvm default do bundle install --path” and that line worked
[14:50:07] alfiemax: fox_mulder_cp, then read your error message
[14:50:11] flashpoint9: has joined #RubyOnRails
[14:50:15] alfiemax: and do the required
[14:50:20] SteenJobs: fryguy: yea yea, it’s an issue with cap - it doesn’t recognize your rvm installation, so need the additional gem
[14:50:30] SteenJobs: but now i can’t get the gem working
[14:50:32] lizard2010: fox_mulder_cp, set Devise.secret_key for production
[14:50:34] jhass: fox_mulder_cp: check your config/secrets.yml
[14:50:38] SteenJobs: fryguy: because bundler:install is failing
[14:50:45] lizard2010: or comment devise gem )
[14:51:06] LvcasX1: has joined #RubyOnRails
[14:51:17] matthewd: banisterfiend: Your concern is well-founded
[14:52:35] matthewd: banisterfiend: ... I think. But you should be able to convince it to do what you want.
[14:52:36] fryguy: SteenJobs: interesting. i'd never use rvm so I don't know what other stuff you need
[14:53:26] fox_mulder_cp: why. RAKE for DATABASE want some secrets?
[14:53:28] SteenJobs: fryguy: so rvm is installed and fine on the server - the issue is cap doesn’t see it when running bundle exec, but now that i’m using this gem, i can’t get past bundler:install with cap deploy
[14:53:34] SteenJobs: fryguy: ugh i’ll keep plugging
[14:53:38] dunpeal: has joined #RubyOnRails
[14:53:59] Terens: has joined #RubyOnRails
[14:54:11] adavia: Is anyone having issues with rails 5 and carrierwave?
[14:54:20] dunpeal: Hi. How do should I require tested models in an RSpec test?
[14:54:48] Akuma: has joined #RubyOnRails
[14:56:14] prithaj: has joined #RubyOnRails
[14:57:06] lizard2010: fox_mulder_cp, why rake? rails, which try load devise, which want his key
[14:57:23] lizard2010: fox_mulder_cp, just give him a key, or disable him
[14:58:55] fox_mulder_cp: lizard2010: i say about rake, not rails
[14:59:07] fox_mulder_cp: i try recreate prod database
[14:59:22] banisterfiend: matthewd thanks, so it won't 'just work', it'll require some configuration to get autol-loading working with engines?
[14:59:51] lizard2010: fox_mulder_cp, rake load rails, to get access to your db
[15:00:36] wd40s: has joined #RubyOnRails
[15:01:14] bga57: has joined #RubyOnRails
[15:01:37] marahin: What is the proper way (in Rails 5) to find all records, where a integer value is higher or equal to X?
[15:01:50] marahin: pseuocode would be Readings.where(:temperature > X)
[15:02:04] marahin: Reading.where*
[15:02:17] isberg: has joined #RubyOnRails
[15:03:00] clandry94: has joined #RubyOnRails
[15:04:08] Megamos: has joined #RubyOnRails
[15:04:31] Velizar: has joined #RubyOnRails
[15:04:58] dionysus69: has joined #RubyOnRails
[15:05:17] lizard2010: marahin, does it works?
[15:05:25] marahin: lizard2010, no it does not
[15:05:54] Megamosaren: has joined #RubyOnRails
[15:06:13] marahin: that's why I'm asking :) back in the day that would be something like .where("temperature <= ?", temperature)
[15:06:36] marahin: but that's some SQL right there, and I'd love to stick to activerecord, and Rails5 has brought many changes so... maybe
[15:06:43] tycoon177: Rails.where('someval > ?', x), no?
[15:07:12] tycoon177: does activerecord have those bindings? I dont think so
[15:07:15] marahin: tycoon177, yeah, look my message up
[15:07:34] marahin: so I have to stick to good old .where('x > ?', y), yes
[15:07:48] tycoon177: i think so, but not positive
[15:07:55] Devalo: has joined #RubyOnRails
[15:07:56] marahin: haha OK :) I'll search for it a little more later.
[15:08:08] lizard2010: marahin, http://guides.rubyonrails.org/active_record_querying.html#array-conditions
[15:08:26] marahin: lizard2010, so that has not changed
[15:08:31] marahin: OK. Thank you!
[15:09:17] one_zero: has joined #RubyOnRails
[15:09:55] CanTonic: has joined #RubyOnRails
[15:10:26] rafaelflores: has joined #RubyOnRails
[15:11:57] tycoon177: marahin: http://stackoverflow.com/a/23936233 Not sure about it, however
[15:12:47] jtdowney: has joined #RubyOnRails
[15:12:47] jtdowney: has joined #RubyOnRails
[15:13:12] HalcyonicStorm: has joined #RubyOnRails
[15:13:19] marahin: tycoon177, wooohoo, that's something!
[15:13:30] marahin: tycoon177, thank you ;-)
[15:13:33] tycoon177: not sure if it works, ymmv
[15:13:58] arup_r: has joined #RubyOnRails
[15:14:43] moep: has joined #RubyOnRails
[15:18:20] polishdub: has joined #RubyOnRails
[15:20:05] matthewd: banisterfiend: I think so. Well.. autoloading should work, but not change detection / reloading, maybe?
[15:21:36] isberg: has joined #RubyOnRails
[15:21:45] FCser: has joined #RubyOnRails
[15:26:45] flashpoint9: has joined #RubyOnRails
[15:27:08] SteenJobs_: has joined #RubyOnRails
[15:29:04] SteenJobs: fryguy: somehow bundler now uninstalled itself - out of curiosity, how do you deal with bundler when doing multiple deployments - cap task or simply add it to the global rvm gemset?
[15:29:30] yfeldblum: has joined #RubyOnRails
[15:29:44] blackmesa: has joined #RubyOnRails
[15:31:36] melonstorm: has joined #RubyOnRails
[15:31:36] melonstorm: has joined #RubyOnRails
[15:31:59] ur5us: has joined #RubyOnRails
[15:32:47] dminuoso: has joined #RubyOnRails
[15:33:11] micah`: has joined #RubyOnRails
[15:33:40] banisterfiend: anyone here experienced clockwork raising exceptions on heroku? I assume it's cos the dyno is being restarted and it's not properly dealing with SIGTERM? I'm gettin ga "SignalException: SIGTERM" on my clockwork worker process
[15:35:00] Axsuul: has joined #RubyOnRails
[15:35:13] jgoulah: has joined #RubyOnRails
[15:38:15] workmad3_: has joined #RubyOnRails
[15:40:15] disgrntld: has joined #RubyOnRails
[15:40:57] Palsson: has joined #RubyOnRails
[15:45:24] DaniG2k: has joined #RubyOnRails
[15:46:02] artto: has joined #RubyOnRails
[15:47:32] workmad3: has joined #RubyOnRails
[15:47:47] rafaelflores: has joined #RubyOnRails
[15:47:53] AndrewIsHere: has joined #RubyOnRails
[15:49:32] [Butch]: has joined #RubyOnRails
[15:49:33] xall_: has joined #RubyOnRails
[15:54:07] rakm: has joined #RubyOnRails
[15:54:33] Palsson: has joined #RubyOnRails
[15:56:28] isberg: has joined #RubyOnRails
[15:58:10] DaniG2k: has joined #RubyOnRails
[15:58:37] SteenJobs: has joined #RubyOnRails
[15:59:05] wd40s: has joined #RubyOnRails
[16:02:39] clandry94: has joined #RubyOnRails
[16:03:07] whathapp_: has joined #RubyOnRails
[16:04:07] whathappens: has joined #RubyOnRails
[16:04:50] SteenJobs_: has joined #RubyOnRails
[16:05:02] harfangk: has joined #RubyOnRails
[16:07:28] Ergo: has joined #RubyOnRails
[16:08:40] norfumpit: has joined #RubyOnRails
[16:09:50] AnoHito: has joined #RubyOnRails
[16:10:03] arup_r: has joined #RubyOnRails
[16:11:46] dminuoso: has joined #RubyOnRails
[16:11:49] wd40s: has joined #RubyOnRails
[16:12:32] norfumpit: has joined #RubyOnRails
[16:13:36] macsteps: has joined #RubyOnRails
[16:14:02] barhum2013: has joined #RubyOnRails
[16:14:54] norfumpit: has joined #RubyOnRails
[16:15:56] cnk: has joined #RubyOnRails
[16:16:58] norfumpit: has joined #RubyOnRails
[16:17:29] norfumpit: has joined #RubyOnRails
[16:18:59] iceden: has joined #RubyOnRails
[16:20:16] tycoon177: Is there a way to output csv as ascii in rails? I am trying to make a csv file and it apparently needs to be ascii and not utf-8
[16:20:20] dragon9783: has joined #RubyOnRails
[16:22:02] lupine: humm, ruby is packed with encoding management code, I've forgotten how to do the conversion offhand
[16:22:13] andywww: has joined #RubyOnRails
[16:22:43] cnk: tycoon177: http://ruby-doc.org/core-2.2.0/Encoding.html
[16:23:00] cnk: you will need to decide what needs to be done for any non-ascii characters in your data
[16:23:19] cnk: As I recall you can say to make them some place holder or to omit them
[16:23:37] lupine: I expected "£".encode!("US-ASCII") to work, but it doesn't
[16:23:58] cnk: what sort of 'not work'
[16:24:12] lupine: Encoding::UndefinedConversionError: U+00A3 from UTF-8 to US-ASCII
[16:24:14] cnk: that isn't an ascii character so what should it be
[16:24:31] blackmesa: has joined #RubyOnRails
[16:24:45] cnk: that is one of the cases where you need to say what to do if you can't encode something
[16:24:50] Cohedrin: has joined #RubyOnRails
[16:24:56] lupine: ohhhh, of course, code pages
[16:25:34] norfumpit: has joined #RubyOnRails
[16:25:35] lupine: 0xA3 won't work in US-ASCII, wonder what they call it in rubyland
[16:26:14] lupine: of course: "£".encode!("ISO-8859-1")
[16:26:21] lupine: you might not want that encoding, though
[16:26:51] artto: has joined #RubyOnRails
[16:27:18] cnk: tycoon177: I would take a look at thet Rails guide for internationalization to see if there is any convenience stuff built in
[16:28:36] wd40s: has joined #RubyOnRails
[16:30:30] oystersauce8: has joined #RubyOnRails
[16:31:37] yfeldblum: has joined #RubyOnRails
[16:31:51] andywww: has left #RubyOnRails: ()
[16:32:10] Guest: has joined #RubyOnRails
[16:32:34] pawnbox: has joined #RubyOnRails
[16:33:50] tycoon177: will do cnk
[16:34:08] tycoon177: this is so annoying..
[16:34:13] roamingdog: has joined #RubyOnRails
[16:36:15] DoctorMonocular: has joined #RubyOnRails
[16:40:30] wd40s: has joined #RubyOnRails
[16:42:55] barhum2013: has joined #RubyOnRails
[16:43:46] pLaTo0n: has joined #RubyOnRails
[16:43:46] pLaTo0n: has joined #RubyOnRails
[16:44:14] manfrin: has joined #RubyOnRails
[16:45:02] arthurl: has joined #RubyOnRails
[16:45:11] arthurl: Mirubiri so the solution was easy..
[16:45:23] arthurl: nvm he's not here :)
[16:45:37] jheathco: has joined #RubyOnRails
[16:51:34] kiddorails: has joined #RubyOnRails
[16:52:27] jheathco: has joined #RubyOnRails
[16:52:29] njero: has joined #RubyOnRails
[16:53:10] zacts: has joined #RubyOnRails
[16:53:28] arnonhongklay: has joined #RubyOnRails
[16:54:42] tycoon177: cnk and lupine, I don't believe this to be an ascii thing like I was told, as the registered trademark symbol is not in standard ascii
[16:54:48] arup_r: has joined #RubyOnRails
[16:54:58] lupine: tycoon177: right, you need to find what encoding they expect
[16:55:05] lupine: TBH a UTF-8 CSV is not unusual
[16:55:26] tycoon177: They seem to think it was ASCII, so I asked for an example file
[16:55:35] morfin: ASCII have 0xAE
[16:55:54] morfin: and © as well
[16:56:05] lupine: the trademark in ISO 8859-1 would be 0x99
[16:56:10] lupine: (TM) I mean
[16:56:39] morfin: yes same in ASCII
[16:56:42] tycoon177: morfin, I'll try the encode with that charactercode
[16:56:56] morfin: ™ is 0x99
[16:57:10] strongcode: has joined #RubyOnRails
[16:57:33] morfin: i guess when you try to encode to UTF-8 it have still the same cod
[16:57:34] wd40s: has joined #RubyOnRails
[16:58:39] macsteps: has joined #RubyOnRails
[16:59:32] lupine: "™".bytes => [226, 132, 162]
[17:00:37] lupine: "™".encode!("ISO-8859-1") is not a happy bunny
[17:01:10] lupine: worst-case scenario is that they're not following a consistent character encoding and you'll need to write your own encoder
[17:03:37] harfangk: has joined #RubyOnRails
[17:04:37] nennes: has joined #RubyOnRails
[17:07:33] triptec: has joined #RubyOnRails
[17:09:03] jhack_: has joined #RubyOnRails
[17:10:53] artto: has joined #RubyOnRails
[17:11:46] tycoon177: that's definitely something I'd rather not do lupine
[17:11:54] tycoon177: But I mean..if it comes to that :(
[17:12:27] lupine: once you've managed to get them to specify exactly what it is they want, it should be easy enough
[17:13:17] lupine: but respecting encodings is much more difficult than UTF-8 imperialism
[17:13:33] wd40s: has joined #RubyOnRails
[17:15:33] dionysus69: has joined #RubyOnRails
[17:15:33] leea: has joined #RubyOnRails
[17:16:24] tycoon177: They say they use a special software (a $40 text editor) to open the csv. I'm using their trial now and guess what lupine
[17:16:33] tycoon177: IT DEFAULTS TO UTF-8
[17:16:59] dminuoso: If you buy a $40 text editor to open a csv file, go pick another profession. I dont want to clean up your code in a year from now.
[17:17:17] tycoon177: i'm not, dminuoso. It's who's printing our marketing stuff
[17:17:55] Papierkorb: People still pay for text editors?
[17:18:12] dminuoso: I would pay for vi if I had to.
[17:18:42] Detch: has joined #RubyOnRails
[17:20:04] tycoon177: vi? not vim?
[17:20:17] conta: has joined #RubyOnRails
[17:21:20] zacts|pi: has joined #RubyOnRails
[17:21:57] pawnbox: has joined #RubyOnRails
[17:23:23] mostlybadfly: has joined #RubyOnRails
[17:24:55] zacts_raincity: has joined #RubyOnRails
[17:25:53] JamesGames: has joined #RubyOnRails
[17:25:55] baweaver: There's already special software for opening and working with CSVs, it's called Excel in Businessland
[17:26:13] meoblast001: has joined #RubyOnRails
[17:26:14] kab: has joined #RubyOnRails
[17:26:30] kab: has left #RubyOnRails: ()
[17:26:41] JamesGames: hello peeps. Quick question how do I generate just new.html.erb? Im confused between new and create
[17:26:57] kab: has joined #RubyOnRails
[17:27:05] aegis3121: has joined #RubyOnRails
[17:27:34] tycoon177: JamesGames: New is the form, create is the action, which should redirect somewhere
[17:27:36] zacts: has joined #RubyOnRails
[17:27:58] JamesGames: tycoon177: so rails g controller new create?
[17:28:17] kab: has joined #RubyOnRails
[17:28:57] Oliphaunte: has joined #RubyOnRails
[17:29:08] tycoon177: I do not know what the generator should be. I manually create what I need.
[17:29:23] Dimik: has joined #RubyOnRails
[17:29:34] zacts|pi: has joined #RubyOnRails
[17:30:04] xall_: has joined #RubyOnRails
[17:30:17] JamesGames: tycoon177: I have a lot of data to input. how would I manually create these forms. I mean i know how to do thehtml.erb but the rest...?
[17:31:26] JamesGames: it might be handier just to generate them. anyone know? I don't wannna wipe what I have
[17:31:45] jsrn_: has joined #RubyOnRails
[17:31:54] flashpoint9: has joined #RubyOnRails
[17:32:00] jheathco: has joined #RubyOnRails
[17:32:04] JamesGames: hey flashpoint9
[17:32:27] flashpoint9: JamesGames: Hey man hows that project coming along?
[17:32:56] hahuang61: has joined #RubyOnRails
[17:33:07] JamesGames: flashpoint9: nearly done man! just inputting DB, an u no, css an JS an whatnot
[17:34:03] cnk: JamesGames: that generator will create the files but not the form
[17:34:34] JamesGames: cnk: Hello. But. I thought..
[17:34:50] cnk: You can either make the form you want manually - or you commit what you have and run rails g scaffold <field list>
[17:35:04] cnk: scaffold makes the form but the controller generator does not
[17:35:19] cnk: Or at least I think not, You can try it and see
[17:35:41] cnk: if you use version control you can roll back so it doesn't matter if you overwrite the files
[17:35:42] JamesGames: cnk: about the scaffold. That will Definately wipe my data. tell me moreabout the manual way
[17:36:30] JamesGames: once I have the forms. not 100% on how to link them up...
[17:37:07] cnk: why would htat wipe your data?
[17:37:14] cnk: you don't have to run the migration
[17:37:32] JamesGames: cnk: coz I made some files manually and the generation would wipe them
[17:37:34] cnk: look up form_for and start typing is the manual way
[17:37:53] cnk: it will not remove files. It will overrwrite those with same name
[17:38:06] cnk: hence my advice to "git commit"
[17:38:14] JamesGames: cnk: I can just paste another form in, change the variables and bobs my uncle
[17:38:25] cnk: OK that works
[17:38:36] cnk: are you using version control?
[17:39:11] JamesGames: cnk: if i do it manually, do i have to change the routes.rb
[17:39:29] JamesGames: I can do the form no problem
[17:39:36] cnk: You may have to add the route you need
[17:39:49] cnk: since I have no idea what you currently have... shrug
[17:40:11] JamesGames: cnk: see, now that is where i get lost. Maybe I gist the routes.rb?
[17:40:35] djbkd: has joined #RubyOnRails
[17:41:01] cnk: just run `rake routes` and see if you have a route for your thing's new actou
[17:42:49] JamesGames: cnk: https://gist.github.com/anonymous/450eb2b6dcb39fbac2a150466e4f4a03
[17:43:23] cnk: I don't know what model we are even talking about so can't help you
[17:43:28] cnk: need to get back to my own work
[17:43:43] JamesGames: cnk: Fair enough. thanks
[17:43:51] wd40s: has joined #RubyOnRails
[17:44:17] JamesGames: anyone know how to link a new.html.erb form to the db?
[17:44:30] JamesGames: a n y o n e ? ? ? ?
[17:46:20] SteenJobs: has joined #RubyOnRails
[17:49:11] fryguy: JamesGames: i have no idea what you mean by that
[17:49:47] weaksauce: has joined #RubyOnRails
[17:50:13] JamesGames: fryguy: really? i am trying to make a page that takes in the form values for a new room, saves the value to db
[17:50:22] Miccet: form_for?
[17:50:25] fryguy: JamesGames: you do that in your controller
[17:50:49] barhum2013: has joined #RubyOnRails
[17:51:00] JamesGames: fryguy: ok. form_for in the controller
[17:51:03] cnk: in controller's new action @room = Room.new
[17:51:13] cnk: then in form form_for @room
[17:51:21] Miccet: obvious troll is obvious?
[17:51:32] flashpoint9: JamesGames: Im good, sorry at work and getting slammed
[17:51:39] artto: has joined #RubyOnRails
[17:51:43] cnk: No just someone who should use 'rails g scaffold' and then edit
[17:52:16] JamesGames: fryguy: cnk: @room = Room.new , and at the end of the form in new.html.erb
[17:53:27] Miccet: you should really just make a scaffold and see how it all works, all your answers are there
[17:53:40] JamesGames: cnk: hang on I gist the controller
[17:54:36] fryguy: this is pretty amusing
[17:55:00] JamesGames: fryguy: have pity. I suck at this
[17:55:02] JamesGames: https://gist.github.com/anonymous/2e8a1ded17e901c33ffe810a24f5b58b
[17:55:58] Cohedrin: has joined #RubyOnRails
[17:56:25] cnk: You sure do. WTF?
[17:56:46] fryguy: ACTION bows out
[17:57:08] cnk: Gist the Room and Item models annotated with their fields
[17:57:18] zacts: has joined #RubyOnRails
[17:57:20] cnk: then write a coherent question and include that in the gist
[17:58:06] JamesGames: cnk: its a text based adventure. ok I do that. hang on.
[17:58:09] cnk: Also, I thought we were talking about a new action + a form. I don't see any o fthat in yoru controler giest
[17:58:28] JamesGames: cnk: yes i don't know how
[17:59:50] cnk: Make a new rails project (rails new testing), then in that, use rails g scaffold Item <field name list> and examine the code
[18:00:48] roamingdog: has joined #RubyOnRails
[18:02:07] JamesGames: cnk: That's the most logical thing. I should have thought of that. anyway, here:https://gist.github.com/anonymous/4e49da15ed4223641b50bc754b68609d
[18:03:11] barhum2013: has joined #RubyOnRails
[18:03:12] speakingcode: has joined #RubyOnRails
[18:03:15] cnk: that gist does not have the field annotations I asked for
[18:03:33] JamesGames: I dont know what they are
[18:03:34] cnk: I am trying to figure out your items instance variables
[18:03:45] zacts: has joined #RubyOnRails
[18:03:46] cnk: look in your schema.rb
[18:04:27] rafaelflores: has joined #RubyOnRails
[18:04:48] JamesGames: https://gist.github.com/anonymous/5994bd68eae5e9474066964aacf9037f
[18:04:58] ekinmur: has joined #RubyOnRails
[18:05:24] sloggerkhan: If I have to make a raw sql query prepared statement from `ActiveRecord::Base.connection.raw_connection.prepare` and I want to avoid creating a delegation of responsibility to call close on the connection (which I'm assuming needs to be done manually), do I pretty much have to process the query result in method instead of returning a Mysql2::Result ?
[18:05:54] JamesGames: cnk: what u think?
[18:07:37] cnk: I think in your current action, line 13, you don't want Item.all. You want the items belonging to the room
[18:07:44] cnk: @room.items
[18:08:49] cnk: I don't even want to know what your html looks like, but you can get rid of some if not all of the other instance variables if you use @room.items and then loop over them for descriptions etc
[18:09:11] cnk: but for your new / create questions, go somewhere else, make a scaffold and mine that for info
[18:09:20] zacts: has joined #RubyOnRails
[18:09:32] ben9099: has joined #RubyOnRails
[18:09:35] JamesGames: cnk: line 13, which file
[18:09:42] manfrin: has joined #RubyOnRails
[18:09:42] cnk: your controller file
[18:09:48] aegis3121: has joined #RubyOnRails
[18:09:53] cnk: that says @item = Item.all
[18:10:08] JamesGames: cnk: im gonna go an do a test scaffold. is the most logical thing. thanks again
[18:10:51] ben9099: how does RoR find classes? i've got a controller which is using a FooReport class which is in a reports folder (app/reports) and i'm just wondering generally how RoR finds these things when I don't see anything telling it to look in a given directory
[18:12:22] tbuehlmann: ben9099: check this: http://guides.rubyonrails.org/autoloading_and_reloading_constants.html
[18:13:09] hastur: has joined #RubyOnRails
[18:16:24] wd40s: has joined #RubyOnRails
[18:25:59] brianpWins: has joined #RubyOnRails
[18:26:24] rodferso1: has joined #RubyOnRails
[18:26:46] DoctorMonocular: has joined #RubyOnRails
[18:27:41] wd40s: has joined #RubyOnRails
[18:29:05] oystersauce8: has joined #RubyOnRails
[18:29:40] barhum2013: has joined #RubyOnRails
[18:34:16] dionysus69: has joined #RubyOnRails
[18:36:13] jstransky: has joined #RubyOnRails
[18:36:17] mdw: has joined #RubyOnRails
[18:37:56] DoctorMonocular: has joined #RubyOnRails
[18:39:29] wd40s: has joined #RubyOnRails
[18:39:56] xall_: has joined #RubyOnRails
[18:42:36] r_rios: has joined #RubyOnRails
[18:42:55] barhum2013: has joined #RubyOnRails
[18:43:53] tentacle: has joined #RubyOnRails
[18:45:52] tentacle: What's the status of ES6 on Rails 5? I'm searching but not seeing much, perhaps not looking in the right place.
[18:47:06] alfiemax: i just created a rails 5 app
[18:47:23] alfiemax: nothing fancy, it doesn't do anything as of now
[18:47:29] alfiemax: and deployed to heroku
[18:47:43] alfiemax: but it's giving me an error : #<RuntimeError: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`>
[18:47:54] alfiemax: i haven't checked in secrets.yml to my repo
[18:48:08] alfiemax: could that be it?
[18:48:39] alfiemax: but it's recommended not to add that file to the repo right?
[18:49:36] cnk: alfiemax: right - your secrets.yml should have a production bit that says get that key from tne environment
[18:50:06] cnk: .... hmmm but that file isn't there.... check the heroku docs, they should cover what to do
[18:53:36] alfiemax: cnk, i just checked that file in and set the value via ENV vars
[18:54:07] wd40s: has joined #RubyOnRails
[18:54:10] JamesGames: has joined #RubyOnRails
[18:54:19] cnk: that's a pretty common option
[18:54:29] JamesGames: cnk: your still here!!
[18:55:11] cnk: how goes your scaffold grafting?
[18:55:18] JamesGames: cnk: im getting a table already exists error when I try to migrate!
[18:55:45] KnownSyntax: has joined #RubyOnRails
[18:55:45] KnownSyntax: has joined #RubyOnRails
[18:55:47] JamesGames: cnk: I saved the modifed files locally and ran a scaffold
[18:56:02] alfiemax: JamesGames, that's be cause the table you're trying to create via migration already exists in the db
[18:56:12] JamesGames: cnk: How do i delete it?
[18:56:25] alfiemax: rake db:drop
[18:56:29] JamesGames: i forced the scaffold
[18:56:30] alfiemax: and start from scratch
[18:56:44] Leepoff: has joined #RubyOnRails
[18:56:47] cnk: but then he has to remove the previous migration too
[18:56:53] JamesGames: what does rake db:drop do?
[18:56:58] cnk: drops the db
[18:57:06] alfiemax: deletes the db that you have
[18:57:09] cnk: I think you want ot remove the migraiton that scaffold just created
[18:57:09] JamesGames: all of them?
[18:57:14] macsteps: has joined #RubyOnRails
[18:57:23] cnk: your entire db - all your tables
[18:57:42] cnk: just remove the migration that was just created. It should match what you already have so is irrelevant
[18:58:10] JamesGames: ok. cnk . just click and delete yeah?
[18:58:12] terrabl: has joined #RubyOnRails
[18:58:37] JamesGames: and the rest will link up?
[18:59:02] cnk: as long as your table definitions match, yes
[18:59:53] JamesGames: cnk: ok. gimme a minute. I will return!
[19:00:30] cnk: \me hides
[19:03:09] glasz_: has joined #RubyOnRails
[19:04:18] KnownSyntax_: has joined #RubyOnRails
[19:04:18] KnownSyntax_: has joined #RubyOnRails
[19:11:22] dionysus69: has joined #RubyOnRails
[19:12:05] ElFerna: has joined #RubyOnRails
[19:13:19] zpe: has joined #RubyOnRails
[19:13:43] jamesgames_: has joined #RubyOnRails
[19:14:02] johnkpaul: can I mount an entire application under a few pieces of a route?
[19:14:20] johnkpaul: in my case, I need to add internationalization with a /us/en/all_current_routes
[19:14:27] johnkpaul: or a /uk/en/all_current_routes
[19:14:38] johnkpaul: so I want to mount the app two levels deep, and have wildcard for the first two levels
[19:14:47] johnkpaul: everything I’m finding about mounting routes is about Rails Engines
[19:14:58] johnkpaul: do I have to convert my application into a rails engine to do this?
[19:15:55] jenrzzz: has joined #RubyOnRails
[19:16:23] CanTonic: has joined #RubyOnRails
[19:18:13] tentacle: has joined #RubyOnRails
[19:18:35] cnk: mostly I think that is because engines are a context where there are multiple routes files
[19:19:05] cnk: Look at the mechanics of including routes from engines and that might give you an idea of how to do the mounting
[19:19:32] cnk: Rails routing is motly composiging rack apps, so thre is likely a way but I don't know it off hand
[19:19:40] cnk: Radar might when he gets in
[19:20:53] banisterfiend: has joined #RubyOnRails
[19:21:13] jamesgames_: cnk: it kina worked!
[19:21:38] djbkd: has joined #RubyOnRails
[19:22:09] cnk: excellent!
[19:22:11] cnk: congrats
[19:22:15] jamesgames_: i can type /items/1 and i get the first item, but isen't there a way to list them and add new ones
[19:22:31] cnk: yes there is, at /items/
[19:22:43] roamingdog: has joined #RubyOnRails
[19:22:59] cnk: too much django - probably just /items
[19:23:51] Mirubiri: has joined #RubyOnRails
[19:25:26] jamesgames_: cnk: fking excellent! Sworkin meng!
[19:26:14] aegis3121: has joined #RubyOnRails
[19:27:20] wd40s: has joined #RubyOnRails
[19:28:31] fmcgeough: has joined #RubyOnRails
[19:28:52] Mirubiri: has joined #RubyOnRails
[19:28:57] ekinmur: has joined #RubyOnRails
[19:31:45] Leepoff: has joined #RubyOnRails
[19:32:49] ekinmur: has joined #RubyOnRails
[19:33:24] Ergo: has joined #RubyOnRails
[19:34:48] tycoon177: lupine: this is really bothering me. It really shouldn't, but "It was encoded as ASCII" and "The registered trademark symbol was on that file" are mutually exclusive to eachother. This is another IT person! They need to know this stuff
[19:35:24] lupine: tycoon177: what you need them to do, if they can't answer the question, is to give you a set of examples you can work from
[19:35:54] tycoon177: I asked for the file itself from a few months ago that is supposedly ascii
[19:36:01] tycoon177: They haven't delivered yet
[19:36:47] banisterfiend: has joined #RubyOnRails
[19:39:17] xall_: has joined #RubyOnRails
[19:40:10] USvER: has joined #RubyOnRails
[19:40:12] moeabdol: has joined #RubyOnRails
[19:42:02] leea: has joined #RubyOnRails
[19:43:11] wd40s: has joined #RubyOnRails
[19:44:52] amperry: has joined #RubyOnRails
[19:45:24] havenwood: amperry: hi
[19:46:06] amperry: don't know if I'm too close to the code, but I can't seem to track down the missing close paren here: https://gist.github.com/amp108/fb68cf3de6f89ffd65b95414165ec3c6
[19:46:15] amperry: hi, havenwood
[19:46:32] tentacle: has joined #RubyOnRails
[19:46:35] triptec: has joined #RubyOnRails
[19:46:52] Leepoff: has joined #RubyOnRails
[19:47:25] tentacle: What's the status of ES6 on Rails 5? Would be cool to use React/Reflux, but unsure of what approach (es6, webpack, browserify, etc)
[19:48:24] havenwood: tentacle: There's a nice react-rails gem: https://github.com/reactjs/react-rails
[19:48:40] tentacle: havenwood: yeah, I've used that, but looking to also do es6
[19:49:00] tentacle: I've seen the sprockets-es6, but I read somewhere that Rails 5 was supposed to natively support ES6, but I'm not seeing it anywhere
[19:49:03] matthewd: amperry: <%= end %> is your problem
[19:49:16] amperry: need to drop the =
[19:49:30] amperry: see, was just too close to the code to see
[19:49:37] Ergo: has joined #RubyOnRails
[19:50:34] Megamos: has joined #RubyOnRails
[19:50:50] amperry: matthewd: thanks
[19:51:03] glasz: has joined #RubyOnRails
[19:53:41] dionysus69: has joined #RubyOnRails
[19:55:14] JamesGames: has joined #RubyOnRails
[19:55:28] JamesGames: https://gist.github.com/anonymous/a18a483527801cb8c3dd7d14f4acca28
[19:55:42] JamesGames: cnk: u there?
[19:56:14] tycoon177: lupine: the actual charset according to file -I file.csv is: ISO-8859-1
[19:56:27] JamesGames: arite here's the deal. I scaffolded and the thing is showing the room attributes, not the users view of the room
[19:56:47] dionysus69: has joined #RubyOnRails
[19:56:57] lupine: tycoon177: awesome. I'd just use that then
[19:57:08] lupine: be prepared for random non-conformant files from time to time
[19:57:25] lupine: (maybe they'll get a malaysian customer or something, who knows)
[19:57:28] tycoon177: do you know of a way to export to a csv directly to that format?
[19:57:36] pwnd_nsfw: has joined #RubyOnRails
[19:57:42] djbkd: has joined #RubyOnRails
[19:57:45] lupine: are you starting from require 'csv' ?
[19:57:49] JamesGames: tycoon177: how are you?
[19:57:56] WhereIsMySpoon_: has joined #RubyOnRails
[19:58:11] tycoon177: I have that, lupine, but it currently outputs utf-8
[19:58:18] tycoon177: i'm alright JamesGames, you?
[19:58:37] JamesGames: nearly finished. so --happy--!!
[19:59:02] ecnalyr: has joined #RubyOnRails
[19:59:04] lupine: http://ruby-doc.org/stdlib-2.3.1/libdoc/csv/rdoc/CSV.html#method-c-new
[19:59:12] lupine: tycoon177: the :converters comment is informative
[19:59:36] arup_r: has joined #RubyOnRails
[19:59:37] lupine: input data will be converted to UTF-8
[19:59:45] lupine: so you can either write a set of converters that do not do that
[19:59:48] JamesGames: anyone feel like helping me fix mi routes?
[19:59:52] lupine: or you can convert the entire output
[20:00:05] crystal77: has joined #RubyOnRails
[20:00:25] JamesGames: https://gist.github.com/anonymous/a18a483527801cb8c3dd7d14f4acca28
[20:00:28] GodFather: has joined #RubyOnRails
[20:00:42] djbkd: has joined #RubyOnRails
[20:00:43] ur5us: has joined #RubyOnRails
[20:01:14] arBmind: has joined #RubyOnRails
[20:01:20] srinidhi: has joined #RubyOnRails
[20:01:25] n90b0jjf: has joined #RubyOnRails
[20:02:21] macsteps: has joined #RubyOnRails
[20:03:34] solars: has joined #RubyOnRails
[20:04:19] JamesGames: its supposed to give me user/show.html.erb and i get /room/show.html.erb
[20:07:55] aegis3121: has joined #RubyOnRails
[20:08:48] roshanavand: has joined #RubyOnRails
[20:10:14] pwnd_nsfw`: has joined #RubyOnRails
[20:11:16] finnnnnnnnnnn: has joined #RubyOnRails
[20:12:20] finnnnnnnnnnn: how do I pass an array in a query sring using the check_box_tag? I want the url to be something.com?numbers[]=1&numbers[]=2&numbers[]=3
[20:12:33] finnnnnnnnnnn: using a series of checkboxes, obvs
[20:12:49] wd40s: has joined #RubyOnRails
[20:13:01] matthewd: finnnnnnnnnnn: What have you tried, and how did the result differ from what you wanted?
[20:14:09] tycoon177: lupine, I think it's fixed. Thank you so much! I just generated a file with that charset (I had to change the response header in the controller to reflect this) and sent it over to someone else so that they can take a look.
[20:15:23] isjaylee: has joined #RubyOnRails
[20:15:24] finnnnnnnnnnn: matthewd: hey, I’m doing this - https://gist.github.com/anonymous/698407bb61c7bb397ae0d97c1901e92d
[20:15:54] finnnnnnnnnnn: ugh, anon gist. one sec and I’ll redo so I can add more files.
[20:16:44] mikecmpbll: has joined #RubyOnRails
[20:18:51] Doddlin: has joined #RubyOnRails
[20:19:07] pwnd_nsfw: has joined #RubyOnRails
[20:19:10] finnnnnnnnnnn: here we go - https://gist.github.com/fionnbharra/43ee6c696348df286c834e819e5f286a
[20:22:38] Megamos: has joined #RubyOnRails
[20:23:04] pawnbox: has joined #RubyOnRails
[20:23:13] lupine: tycoon177: hmmm, if all you changed is the response header
[20:23:22] lupine: chances are you're sending them a UTF-8 document still
[20:24:00] tycoon177: lupine: I also added .encode("ISO-8859-1") to the csv string :)
[20:24:16] wd40s: has joined #RubyOnRails
[20:24:24] tycoon177: It passed the first test and now I am going to send it over to the company that does the prints to get their verification
[20:25:21] pwnd_nsfw`: has joined #RubyOnRails
[20:27:23] lupine: excellent :)
[20:27:30] atomx: has joined #RubyOnRails
[20:30:22] finnnnnnnnnnn: figured it out, I was being an idiot
[20:32:10] isjaylee: has left #RubyOnRails: ()
[20:35:34] ekinmur: has joined #RubyOnRails
[20:36:27] fmcgeough: has joined #RubyOnRails
[20:41:06] quazimodo: has joined #RubyOnRails
[20:41:14] quazimod1: has joined #RubyOnRails
[20:45:02] jenrzzz: has joined #RubyOnRails
[20:45:02] jenrzzz: has joined #RubyOnRails
[20:46:02] wd40s: has joined #RubyOnRails
[20:53:09] Ergo: has joined #RubyOnRails
[20:53:27] solars: has joined #RubyOnRails
[21:00:18] kitsuneyo: has joined #RubyOnRails
[21:00:54] safetypin: has joined #RubyOnRails
[21:00:58] kitsuneyo: what unit tests should a join table have?
[21:01:23] kitsuneyo: or is it better to just the two models it joins?
[21:02:20] banisterfiend: anyone here use 'readthis' as their rails cache?
[21:03:11] marr: has joined #RubyOnRails
[21:03:20] banisterfiend: how do i configure it so it uses redis when developing locally too -- sidekiq for example appears to 'just work' with the redis-server i have running (i dont have to provide any extra config) but the readthis cache doesn't appear to use redis, it's falling back to null store
[21:05:49] dunpeal: has joined #RubyOnRails
[21:06:35] whathappens: has joined #RubyOnRails
[21:09:08] edwinvdgraaf: has joined #RubyOnRails
[21:11:21] yfeldblum: has joined #RubyOnRails
[21:11:53] leea: has joined #RubyOnRails
[21:12:23] finnnnnnnnnnn: has joined #RubyOnRails
[21:12:36] amperry: has joined #RubyOnRails
[21:13:38] roshanavand: has joined #RubyOnRails
[21:14:05] amperry: hi, all, back again with a basic question: when you submit a search form, where can you find either the ActiveRecord query or generated "SELECT" statement?
[21:14:17] Megamos: has joined #RubyOnRails
[21:14:50] adaedra: look at your logs
[21:16:12] USvER[1]: has joined #RubyOnRails
[21:17:16] aegis3121: has joined #RubyOnRails
[21:17:55] workmad3: has joined #RubyOnRails
[21:19:41] rhett: has joined #RubyOnRails
[21:20:20] amperry: adaedra: thanks, now I'm just confused about why the sql query doesn't work :S
[21:21:53] GnuYawk: has joined #RubyOnRails
[21:21:55] whathappens: has joined #RubyOnRails
[21:33:48] dunpeal: has joined #RubyOnRails
[21:37:37] rubyonrails003: has joined #RubyOnRails
[21:38:27] JamesGames: has joined #RubyOnRails
[21:39:46] n90b0jjf_: has joined #RubyOnRails
[21:40:05] amperry: if anyone wants to solve a purely mysql mystery: https://gist.github.com/amp108/eecc385e7d7e5a918a3be0ae4f2f03b4
[21:40:16] Puffball: has joined #RubyOnRails
[21:40:37] amperry: started out in rails, but turns out not to work in the mysql client either.
[21:41:20] rails673: has joined #RubyOnRails
[21:42:06] phredus_: has joined #RubyOnRails
[21:42:54] finnnnnnnnnnn: has joined #RubyOnRails
[21:43:14] JamesGames: having weird problems here. https://gist.github.com/anonymous/45334eb5b35b6810b320c7bcc6947350
[21:43:31] JamesGames: and yes. I am aware that my code is an abomination
[21:44:30] JamesGames: no joke, it really is
[21:45:00] flashpoint9: has joined #RubyOnRails
[21:45:10] amperry: JamesGames: if it were for the game Zombicide, that might not be a bad thing :)
[21:46:26] JamesGames: amperry: I have so very nearly done what i set out to do. i can't let a little thing like total incompetence stop me
[21:46:51] JamesGames: hey flashpoint9 !!
[21:46:56] JamesGames: we meet again
[21:48:07] JamesGames: amperry: it's for a game called scribble wars - the phantom doodle
[21:50:51] leea: has joined #RubyOnRails
[21:51:53] JamesGames: it runs, but it really really shouldn't, it defies nature
[21:53:33] crystal77: has joined #RubyOnRails
[21:53:47] cd-rum: has joined #RubyOnRails
[21:55:06] JesseH: has joined #RubyOnRails
[21:55:17] JamesGames: any ideas why the arrays go funny?
[21:55:36] amperry: I'm afraid I have none
[21:55:40] Jasaka: has joined #RubyOnRails
[21:55:50] cd-rum_: has joined #RubyOnRails
[21:55:51] amperry: although I'm a fellow stranded passenger here
[21:56:02] JamesGames: amperry: im not changing the db, just adding views via scaffold
[21:56:37] JamesGames: amperry: u stuck on somethin?
[21:57:01] amperry: some generated sql not pulling a record that I think it should
[21:57:17] Trynemjoel: has joined #RubyOnRails
[21:58:06] quazimodo: has joined #RubyOnRails
[21:58:21] amperry: https://gist.github.com/amp108/eecc385e7d7e5a918a3be0ae4f2f03b4
[21:59:13] JamesGames: amperry: iv only been doing this a few months
[21:59:58] JamesGames: btw anyone wanna step in an suggest something 4 :https://gist.github.com/anonymous/45334eb5b35b6810b320c7bcc6947350
[22:01:41] CanTonic: has joined #RubyOnRails
[22:03:06] Darmani: has joined #RubyOnRails
[22:03:13] quazimod1: has joined #RubyOnRails
[22:07:09] flashpoint9: has joined #RubyOnRails
[22:08:11] cd-rum: has joined #RubyOnRails
[22:08:15] amperry: more general question: what is the preferred ActiveRecord syntax to query a date between @start_date and @end_date?
[22:08:37] shinnya: has joined #RubyOnRails
[22:08:49] jenrzzz: has joined #RubyOnRails
[22:08:54] jenrzzz: has joined #RubyOnRails
[22:11:00] n90b0jjf: has joined #RubyOnRails
[22:12:21] wd40s: has joined #RubyOnRails
[22:14:03] banisterfiend: has joined #RubyOnRails
[22:14:28] JamesGames: https://gist.github.com/anonymous/1326bc94dea9cb39367f28be8531f7a4 a n n n n n n y o n e ?
[22:15:46] superlou: has joined #RubyOnRails
[22:15:51] JamesGames: im so close ....
[22:16:51] JamesGames: amperry: u know about arrays, right?
[22:19:10] amperry: a little, in some languages
[22:19:16] greengriminal: has joined #RubyOnRails
[22:19:44] JamesGames: so, what would turn a boolean and make values undefined or blank?
[22:20:38] JamesGames: can I post a screenshot?
[22:20:56] amperry: to the gist? be my guest
[22:21:05] greengriminal: Hey all, quick question when you call #save on a active model object does it implicitly freeze an object ?
[22:22:01] JamesGames: amperry: how?
[22:22:56] reaVer: has joined #RubyOnRails
[22:23:14] JamesGames: there must be another pastebin online
[22:23:32] amperry: JamesGames: take a screenshot (however your OS/window manager do that), then add the resulting image file to the gist.
[22:23:42] wd40s: has joined #RubyOnRails
[22:24:21] oystersauce8: has joined #RubyOnRails
[22:26:52] tentacle: has joined #RubyOnRails
[22:27:30] JamesGames: it wont let me on gist. is there another pastebin?
[22:28:06] JamesGames: amperry: did u look at my controller
[22:28:09] amperry: JamesGames: I don't know. This gist is anonymous so I don't know if it lets you edit one
[22:29:13] amperry: JamesGames: I glanced at it, but I'm afraid I'm struggling with my own stuff right now.
[22:29:32] JamesGames: http://picpaste.com/screenshot-ayq4wp7Q.png
[22:30:22] JamesGames: could you reglance? Is the last part of a huuuuuge project
[22:31:12] amperry: I'll take another look, but make no promises.
[22:31:41] JamesGames: amperry: more than fair.
[22:31:49] amperry: solved my own problem, and the answer is, ActiveRecord query interface is fscked.
[22:32:08] JamesGames: cool. go you!
[22:33:07] chipotle: has joined #RubyOnRails
[22:33:19] amperry: JamesGames: "messed up", how?
[22:33:36] jenrzzz_: has joined #RubyOnRails
[22:34:26] jgoulah: has joined #RubyOnRails
[22:34:26] JamesGames: the red line on the screenshot supposed to print the game output. The booleans are reversed and the js discriptoins give null or blank values
[22:34:51] JamesGames: is messed up. i get wrong or no output
[22:35:20] matthewd: amperry: .where(my_date: @start_date..@end_date) ?
[22:35:21] JamesGames: It worked b4 i did the room scaffold so I suspect the controller
[22:35:49] matthewd: amperry: The weird IN query is doing something quite unlike what you intend
[22:36:00] amperry: matthewd: that's it, although the docs I was working from didn't include that as a possibility
[22:36:41] amperry: guides.rubyonrails.org/active_record_querying.html
[22:36:58] amperry: but when I changed it to that, it generated what I was hoping to see.
[22:37:25] amperry: I just don't know why it works for much earlier dates, unless it has something to do with being > '2016-anything'
[22:37:51] amperry: so... any better reference than guides.rubyonrails.org?
[22:39:05] norfumpit: has joined #RubyOnRails
[22:39:27] matthewd: JamesGames: !rule10
[22:39:27] helpa: JamesGames: Do not beg / plead with people to help you. This includes asking questions like "Any ideas?" after posting your original question.
[22:39:48] norfumpit: has joined #RubyOnRails
[22:40:07] matthewd: amperry: "2.3.2 Range Conditions" ?
[22:40:45] amperry: matthewd: well, sonova... thanks
[22:41:32] matthewd: amperry: It's not working for "earlier" dates... read the IN clause closely
[22:42:10] matthewd: amperry: It's returning records whose date is one of three values: 'date >= ? and date <= ?', '2014-07-01', and '2016-07-31'
[22:43:22] matthewd: amperry: I doubt you have many records with a date of 'date >= ? and date <= ?' (because that's.. not a date), so that's why it's only returning the row with the exact date of 2014-07-01
[22:44:20] amperry: matthewd: 'splains e'rrything, including a couple of other problems I was having.
[22:45:15] amperry: btw, I was fixated on section "2.2.1 Placeholder Conditions"
[22:45:21] matthewd: amperry: You didn't show your ruby code, but I assume you were doing .where(foo: ['sql fragment', value, value]) -- that's not a thing.
[22:46:47] triptec: has joined #RubyOnRails
[22:46:54] matthewd: I mean.. it is.. that's why it built a syntactically valid query. But it's doing what's described under 2.3.3: no SQL / placeholders, just plain any-of-these.
[22:47:02] Moeh: has joined #RubyOnRails
[22:47:08] iwada: has joined #RubyOnRails
[22:47:41] matthewd: amperry: The big clue was that your "SQL" conditional was quoted as a string in the generated query
[22:47:42] crystal77: has joined #RubyOnRails
[22:48:43] amperry: so the bit quoted in 2.2.1 ... what's that for?
[22:49:02] wethu: has joined #RubyOnRails
[22:49:11] matthewd: That's not using a hash
[22:49:38] matthewd: Err, it's using a hash for the placeholders, but the first argument to the where method is a string
[22:49:51] macsteps: has joined #RubyOnRails
[22:51:08] dminuoso: has joined #RubyOnRails
[22:51:17] iwada: Im getting a master failed to start, check stderr log for details error when starting Unicorn...
[22:51:49] amperry: hmmmm... a specific example of why not to mix sql strings with ActiveRecord. I wouldn't if I were better with the latter :\
[22:51:51] dminuoso: iwada: Go check your unicorn log? ...
[22:51:59] iwada: bundler: failed to load command: unicorn (/home/deploy/apps/app_production/shared/bundle/ruby/2.3.0/bin/unicorn)
[22:52:15] JamesGames: https://gist.github.com/anonymous/5b7e3e7411419b902cad11fa1af6e295
[22:52:32] iwada: dmiuoso, relevant details on unicorn.log
[22:53:35] eljimbo: has joined #RubyOnRails
[22:53:38] iwada: dminuoso,
[22:54:09] dminuoso: iwada: What the fuck am I supposed to do with this information?
[22:54:13] matthewd: amperry: You can mix them.. you just have to do it correctly. If you expect to be able to mix & match parameters in the middle of a single method call, then yes: "ActiveRecord query interface is fscked."
[22:54:45] JamesGames: amperry: right i had an idea. where is the line of code that directs the user once they sign in?
[22:54:54] matthewd: dminuoso: Put your manners back in
[22:54:55] dminuoso: iwada: Use gist, include relevant code, include your Gemfile, include the full error, including any stack traces you might have gotten. Include the command you are using.
[22:55:13] dminuoso: matthewd: done.
[22:55:23] dminuoso: Just checking if you are there.
[22:55:47] amperry: matthewd: suitably humbled.
[22:56:45] amperry: JamesGames: I am unable to help you right now, but wish you luck. Writing games is an excellent reason to code.
[22:56:48] apotry: has joined #RubyOnRails
[22:58:58] iwada: dminuoso, https://gist.github.com/anonymous/2609982ea947bfe5534cb2f98f97ae8b
[23:00:41] dminuoso: iwada: Please include the Gemfile as I asked, and also all relevant capistrano config files you have on your setup.
[23:01:12] dminuoso: And the command you used, as I asked.
[23:01:23] jstransky: has joined #RubyOnRails
[23:01:42] fmcgeough: has joined #RubyOnRails
[23:02:26] triptec: has joined #RubyOnRails
[23:02:54] jarred: has joined #RubyOnRails
[23:03:42] l4v2: has joined #RubyOnRails
[23:04:00] jarred: Finding by ID in a PostgreSQL table with ~60,000 rows is taking ~40ms. The ID is the standard auto-incrementing integer column with Rails. What should I investigate here?
[23:06:13] dminuoso: jarred: Debug your cobber wires?
[23:06:16] edwinvdgraaf: has joined #RubyOnRails
[23:06:36] dminuoso: jarred: Have you profiled the query with EXPLAIN ANALYZE directly in psql?
[23:07:21] dminuoso: jarred: My database can handle index lookups through about 5 billion rows in under 10ms consistently, so... :-)
[23:08:00] jarred: i'm very confused
[23:08:07] jarred: this isn't like an ancient computer either
[23:08:08] rafaelfranca: has joined #RubyOnRails
[23:08:13] dminuoso: jarred: What value is this basedo n though?
[23:09:02] jarred: value? The query it's doing is like Seen Load (39.6ms) SELECT "seens".* FROM "seens" WHERE "seens"."id" = $1 LIMIT 1 [["id", 3]]
[23:09:09] jarred: SELECT "seens".* FROM "seens" WHERE "seens"."id" = $1 LIMIT 1 [["id", 3]*
[23:09:15] dminuoso: jarred: Remember you have ActiveRecord overhead in a) its magic that it does, query generation, then you have network overhead, and then some more overhead for object creation in Ruby - so 40ms for a round trip doesn't sound too unlikely.
[23:10:07] jarred: great point.
[23:10:17] dminuoso: jarred: A quick way to test would be to run that particular query with EXPLAIN ANALYZE SELECT "seens".* FROM "seens" WHERE "seens"."id" = 1; in your psql shell.
[23:10:39] dminuoso: Which I reckon should execute in about 4-6ms
[23:10:41] jarred: Execution time: 0.300 ms lol
[23:10:45] dminuoso: Even better!
[23:10:45] jarred: yeah. it's rails
[23:10:47] isberg: has joined #RubyOnRails
[23:11:04] dminuoso: But then again I never connect with psql locally, so it doesnt surprise me. :)
[23:12:14] iwada: dminuoso, https://gist.github.com/anonymous/7c8a61c767fa5935d36f4431c3bf4f99
[23:12:20] iwada: Thanks for helping...
[23:13:02] Axsuul: has joined #RubyOnRails
[23:13:20] dminuoso: iwada: Please use separate files on gist github
[23:15:07] dminuoso: iwada: are you executing that command, or is capistrano doing that?
[23:15:19] dminuoso: Your first gist indicates that capistrano is doing it, in which case I would like to know how you invoke capistrano.
[23:19:13] sarink: has joined #RubyOnRails
[23:19:44] iwada: dminuoso, https://gist.github.com/anonymous/cd1c01d10b318ce1755c078e3dff9a3f
[23:20:22] iwada: The deploy fails with capistrano, even fails when i run that command manually on the server
[23:22:18] dminuoso: iwada: Try starting it manually in a different environment.
[23:22:32] dminuoso: i.e. RAILS_ENV=development
[23:23:23] edwinvdgraaf: has joined #RubyOnRails
[23:23:53] wd40s: has joined #RubyOnRails
[23:29:50] iwada: dminuoso, works with development
[23:31:38] dminuoso: iwada: please also attach your unicorn config file for your production environment
[23:32:34] apotry: has joined #RubyOnRails
[23:35:09] hastur: i'm a little confused about associations. so, i create the model, then associate it to a user? or do i use something like user.create(model_params) ?
[23:35:46] hastur: is association done on create, or on save?
[23:39:22] Mirubiri: hastur what is your definition of "association"
[23:39:46] hastur: user has_many model
[23:39:59] hastur: model belongs_to user
[23:40:24] Mirubiri: on if users is saved or not
[23:41:09] hastur: i'm working with devise for users, if that helps
[23:41:52] Mirubiri: hastur: you can write user.create_model(params)
[23:42:14] Mirubiri: if user is saved, the the relation is saved automatically
[23:42:21] iwada: dminuoso, Thank you for your time in assisting...
[23:42:23] iwada: https://gist.github.com/anonymous/238310a402f97fa8a90e5608f63d86a4
[23:45:20] dragon9783: has joined #RubyOnRails
[23:46:17] macsteps: has joined #RubyOnRails
[23:48:09] Darmani: What would be the easiest way to create a customer's order history?
[23:48:33] Darmani: I thought a boolean and a timestamp would work but I'm not sure if that's thorough enough.
[23:51:49] dalbusch1t: has joined #RubyOnRails
[23:52:51] ben9099: has joined #RubyOnRails
[23:53:56] quazimodo: has joined #RubyOnRails
[23:54:53] rakm: has joined #RubyOnRails
[23:55:14] ben9099: i called "rails generate controller Foo index" and it created the files and the route "get 'foo/index'" but when i go to http://bar.com/foo I get Routing Error No route matches [GET] "/foo". What am i doing wrong? Is there some option that makes index served automatically?
[23:55:40] Mirubiri: has joined #RubyOnRails
[23:58:53] wd40s: has joined #RubyOnRails
[23:59:07] quazimod1: has joined #RubyOnRails
[23:59:26] KnownSyntax: has joined #RubyOnRails
[23:59:26] KnownSyntax: has joined #RubyOnRails