« Back to channel list

#RubyOnRails - 05 May 2016

« Back 1 day Forward 1 day »
[00:01:41] dudepare: has joined #RubyOnRails
[00:01:46] hck89: has joined #RubyOnRails
[00:02:22] Shidash: has joined #RubyOnRails
[00:03:32] FooMunki: has joined #RubyOnRails
[00:12:29] dbkbali: has joined #RubyOnRails
[00:12:33] htmldrum: has joined #RubyOnRails
[00:15:09] xcesariox: has joined #RubyOnRails
[00:15:37] timdotrb: has joined #RubyOnRails
[00:18:58] roamingdog: has joined #RubyOnRails
[00:20:56] flashpoint9: has joined #RubyOnRails
[00:21:19] Infinite_182: has joined #RubyOnRails
[00:21:43] superlou: has joined #RubyOnRails
[00:24:01] sneakerhax: has joined #RubyOnRails
[00:24:07] Ispira: has joined #RubyOnRails
[00:24:12] hck89: has joined #RubyOnRails
[00:24:27] ensyde: has joined #RubyOnRails
[00:24:54] ftj: has joined #RubyOnRails
[00:28:27] kies: has joined #RubyOnRails
[00:28:37] jenrzzz: has joined #RubyOnRails
[00:29:32] Infinite_182: has joined #RubyOnRails
[00:31:01] chouhoulis: has joined #RubyOnRails
[00:31:13] maxz: has joined #RubyOnRails
[00:31:24] moeabdol: has joined #RubyOnRails
[00:34:29] roamingdog: has joined #RubyOnRails
[00:34:32] Darmani: has joined #RubyOnRails
[00:34:58] Radar: Darmani: hi
[00:35:13] Darmani: Radar: How are you friend?
[00:36:06] Radar: I am good, friend.
[00:36:23] Radar: I am battling React and I'm winning which only really means I _think_ I'm winning and React is about to fuck my whole day :D
[00:36:35] roamingdog: has joined #RubyOnRails
[00:36:36] Radar: At least it's not Angular where it would be an entire week.
[00:36:44] Darmani: ACTION googles React
[00:37:02] benlieb: how can I configure my dev environment so coffee script output isn't minified?
[00:37:30] Darmani: Radar: That looks like fun lol
[00:37:40] mwlang: rant: what is the point? “return @delivery_address rescue nil”
[00:38:00] Ropeney: has joined #RubyOnRails
[00:38:17] phantummm: has joined #RubyOnRails
[00:38:38] Darmani: Radar: I have a stupid question for you.
[00:39:45] Radar: mwlang: seemingly nothing
[00:39:50] macsteps: has joined #RubyOnRails
[00:40:11] Radar: mwlang: @delivery_address should be evaluated at that point. If it's nil, then it will return nil. The `rescue nil` looks pointless.
[00:40:27] Radar: Darmani: There are no dumb questions. Questions mean that you are wanting to learn something.
[00:40:44] Darmani: Radar: All questions are stupid to the great and powerful Radar d:
[00:41:05] mwlang: Radar: exactly. hence the rant. The developer for this app uses rescue nil all over the frickin place. This is defensive programming on steroids.
[00:41:31] Radar: mwlang: "rescue nil" is a paddlin' imo
[00:41:44] mwlang: If I knew where this poor soul was reachable, I’d send him Avdi’s Confident Ruby
[00:42:31] mwlang: add it to the rules!
[00:42:51] Radar: git blame :D
[00:43:17] Radar: Darmani: 1) What is the problem? 2) is the code on GitHub
[00:43:53] Darmani: Radar: It's not that kinda question lol it's more like I need some advice careerwise.
[00:44:24] Radar: Darmani: ha :) The one time I pre-empty
[00:44:45] Darmani: Radar: pre-empty? lol
[00:45:05] Radar: Too much empty? checking in Ruby :)
[00:45:31] Darmani: Radar: Ah okay, well anyway here's my question
[00:45:58] Darmani: Radar: Or maybe should I pm you? o.o
[00:46:11] mwlang: Radar: if only it were that simple! I set up the git repo from a subversion repo that turned out to be out of date, so ended up just started with deployed live code. :-p
[00:46:23] Radar: mwlang: oh crap
[00:46:25] Radar: Darmani: Yeah go ahead
[00:46:26] FooMunki: has joined #RubyOnRails
[00:50:33] chouhoulis: has joined #RubyOnRails
[00:51:01] Radar: Darmani: I got disconnected. Did you send a PM?
[00:51:23] Darmani: Radar: Yeah I did. Should I send it again?
[00:52:37] Craigimus: has joined #RubyOnRails
[00:55:01] bronson: has joined #RubyOnRails
[00:58:31] Radar: http://imgur.com/qGZ5C9x
[00:58:37] Radar: Told you React would some how mess me up :D
[00:59:24] choke: has joined #RubyOnRails
[01:00:28] Craigimus: has joined #RubyOnRails
[01:01:06] Ebok: has joined #RubyOnRails
[01:04:19] htmldrum: has joined #RubyOnRails
[01:05:21] fryguy: has joined #RubyOnRails
[01:07:18] FooMunki: has joined #RubyOnRails
[01:07:55] Maletor: has joined #RubyOnRails
[01:09:09] Ebok: When dynamically creating an img tag using javascript on top of a ruby on rails build... How can you correctly target an image within the asset folder? I've been using SCSS helper methods to assign them through CSS, but in some cases the image really shouldnt be used as a background.
[01:10:01] Ebok: I could just type in the path, but I figured the fingerprinting the assets get going through the pipeline would cause issues during production.
[01:11:21] emachnic: has joined #RubyOnRails
[01:11:35] hahuang65: has joined #RubyOnRails
[01:13:12] moei: has joined #RubyOnRails
[01:14:00] macsteps: has joined #RubyOnRails
[01:14:42] Ebok: To be clear, this is in a single page application, React, and does not easily have access to the ruby helper path methods.
[01:16:24] akshat: has joined #RubyOnRails
[01:16:55] bruno-: has joined #RubyOnRails
[01:17:26] Radar: Ebok: You can pass the image path to the React component.
[01:17:29] Radar: Ebok: <%= image_path("yourimage.png")
[01:18:42] Ebok: That can only be done at the root of the single page app, yeah?
[01:18:54] Ebok: How do I retrieve it from the react component?
[01:19:06] RegulationD: has joined #RubyOnRails
[01:19:12] Radar: There isn't an easy way to do it.
[01:19:42] Ebok: Feels like something I should go find/build a library to do. Heh. >_>;
[01:19:54] atrius: has joined #RubyOnRails
[01:20:36] Ebok: Alright, well. Thanks for the tip. I'll dig around a bit more and see what I cant uncover.
[01:22:30] bazz_: has joined #RubyOnRails
[01:23:13] bruno-: has joined #RubyOnRails
[01:24:39] htmldrum: has joined #RubyOnRails
[01:26:18] danman: has joined #RubyOnRails
[01:28:05] sevenseacat: has joined #RubyOnRails
[01:28:21] markhkim: has joined #RubyOnRails
[01:28:21] markhkim: has joined #RubyOnRails
[01:28:30] bazz__: has joined #RubyOnRails
[01:29:05] roadt__: has joined #RubyOnRails
[01:29:14] emachnic: has joined #RubyOnRails
[01:31:57] jtdowney: has joined #RubyOnRails
[01:31:57] jtdowney: has joined #RubyOnRails
[01:32:45] emachnic: has joined #RubyOnRails
[01:35:36] one_zero: has joined #RubyOnRails
[01:35:56] dikaio: has joined #RubyOnRails
[01:37:24] macsteps: has joined #RubyOnRails
[01:38:59] akshat: has joined #RubyOnRails
[01:40:36] Coldblackice: has joined #RubyOnRails
[01:45:14] crdpink: has joined #RubyOnRails
[01:55:49] benlieb: Folks I have a coffee script / ruby question. The #coffeescript channel is dead. And the coffee script docs say something about ruby that is wrong. This makes absolutely no sense to me: http://coffeescript.org/#lexical-scope
[01:56:06] benlieb: "This behavior is effectively identical to Ruby's scope for local variables. Because you don't have direct access to the var keyword, it's impossible to shadow an outer variable on purpose, you may only refer to it. So be careful that you're not reusing the name of an external variable accidentally, if you're writing a deeply nested function."
[01:56:50] benlieb: "be careful" doesn't seem like practical design advice
[01:57:37] fryguy: welcome to javascript
[01:57:42] manfrin: has joined #RubyOnRails
[01:58:32] baweaver: expecting sane design decisions from javascript is equatable to expecting readable perl
[01:59:06] baweaver: anything to do with scoping and this in Javascript is an absolute mess.
[01:59:13] benlieb: I just found a blog post outlining my arguments: https://donatstudios.com/CoffeeScript-Madness
[01:59:34] baweaver: you can argue until you're blue in the face on that
[01:59:40] benlieb: He ends saying: [the author's] sentiment is not just bad but plain wrong, especially for larger applications.
[01:59:48] baweaver: won't do much
[01:59:51] benlieb: I agree completely.
[02:01:00] benlieb: But it's NOT identical to ruby's scope, and I can't imagine why Rails would put it's support behind this madness. Effectively, anytime you use a variable inside a lexical scope, you overwrite any outer variables of the same name. Madness.
[02:01:22] flashpoint9: has joined #RubyOnRails
[02:01:41] baweaver: and again, you can argue and rant until you're blue in the face here, it'll do absolutely nothing
[02:01:47] benlieb: Isn't CS wired up by default in rails?
[02:02:18] benlieb: It was for a long time. I don' know about now
[02:02:34] baweaver: might be a good thing to check before going on a tirade there
[02:03:25] baweaver: then again Rails includes Turbolinks by default, so I already question some level of sanity there.
[02:04:09] Ispira: oh god there are three options for getting rails set up with nginx?
[02:04:15] Ispira: puma unicord or passenger? what do?
[02:04:45] baweaver: Puma tends to be the more modernly used one
[02:04:58] baweaver: Passenger is a nightmare from when I've dealt with it.
[02:05:16] Ispira: I spent a good 3 hours trying to figure out why passenger/apache was not working
[02:05:25] benlieb: baweaver: rails new 'blog' => gem 'coffee-rails', '~> 4.1.0'
[02:05:25] baweaver: Unicorn, last I knew, was getting beat out on performance.
[02:05:27] baweaver: by Puma that is
[02:05:28] Ispira: turns out is was basically passenger just not really liking me.
[02:05:55] baweaver: benlieb then don't use it
[02:06:00] Ispira: on the bright side, even though completely unrelated note, my server now has 4x the RAM, double the cores, and double the disk.
[02:06:16] baweaver: that'll cost a pretty penny or two
[02:06:34] benlieb: baweaver: not my decision unfortunately, and this is where you say, oh, I guess it IS default
[02:06:43] benlieb: not deflect
[02:06:43] Ispira: $20/m 2GB RAM 2 CPU cores 40GB SSD
[02:06:52] Ispira: 1Gbit link apparently.
[02:07:01] baweaver: benlieb then write about it on medium or somewhere
[02:07:20] baweaver: sounds like DO or Linode
[02:07:46] Ispira: also ruby has been an interesting experience, I'm just now hopping into rails. I just couldn't stand PHP
[02:08:05] baweaver: I'd have to look back through to find a Puma/NginX setup. If not, it should be written out.
[02:08:14] baweaver: that and deployment both are needlessly complicated.
[02:08:18] bruno-: has joined #RubyOnRails
[02:08:39] Ispira: as long as ruby will replace python and not drastically affect how the end user sees my website
[02:08:41] Ispira: I'm fine.
[02:08:44] Ispira: s/python/php
[02:09:08] baweaver: Ispira to be fair you could run COBOL on the backend and users wouldn't likely notice it
[02:09:13] _Tariq: has joined #RubyOnRails
[02:09:18] sdwrage: has joined #RubyOnRails
[02:09:38] Ispira: I banged out the entire Codecademy Ruby lesson yesterday
[02:09:41] baweaver: that's the beauty of backend, it's behind the curtain, no one can tell
[02:09:46] Ispira: and started on a Discord bot today, and learning Rails.
[02:09:49] helpa: 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
[02:09:55] baweaver: that'll help too
[02:10:38] Puffball: has joined #RubyOnRails
[02:12:32] xall: has joined #RubyOnRails
[02:15:06] baweaver: benlieb the only action that will do anything is to open a PR for Rails on that. Complaining here does little to no good.
[02:16:08] baweaver: either that or trying to convince your manager / architect / person over your head to change it
[02:16:30] baweaver: hopefully realizing the potentially massive amount of technical debt that'd accrue
[02:17:26] baweaver: rarely is switching languages a realistic option for a mature application, and should be done only after very careful and deliberate consideration.
[02:17:58] Diaoer: has joined #RubyOnRails
[02:19:02] emachnic: has joined #RubyOnRails
[02:19:18] Devalo: has joined #RubyOnRails
[02:19:29] moeabdol: has joined #RubyOnRails
[02:19:43] sypheren: has joined #RubyOnRails
[02:23:12] milesmatthias: has joined #RubyOnRails
[02:23:17] jenrzzz: has joined #RubyOnRails
[02:27:15] ensyde__: has joined #RubyOnRails
[02:28:45] aloneintheworld: has joined #RubyOnRails
[02:36:11] lessless: has joined #RubyOnRails
[02:39:43] sypheren: has joined #RubyOnRails
[02:45:19] speakingcode: has joined #RubyOnRails
[02:50:27] IrishGringo: has joined #RubyOnRails
[02:50:56] njero: has joined #RubyOnRails
[02:56:52] bronson: has joined #RubyOnRails
[03:08:58] Maletor: has joined #RubyOnRails
[03:09:58] macsteps: has joined #RubyOnRails
[03:14:23] crdpink: has joined #RubyOnRails
[03:15:10] segy_: has joined #RubyOnRails
[03:15:38] crdpink2: has joined #RubyOnRails
[03:16:04] braincrash: has joined #RubyOnRails
[03:16:11] beilabs: has joined #RubyOnRails
[03:17:40] segy-: has joined #RubyOnRails
[03:22:08] xall: has joined #RubyOnRails
[03:22:33] flashpoint9: has joined #RubyOnRails
[03:28:29] SteenJobs: has joined #RubyOnRails
[03:31:33] kgrz: has joined #RubyOnRails
[03:41:39] craysiii1: has joined #RubyOnRails
[03:42:38] adre: has joined #RubyOnRails
[03:45:59] roamingdog: has joined #RubyOnRails
[03:47:03] IHF04768gto: has joined #RubyOnRails
[03:48:31] brent__: has joined #RubyOnRails
[03:48:39] emachnic: has joined #RubyOnRails
[03:53:11] lessless: has joined #RubyOnRails
[03:58:32] brent__: Hello, i was wanting to add a page view counter to this blogger app i was working on, and wanted to see if i was taking the correct approach
[04:01:00] roamingdog: brent__: hmmm. yes, you're taking the right approach.
[04:01:20] nfsnobody: has joined #RubyOnRails
[04:01:28] brent__: roamingdog: wonderful! i'll get right on it!
[04:01:53] brent__: just seeing if anyone was awake
[04:02:21] roamingdog: with so many people here, i'm sure someone's watching
[04:03:55] roamingdog: brent__: may not be awake for long though, going through source code for puma just now, very sleepy-making
[04:04:20] brent__: https://github.com/brentluna/appAcademy/tree/master/prep2/w4/blogger so I want to keep track of page views for Articles. My thought was to add a instance variable @views to my articlesController, and then incriment it in my #show method
[04:05:08] brent__: i'm very new to rails and thast the ruby in me thinking. Are there instance variables in rails?
[04:05:24] brent__: would that be a way to go about it
[04:05:34] brent__: or should i be adding something to my articles db?
[04:05:35] roamingdog: but you have to think about how to save it to db
[04:06:07] roamingdog: one page-view-count for each article?
[04:06:33] brent__: yes. does adding 't.integer :views' to my db change method make snese?
[04:07:12] roamingdog: brent__: yes i'd do that, default it to 0 maybe
[04:07:24] brent__: how would i give it a default value?
[04:07:26] roamingdog: i'd call it :view_count, but that's me
[04:07:33] brent__: haven't seen taht yet
[04:07:37] moeabdol: has joined #RubyOnRails
[04:07:40] roamingdog: in the migration, default: 0 i believe
[04:08:20] brent__: t.integer :view_count, default: 0
[04:08:32] roamingdog: looks reasonable
[04:08:46] roamingdog: but you already have the table created, yes?
[04:09:31] brent__: would i just add that line and then do rake db:migrate?
[04:09:31] Maletor: has joined #RubyOnRails
[04:10:14] roamingdog: the syntax there, t.integer, is what we see in a migration that's creating the table. after it's created, migrations tend to look like add_column, :articles, :view_count, :integer, default: 0
[04:10:23] pawnbox: has joined #RubyOnRails
[04:10:28] chouhoulis: has joined #RubyOnRails
[04:11:16] roamingdog: brent__: sure can be confusing at first, but the practice is to create a new migration file for every change you make, so since you've already create articles, generate a new migration file
[04:11:58] roamingdog: ideally we don't go back and edit already-run migrations
[04:13:05] brent__: roamingdog: you may have lost me.
[04:13:27] roamingdog: no worries. you already have a migration file that created the articles table, right?
[04:13:38] brent__: should i be adding add_column... to my migration file?
[04:13:56] brent__: https://github.com/brentluna/appAcademy/blob/master/prep2/w4/blogger/db/migrate/20160502224050_create_articles.rb
[04:14:18] roamingdog: so, now, to add a column, generate a new migration file, like: bin/rails g migration add_view_count_to_articles view_count:integer
[04:14:50] roamingdog: make sneeze?
[04:14:54] roamingdog: sense, rather
[04:15:12] brent__: is 'g' suppose to be part of that command?
[04:15:25] roamingdog: yes, short for generate
[04:15:38] roamingdog: you can just use the 'g' if you like, or type out generate
[04:16:27] brent__: 'add_view_count_to_articles' works? seems like rails has a lot of these add/find methods that you can fill in as you please
[04:17:07] brent__: bin/rails g migration add_view_count_to_articles view_count:integer default:0 ?
[04:17:17] roamingdog: if you run that, you should look at the migration created (and add the default: 0), to see what it does
[04:17:37] djbkd: has joined #RubyOnRails
[04:17:39] roamingdog: don't put the default in the generate command though
[04:17:51] brent__: ok, say leav out the default:0 on taht command, run it as you hdad it
[04:18:29] brent__: doing it now, quick question, bin/rails bin/rake versuus just rake or rails?
[04:19:20] roamingdog: brent__: again, source of confusion. if you don't happen to have a 'binstub' for 'rails' in /bin already, then use `bundle exec rails` ...
[04:19:35] roamingdog: i wish we could clean that up, it's cryptic for new people
[04:20:14] roamingdog: but for now, you'll have to read up on binstubs to get the idea of it
[04:20:26] brent__: got the enw migration file
[04:21:00] brent__: added default: 0
[04:21:02] brent__: add_column :articles, :view_count, :integer, default: 0
[04:21:14] roamingdog: brent__: great, if any questions, create a pastie - sevenseacat, do we still use pastie? i've been out of touch a while
[04:21:31] sevenseacat: roamingdog: check the channel rules.
[04:21:33] roamingdog: brent__: looks good
[04:22:33] brent__: and with that added to the db, can i just alter my #show method like so https://gist.github.com/brentluna/9cd881d479fae66e2353cf7dd3cfe63b
[04:22:36] roamingdog: brent__: k, so if you want to show code, use pastie.org or create a github gist
[04:22:45] roamingdog: which you already know, duh
[04:23:10] roamingdog: brent__: won't be saved to db
[04:23:20] moeabdol: has joined #RubyOnRails
[04:27:56] brent__: roamingdog: how about this https://gist.github.com/brentluna/9cd881d479fae66e2353cf7dd3cfe63b
[04:28:27] roamingdog: brent__: interesting, did you look that up or trying it hopefully?
[04:28:39] brent__: saw it on SE when googling
[04:28:55] roamingdog: i'm unaware of it, if it works, great
[04:29:25] brent__: how would you go about it?
[04:30:21] brent__: this method has a pretty specific job, but would like to know how you would generally update the db with things like this
[04:31:11] roamingdog: brent__: indeed, good thinking. i'm coding something up now to make sure i'm right...
[04:36:30] roamingdog: brent__: ok, just for the sake of being totally informative:
[04:36:34] roamingdog: @article.view_count = @article.view_count + 1
[04:36:34] roamingdog: @article.save
[04:36:48] roamingdog: that's the simplest thing i can think of that works
[04:37:18] brent__: is there a reason @article.view_count += 1 wouldn't work?
[04:37:21] brent__: and then save after that?
[04:37:39] roamingdog: that said, the increment! method seems to do the same thing
[04:37:51] voidDotClass: How can I have all emails be printed to console during tests?
[04:38:31] roamingdog: brent__: nope, that also works
[04:40:16] brent__: roamingdog: the tutorial mentioned: Or, better yet, add a method in the article.rb model that increments the counter and call that method from the controlle
[04:40:53] roamingdog: brent__: don't know what it would do different from .increment! method that's apparently built in to rails now
[04:41:05] ricsdeol_: has joined #RubyOnRails
[04:41:10] brent__: but lets say not using increment
[04:41:23] brent__: is there a reason it woudl be beneficial to have it in the model versuses the show emthod?
[04:42:36] roamingdog: versuses i get, we all have a beer now and again, but 'emthod'?
[04:43:15] brent__: i try to type too fast for my own good
[04:44:00] roamingdog: there's the idea that it's not good to make changes to state (db) on any GET request, as you're doing, but, aside from that, i don't see benefit of putting that in the model. matter of opinion, in my opinion.
[04:45:14] brent__: well i'm going to call it quits for the night. Thank you roamingdog, i appreciate your help
[04:45:24] roamingdog: sure, glad to help
[04:47:31] ricsdeol: has joined #RubyOnRails
[04:47:31] my_ticks_r_fake: testing new nick
[04:48:19] baweaver: pushing it a bit with the innuendo aren't we?
[04:48:55] my_ticks_r_fake: sad, but it hadn't occurred to me til i saw it
[04:49:44] my_ticks_r_fake: baweaver: wait, yours is a play on 'beaver' somehow? no? don't throw stones.
[04:50:07] baweaver: baweaver -> BA Weaver -> Brandon A Weaver
[04:50:17] brent__: so professional
[04:50:20] my_ticks_r_fake: i stand so corrected
[04:50:33] baweaver: The BA may also be construed to mean badass
[04:50:44] my_ticks_r_fake: Bachelor of Ass
[04:51:26] my_ticks_r_fake: british airways?
[04:51:46] sevenseacat: my_ticks_r_fake: please change your nick.
[04:52:22] lxsameer: has joined #RubyOnRails
[04:52:22] lxsameer: has joined #RubyOnRails
[04:54:26] xall: has joined #RubyOnRails
[04:58:44] bronson: has joined #RubyOnRails
[05:01:23] stannard: has joined #RubyOnRails
[05:02:28] bruno-: has joined #RubyOnRails
[05:04:40] duncannz: has joined #RubyOnRails
[05:08:09] Spami: has joined #RubyOnRails
[05:09:28] ravi_sun66: has joined #RubyOnRails
[05:10:21] Maletor: has joined #RubyOnRails
[05:17:32] jenrzzz: has joined #RubyOnRails
[05:17:41] rakm: has joined #RubyOnRails
[05:19:26] chopin: has joined #RubyOnRails
[05:21:20] RegulationD: has joined #RubyOnRails
[05:23:53] srinidhi: has joined #RubyOnRails
[05:23:54] srinidhi: has joined #RubyOnRails
[05:24:04] ravi_sun66: can I send_file from controller then redirect or refresh?
[05:26:11] DragonPunch: has joined #RubyOnRails
[05:27:33] tildes_: has joined #RubyOnRails
[05:27:35] Radar: send_file sends a response
[05:29:38] Radar: and you can only send one response per request
[05:34:39] roamingdog: has joined #RubyOnRails
[05:35:37] DragonPunch: has joined #RubyOnRails
[05:36:47] montagne_goat: has joined #RubyOnRails
[05:37:01] DragonPunch: has joined #RubyOnRails
[05:39:22] yardenbar: has joined #RubyOnRails
[05:39:44] troys: has joined #RubyOnRails
[05:40:49] hinbody: has joined #RubyOnRails
[05:44:06] Palsson: has joined #RubyOnRails
[05:44:26] xall: has joined #RubyOnRails
[05:57:02] yfeldblum: has joined #RubyOnRails
[05:57:48] atrius_: has joined #RubyOnRails
[05:57:59] yfeldblum: has joined #RubyOnRails
[05:59:52] lycaonian: has joined #RubyOnRails
[06:01:24] sp1rs: has joined #RubyOnRails
[06:02:37] gambl0re: ActiveRecord::Base, ActiveRecord is the class, and Base is the method on that class?
[06:03:26] tvw: has joined #RubyOnRails
[06:04:04] moeabdol: has joined #RubyOnRails
[06:04:05] sevenseacat: no, ActiveRecord is the namespace, and Base is the class name.
[06:04:20] sevenseacat: the module, rather, not namespace.
[06:04:33] bruno-: has joined #RubyOnRails
[06:04:37] ricsdeol: has joined #RubyOnRails
[06:05:00] baweaver: people use them so interchangeably anymore, but yeah, module
[06:05:31] gambl0re: oh ok thanks...hows going sevenseacat?
[06:05:33] baweaver: might be good to look through the source code for it though if you really want to know how it works
[06:06:15] der-landgraf: has joined #RubyOnRails
[06:06:59] djbkd: has joined #RubyOnRails
[06:11:08] Maletor: has joined #RubyOnRails
[06:13:04] sp1rs: has joined #RubyOnRails
[06:14:15] smathy: How am I seeing this, what happened to my /IGNORE?
[06:15:56] smathy: No, "Public Messages" was unchecked somehow.
[06:16:02] chouhoulis: has joined #RubyOnRails
[06:16:15] smathy: Me: "OMG Textual, that's the MOST important one to ignore."
[06:17:55] Radar: I blame past-smathy.
[06:19:57] jenrzzz: has joined #RubyOnRails
[06:22:08] ravi_sun66: has joined #RubyOnRails
[06:24:00] Devalo: has joined #RubyOnRails
[06:25:28] smoitra: has joined #RubyOnRails
[06:26:14] benlieb: has joined #RubyOnRails
[06:29:09] arup_r: has joined #RubyOnRails
[06:30:44] arup_r: Hey I am bit confused about 1 thing. I am using this Devise and https://gist.github.com/aruprakshit/0ca9fd4ca0a33d06ff689485c9ba8790 is the route. I just want me user to be able to see the sign up page when hit http://localhost:3000/sign_up, but not http://localhost:3000/admins/sign_up. As per the current set up both shows the same page. What settings I need to do so that http://localhost:3000/admins/sign_up gives 404?
[06:31:27] arup_r: I want to keep this http://localhost:3000/sign_up as a valid url, but not http://localhost:3000/admins/sign_up .
[06:36:59] sp1rs: has joined #RubyOnRails
[06:37:07] smoitra_: has joined #RubyOnRails
[06:39:00] lubekpl: has joined #RubyOnRails
[06:39:10] one_zero: has joined #RubyOnRails
[06:39:13] brendan-: has joined #RubyOnRails
[06:39:26] dever: has joined #RubyOnRails
[06:42:26] aganov: has joined #RubyOnRails
[06:45:03] hi8is: has joined #RubyOnRails
[06:46:06] hi8is: has left #RubyOnRails: ()
[06:46:47] Coldblackice: has joined #RubyOnRails
[06:47:40] njero: has joined #RubyOnRails
[06:47:41] triptec_: has joined #RubyOnRails
[06:47:55] beilabs: has joined #RubyOnRails
[06:48:08] tildes_: has joined #RubyOnRails
[06:53:59] ravi_sun66: has joined #RubyOnRails
[06:56:50] syndikate: has joined #RubyOnRails
[06:59:47] tanuki: has joined #RubyOnRails
[07:00:38] bronson: has joined #RubyOnRails
[07:02:51] etiago: has joined #RubyOnRails
[07:03:57] dionysus69: has joined #RubyOnRails
[07:05:03] smoitra: has joined #RubyOnRails
[07:06:46] dionysus69: has joined #RubyOnRails
[07:07:01] kareeoleez: has joined #RubyOnRails
[07:09:34] kareeoleez: I have a form in a view that has an input box. If you fill in the input box and press "Save", a system command is executed and the value is persisted to the database https://gist.github.com/chrisvel/95e3ca4ae3bd669027e3ca597e64d6fa
[07:10:31] ravi_sun66: has joined #RubyOnRails
[07:11:00] kareeoleez: I check If the command has executed successfully and then, If the value has been updated to the database. What I don't do is to run them both in some kind of a "transaction" so the change is complete If both the "system_command == true" and the .update == true
[07:11:48] kareeoleez: Probably the nested conditionals is a wrong thing to do because If the .update fails, the system command has been executed already and cannot be reversed
[07:11:51] Maletor: has joined #RubyOnRails
[07:12:13] Synthead: has joined #RubyOnRails
[07:12:34] kareeoleez: Is it necessary to write rollback functions for them both ?
[07:17:40] Tempesta: has joined #RubyOnRails
[07:17:56] ur5us: has joined #RubyOnRails
[07:18:55] sypheren: has joined #RubyOnRails
[07:22:44] antgel: has joined #RubyOnRails
[07:25:08] flashpoint9: has joined #RubyOnRails
[07:27:29] DoubleMalt: has joined #RubyOnRails
[07:29:57] Radar: Why would the update command fail?
[07:30:01] Radar: *runs off*
[07:33:42] ravi_sun66: has joined #RubyOnRails
[07:35:38] pawnbox: has joined #RubyOnRails
[07:36:19] Ergo: has joined #RubyOnRails
[07:37:20] jenrzzz: has joined #RubyOnRails
[07:37:20] darutoko: has joined #RubyOnRails
[07:39:22] sameerynho: has joined #RubyOnRails
[07:40:15] artto: has joined #RubyOnRails
[07:40:50] mark_66: has joined #RubyOnRails
[07:43:35] jgt: has joined #RubyOnRails
[07:44:08] adre: has joined #RubyOnRails
[07:47:49] tagaulap: has joined #RubyOnRails
[07:49:15] jstransky: has joined #RubyOnRails
[07:50:45] Devalo: has joined #RubyOnRails
[07:54:18] mvxlr: has joined #RubyOnRails
[07:54:37] mikecmpbll: has joined #RubyOnRails
[07:55:03] lubekpl: has joined #RubyOnRails
[07:56:48] kareeoleez: Radar: because of anything... shit happens
[08:02:27] artto: has joined #RubyOnRails
[08:03:00] mikecmpbll: has joined #RubyOnRails
[08:04:31] adre: has joined #RubyOnRails
[08:07:10] jsrn_: has joined #RubyOnRails
[08:12:29] artto: has joined #RubyOnRails
[08:12:41] Maletor: has joined #RubyOnRails
[08:14:15] xall: has joined #RubyOnRails
[08:16:48] artto: has joined #RubyOnRails
[08:16:56] ravi_sun66: has joined #RubyOnRails
[08:18:40] drptbl: has joined #RubyOnRails
[08:19:58] ravi_sun66: has joined #RubyOnRails
[08:20:13] chouhoulis: has joined #RubyOnRails
[08:23:47] artto: has joined #RubyOnRails
[08:25:02] arup_r: has joined #RubyOnRails
[08:27:59] tvw: has joined #RubyOnRails
[08:28:04] artto: has joined #RubyOnRails
[08:31:28] artto_: has joined #RubyOnRails
[08:31:43] yfeldblum: has joined #RubyOnRails
[08:34:13] Jasaka: has joined #RubyOnRails
[08:34:37] voidDotClass: has joined #RubyOnRails
[08:38:16] drptbl_: has joined #RubyOnRails
[08:38:25] jenrzzz: has joined #RubyOnRails
[08:38:25] jenrzzz: has joined #RubyOnRails
[08:38:53] chridal: How do you organize your "helper modules" in Rails? I have some functionality that I want to include in certain classes. Did you make a folder for it? Where? What's it called? etc.
[08:39:05] ravi_sun66: has joined #RubyOnRails
[08:39:33] der-landgraf: has joined #RubyOnRails
[08:41:40] pawnbox: has joined #RubyOnRails
[08:41:53] xall: has joined #RubyOnRails
[08:43:34] weckl: has joined #RubyOnRails
[08:44:59] AlvilsK: has joined #RubyOnRails
[08:46:13] snowy: has joined #RubyOnRails
[08:46:51] imkj: has joined #RubyOnRails
[08:47:07] Devalo: has joined #RubyOnRails
[08:49:32] roelof: has joined #RubyOnRails
[08:49:55] sp1rs: has joined #RubyOnRails
[08:49:57] roelof: Why does this not work : <button class="arrow-button arrow-button--right arrow-button--out"> <% #{button_text} %>
[08:50:13] blackmes1: has joined #RubyOnRails
[08:50:30] roelof: I try to display a local variable that I made here : <%= render "form", project: @project, button_text: "Edit Project" %>
[08:53:02] pawnbox: has joined #RubyOnRails
[08:54:41] elaptics: chridal: what classes and what sort of functionality? If it's controllers or models that's what concerns are for
[08:55:04] chridal: elaptics: Actual modules that just contain functionality to be included in models or controllers
[08:55:23] elaptics: roelof: you're not outputting the button text in that erb you need an =
[08:55:52] elaptics: chridal: sounds like concerns are what you want then http://api.rubyonrails.org/classes/ActiveSupport/Concern.html
[08:55:59] chridal: elaptics: Thanks!
[08:56:33] dici: has joined #RubyOnRails
[08:57:03] elaptics: chridal: bit more info from the source https://signalvnoise.com/posts/3372-put-chubby-models-on-a-diet-with-concerns
[08:57:17] roelof: elaptics: then I see the same error. That there is somewhere a syntax error on the next code. I think the <%= #{button_text} %> is causing it
[08:57:23] roelof: but I do not see why
[08:57:34] elaptics: roelof: !gist your code
[08:57:34] helpa: roelof: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[08:57:42] chridal: elaptics: Very nice.
[08:58:56] Spami_: has joined #RubyOnRails
[08:59:05] markhkim: has joined #RubyOnRails
[08:59:27] elaptics: chridal: personally I'm not a huge fan of concerns. I tend to just create a module and just include them in manually. I'll put that module wherever I feel is most appropriate. Most often I stick them in lib
[09:00:07] chridal: elaptics: Yea, that's what I did for now as well.
[09:00:26] chridal: Will have to see if I can get a use for concerns though. Didn't know about them.
[09:00:43] roelof: elaptics: here you have a gist with the code and the output on the prompt : https://gist.github.com/rwobben/7a3f3618b4106ffa7ae28dd65f58659f
[09:01:36] roelof: when I delete <%= #{button_text} %> . Everythings works well
[09:01:45] stannard: has joined #RubyOnRails
[09:02:27] bronson: has joined #RubyOnRails
[09:03:42] ruid: has joined #RubyOnRails
[09:03:43] ruid: has joined #RubyOnRails
[09:04:39] Megamos: has joined #RubyOnRails
[09:05:09] rakm: has joined #RubyOnRails
[09:07:34] pawnbox: has joined #RubyOnRails
[09:07:40] der-landgraf: has joined #RubyOnRails
[09:08:04] roelof: elaptics: any idea what I did wrong ?
[09:11:49] pawnbox: has joined #RubyOnRails
[09:11:50] xall: has joined #RubyOnRails
[09:12:37] elaptics: roelof: you need to put the interpolation inside a string, but you may as well just output the text, i.e. <%= button_text %>
[09:13:09] elaptics: roelof: though, I don't know what you think button_text will contain - I don't see any references to it in the view so I imagine it'll just be nil unless you have a helper method with that name
[09:13:09] weckl: reolof: Try <%= button_text %>
[09:13:27] Maletor: has joined #RubyOnRails
[09:13:31] smoitra: has joined #RubyOnRails
[09:14:27] roelof: elaptics: and it works. I always thought variables need to use #{ variable_name}
[09:14:45] roelof: Why now only variable_name ?
[09:14:53] ravi_sun66: has joined #RubyOnRails
[09:15:32] elaptics: roelof: #{ } is string interpolation, that's only necessary when you're concatenating things e.g. <%= "The button text is: #{ button_text }" %>
[09:15:34] FooMunki: has joined #RubyOnRails
[09:15:57] elaptics: it's more convenient than "string" + variable + "more string"
[09:16:22] elaptics: when the only thing you're outputting in your erb is a variable then you can just output the variable
[09:16:24] roelof: oke, and now I only want the variable
[09:16:40] roelof: and not concat anything
[09:20:36] yfeldblum: has joined #RubyOnRails
[09:21:59] chouhoulis: has joined #RubyOnRails
[09:25:53] flashpoint9: has joined #RubyOnRails
[09:26:24] artto: has joined #RubyOnRails
[09:28:22] artto_: has joined #RubyOnRails
[09:29:53] chipotle: has joined #RubyOnRails
[09:31:06] roelof: elaptics: thanks for the help
[09:33:49] jenrzzz: has joined #RubyOnRails
[09:38:43] ferr: has joined #RubyOnRails
[09:38:54] Megamos: has joined #RubyOnRails
[09:49:45] iamvery: has joined #RubyOnRails
[09:53:19] htmldrum: has joined #RubyOnRails
[09:54:11] nettoweb: has joined #RubyOnRails
[10:01:27] AlvilsK: Hi! I have a small problem, I am trying to add a background picture from my welcome.scss, - #background {background-image: url(../images/homepage_background.jpeg);} I tried many paths but it does not find the image in the image folder
[10:02:14] victorcreed: has joined #RubyOnRails
[10:03:33] bronson: has joined #RubyOnRails
[10:03:40] adaedra: You have to use assets helper, see http://guides.rubyonrails.org/asset_pipeline.html#css-and-sass
[10:05:04] AlvilsK: Thanks a lot, now it works fine.
[10:12:31] ur5us: has joined #RubyOnRails
[10:14:11] Maletor: has joined #RubyOnRails
[10:14:21] marr: has joined #RubyOnRails
[10:15:52] dede: has left #RubyOnRails: ()
[10:18:05] mdw: has joined #RubyOnRails
[10:20:23] AzaToth: has joined #RubyOnRails
[10:22:49] artto: has joined #RubyOnRails
[10:23:02] blackhuey: has joined #RubyOnRails
[10:23:48] beilabs: has joined #RubyOnRails
[10:25:23] Jasaka: has joined #RubyOnRails
[10:27:44] artto_: has joined #RubyOnRails
[10:29:57] artto: has joined #RubyOnRails
[10:31:43] patientj: has joined #RubyOnRails
[10:32:01] quazimodo: has joined #RubyOnRails
[10:32:56] sp1rs: has joined #RubyOnRails
[10:35:07] artto: has joined #RubyOnRails
[10:35:23] n008f4g_: has joined #RubyOnRails
[10:37:07] artto_: has joined #RubyOnRails
[10:38:41] smoitra: has joined #RubyOnRails
[10:39:12] lycaonian: has joined #RubyOnRails
[10:40:52] blackmes1: has joined #RubyOnRails
[10:41:40] zeel: has joined #RubyOnRails
[10:42:39] artto: has joined #RubyOnRails
[10:45:34] artto: has joined #RubyOnRails
[10:48:00] artto: has joined #RubyOnRails
[10:51:24] ravi_sun66: has joined #RubyOnRails
[10:53:46] apg: has joined #RubyOnRails
[10:53:57] apg: has joined #RubyOnRails
[10:54:26] srinidhi: has joined #RubyOnRails
[10:55:08] ravi_sun66: has joined #RubyOnRails
[10:55:18] emachnic: has joined #RubyOnRails
[10:57:26] jgt: has joined #RubyOnRails
[10:57:36] habitullence: has joined #RubyOnRails
[10:58:18] bruno-: has joined #RubyOnRails
[10:59:01] apofis: has joined #RubyOnRails
[11:00:16] apofis_: has joined #RubyOnRails
[11:02:35] AlvilsK: has joined #RubyOnRails
[11:03:27] tildes_: has joined #RubyOnRails
[11:03:58] AlvilsK: /msg NickServ VERIFY REGISTER AlvilsK zqsdmxaxeevd
[11:05:22] rodfersou: has joined #RubyOnRails
[11:06:40] nettoweb: has joined #RubyOnRails
[11:10:35] adaedra: Look at String#ltrim.
[11:10:45] adaedra: String#lstrip.
[11:11:23] voidDotClass: has joined #RubyOnRails
[11:12:20] dionysus69: has joined #RubyOnRails
[11:13:59] Devalo: has joined #RubyOnRails
[11:14:59] Maletor: has joined #RubyOnRails
[11:15:56] dionysus69: has joined #RubyOnRails
[11:16:01] flashpoint9: has joined #RubyOnRails
[11:17:29] agit0: has joined #RubyOnRails
[11:23:43] dionysus69: has joined #RubyOnRails
[11:23:44] chouhoulis: has joined #RubyOnRails
[11:31:29] ldnunes: has joined #RubyOnRails
[11:31:36] artto: has joined #RubyOnRails
[11:31:56] sp1rs: has joined #RubyOnRails
[11:32:11] arup_r: has joined #RubyOnRails
[11:32:21] edavis: has joined #RubyOnRails
[11:35:07] ravi_sun66: has joined #RubyOnRails
[11:36:52] arpegius: has joined #RubyOnRails
[11:37:43] markhkim: has joined #RubyOnRails
[11:37:43] markhkim: has joined #RubyOnRails
[11:38:59] qejk: has joined #RubyOnRails
[11:39:19] roadt__: has joined #RubyOnRails
[11:39:57] techsethi: has joined #RubyOnRails
[11:40:50] dalbusch1t: has joined #RubyOnRails
[11:41:04] artto: has joined #RubyOnRails
[11:45:19] hierbabuena: has joined #RubyOnRails
[11:51:59] flashpoint9: has joined #RubyOnRails
[11:56:27] jgt1: has joined #RubyOnRails
[11:56:39] ravi_sun_: has joined #RubyOnRails
[12:00:22] dionysus69: has joined #RubyOnRails
[12:02:45] rickmasta: has joined #RubyOnRails
[12:04:29] King_Rex: has joined #RubyOnRails
[12:05:19] bronson: has joined #RubyOnRails
[12:06:26] GodFather: has joined #RubyOnRails
[12:12:02] Detch: has joined #RubyOnRails
[12:15:29] dionysus69: has joined #RubyOnRails
[12:15:46] Maletor: has joined #RubyOnRails
[12:17:14] daveomcd: has joined #RubyOnRails
[12:17:58] _Tariq: has joined #RubyOnRails
[12:22:35] antgel: has joined #RubyOnRails
[12:23:00] artto: has joined #RubyOnRails
[12:26:36] rithm_: has joined #RubyOnRails
[12:26:44] Megamos: has joined #RubyOnRails
[12:27:33] Polysics: has joined #RubyOnRails
[12:28:01] Polysics: hello! say I have some Serializers around. How do I make them work outside of a controller?
[12:28:11] Polysics: this stuff here
[12:28:12] Polysics: https://github.com/rails-api/active_model_serializers
[12:28:15] JohnBat26: has joined #RubyOnRails
[12:28:35] Polysics: the idea is to reuse the presentation layer to get the data into ElasticSearch so I can skip a DB roundtrip
[12:28:50] Polysics: I could move the methods up in the model, if htere is no other solution
[12:30:09] patientj: has left #RubyOnRails: ()
[12:30:22] universa1: polysics: first step: make sure you look at the correct readme!
[12:30:38] universa1: the latest released stable version is 0.9.5, so the master readme does not apply
[12:30:56] universa1: polysics: and then read this: https://github.com/rails-api/active_model_serializers/tree/0-9-stable#render-independently
[12:31:20] hypersymmetry: has joined #RubyOnRails
[12:32:29] ravi_sun66: has joined #RubyOnRails
[12:32:44] chouhoulis: has joined #RubyOnRails
[12:33:14] mdw: has joined #RubyOnRails
[12:34:49] _Tariq: has joined #RubyOnRails
[12:36:12] srinidhi: has joined #RubyOnRails
[12:37:43] arBmind: has joined #RubyOnRails
[12:39:25] Megamosaren: has joined #RubyOnRails
[12:39:50] Craigimus: has joined #RubyOnRails
[12:41:04] roshanavand: has joined #RubyOnRails
[12:42:29] ramortegui: has joined #RubyOnRails
[12:43:06] dionysus69: has joined #RubyOnRails
[12:44:28] Polysics: has joined #RubyOnRails
[12:44:31] _Tariq: has joined #RubyOnRails
[12:44:53] artto: has joined #RubyOnRails
[12:46:14] _Tariq: has joined #RubyOnRails
[12:49:09] rubyonrails706: has joined #RubyOnRails
[12:49:16] dionysus69: has joined #RubyOnRails
[12:50:52] flashpoint9: has joined #RubyOnRails
[12:51:06] tildes_: has joined #RubyOnRails
[12:52:06] pawnbox: has joined #RubyOnRails
[12:55:32] chouhoulis: has joined #RubyOnRails
[12:56:47] sevenseacat: has joined #RubyOnRails
[12:59:42] artto: has joined #RubyOnRails
[13:00:44] wolfravenous: has joined #RubyOnRails
[13:04:50] Ananos_: has joined #RubyOnRails
[13:04:59] artto: has joined #RubyOnRails
[13:06:10] futilegames: has joined #RubyOnRails
[13:07:27] smoitra: has joined #RubyOnRails
[13:07:38] rubyonrails202: has joined #RubyOnRails
[13:07:40] jgt1: has joined #RubyOnRails
[13:08:29] sp1rs: has joined #RubyOnRails
[13:08:32] AlvilsK: has joined #RubyOnRails
[13:11:26] roelof: has joined #RubyOnRails
[13:12:48] ornerymoose: has joined #RubyOnRails
[13:13:06] Polysics: hello! is there a way to create a "generic" view context to pass to helpers for url_for?
[13:14:22] MarcoGL: has joined #RubyOnRails
[13:14:41] ornerymoose: Morning. I have an internal application where a portion of it is editable by employees. This template section is broken down into four separate sections (let’s say Section A, B, C, and D). I’ve been toying around with this gem https://github.com/summernote/summernote-rails and it works pretty well. I was wondering if anyone can recommend any gems/resources they have used in the past for such a feature?
[13:15:11] Polysics: no, but I might steal your gem :)
[13:15:15] ornerymoose: Think of this application as single-page, where the sidebar will be the template section broken down into 4 separate sections.
[13:15:35] ornerymoose: heh, not mine! Works well so far though. Just looking for past experiences/recommendations.
[13:16:00] Polysics: so far I have only used markdown, since I have never really needed a "full" CMS
[13:16:28] ornerymoose: yeah, certainly not going the full-blown CMS route for something like this.
[13:16:32] Maletor: has joined #RubyOnRails
[13:18:05] blackmes1: has joined #RubyOnRails
[13:18:46] arpegius: has joined #RubyOnRails
[13:18:52] godzillaenlacasa: has joined #RubyOnRails
[13:19:53] apg: has joined #RubyOnRails
[13:21:25] apg: has joined #RubyOnRails
[13:22:44] jgt1: has joined #RubyOnRails
[13:23:04] crystal77: has joined #RubyOnRails
[13:23:04] apg: has joined #RubyOnRails
[13:23:54] tknz: has joined #RubyOnRails
[13:24:45] apg: has joined #RubyOnRails
[13:25:28] apg: has joined #RubyOnRails
[13:27:46] ruid: has joined #RubyOnRails
[13:30:12] JohnBat26: has joined #RubyOnRails
[13:31:38] arpegius: has joined #RubyOnRails
[13:32:46] chipotle: has joined #RubyOnRails
[13:32:53] yellow5: has joined #RubyOnRails
[13:38:07] arpegius: has joined #RubyOnRails
[13:40:50] stannard: has joined #RubyOnRails
[13:42:15] wolfravenous: has joined #RubyOnRails
[13:42:48] apg: has joined #RubyOnRails
[13:43:25] chouhoulis: has joined #RubyOnRails
[13:44:11] Ispira: has joined #RubyOnRails
[13:44:18] chouhoulis: has joined #RubyOnRails
[13:45:33] jfelchner_: has joined #RubyOnRails
[13:45:40] soahccc: Since when does a ; act like a & in a url? I'am very confused https://gist.github.com/2called-chaos/dddd3f5de92e8af3fb70d2f5bcb49bf4
[13:48:22] d0nn1e: has joined #RubyOnRails
[13:49:57] thorgi: soahccc: "W3C recommends that all web servers support semicolon separators in addition to ampersand separators" - from https://en.wikipedia.org/wiki/Query_string
[13:50:39] maxz: has joined #RubyOnRails
[13:51:04] soahccc: thorgi: I can't believe that I didn't know that, I have never seen that before
[13:52:48] wolfravenous: has joined #RubyOnRails
[13:53:04] mvxlr: has joined #RubyOnRails
[13:53:09] flashpoint9: has joined #RubyOnRails
[13:54:10] eljimmy: has joined #RubyOnRails
[13:54:13] dbkbali: has joined #RubyOnRails
[13:54:18] thorgi: soahccc: I think 90% of internet don't use it, and probably not all HTTP servers support it, best to use &, and escape ; if needed as part of value
[13:54:36] thorgi: soahccc: but seems to be there as part of "standard"
[13:54:56] soahccc: thorgi: I was confused because we validate inputs for page params and it didn't catch that. Then I looked at the params and was like "da hell?"
[13:55:46] soahccc: these scanners always raise a lot of exceptions, it's annoying
[13:58:47] kgrz: has joined #RubyOnRails
[14:00:21] macsteps: has joined #RubyOnRails
[14:00:43] kgrz: has joined #RubyOnRails
[14:00:53] bruno-: has joined #RubyOnRails
[14:00:54] blackmes1: has joined #RubyOnRails
[14:01:43] tcopeland: has joined #RubyOnRails
[14:06:31] bronson: has joined #RubyOnRails
[14:08:53] emachnic: has joined #RubyOnRails
[14:09:09] emachnic: has joined #RubyOnRails
[14:11:34] ql6wlld: has joined #RubyOnRails
[14:12:42] GodFather: has joined #RubyOnRails
[14:14:55] Devalo: has joined #RubyOnRails
[14:17:21] Maletor: has joined #RubyOnRails
[14:17:43] SeanLazer: has joined #RubyOnRails
[14:18:55] kareeoleez: has joined #RubyOnRails
[14:19:11] kareeoleez: IS there any gem to manipulate the system locale ?
[14:19:19] kareeoleez: the timezone actually
[14:20:01] jgt1: has joined #RubyOnRails
[14:21:51] fox_mulder_cp: kareeoleez: hm. per user or?
[14:22:02] mdw7: has joined #RubyOnRails
[14:22:24] fox_mulder_cp: kareeoleez: rm /etc/localtime && ln -s /usr/share/zoneinfo/Europe/Kiev /etc/localtime
[14:22:25] kareeoleez: usually it's a symlink from /etc/localtime to the appropriate file
[14:22:44] kareeoleez: yeah my problem is that I have a select box with timezones
[14:22:57] sevenseacat: why should that change the system time?
[14:23:01] fox_mulder_cp: kareeoleez: centos and debian|ubuntu has configs
[14:23:27] roelof: has joined #RubyOnRails
[14:23:48] fox_mulder_cp: timezone is set up when server installed. dot. i really don't know, why u must regular change timezone..?
[14:23:58] artto: has joined #RubyOnRails
[14:24:13] fox_mulder_cp: kareeoleez: what is your case|problem?
[14:24:36] VeryBewitching: has joined #RubyOnRails
[14:25:43] roelof: hello, Im playing with rubocop and found this issue : https://gist.github.com/rwobben/9f6683188c097ea9731567f8b1012dd1 How to solve this ?
[14:26:16] wolfravenous: has joined #RubyOnRails
[14:26:44] Tempesta: has joined #RubyOnRails
[14:27:01] kareeoleez: fox_mulder_cp: http://www.thegeekstuff.com/2010/09/change-timezone-in-linux/
[14:27:05] kareeoleez: googling this is easy
[14:27:08] smathy: has joined #RubyOnRails
[14:27:15] kareeoleez: I am trying to set up the system timezone from ruby
[14:27:24] kareeoleez: select your timezone as you do with Rails
[14:27:30] kareeoleez: but also update the system
[14:28:10] sevenseacat: kareeoleez: but why??
[14:28:38] kareeoleez: sevenseacat: because I want to
[14:29:10] arup_r: has joined #RubyOnRails
[14:29:20] fox_mulder_cp: kareeoleez: please, we interest - why u need change timezone.
[14:29:40] kareeoleez: what else beyond the obvious ?
[14:29:41] sevenseacat: 'why are you trying to stab yourself with a spoon' 'because I want to!'
[14:29:54] kareeoleez: stab yourself = change timezone
[14:30:05] kareeoleez: I have lost my perception of reality
[14:30:20] kareeoleez: because it's a hardware device
[14:30:24] kareeoleez: and it's a rails app on top
[14:30:34] kareeoleez: and the user wants to control its timezone
[14:30:36] kareeoleez: makes sense ?
[14:31:04] sevenseacat: not something i'm going to advise on, sorry
[14:31:16] fox_mulder_cp: kareeoleez: user of system can't change timezone. only root can do it.
[14:31:39] fox_mulder_cp: user can reassign timezone by export TIMEZONE='Etc/shit'
[14:31:57] fox_mulder_cp: but running rails app under root privileged bad idea
[14:32:22] fox_mulder_cp: may be u want use rails i18n for multilanguage support?
[14:32:42] kareeoleez: how do you set up the timezone of your Router ?
[14:32:53] kareeoleez: by a web interface I guess
[14:33:00] kareeoleez: is that right ?
[14:33:30] fox_mulder_cp: kareeoleez: or system command from console
[14:33:34] russt: has joined #RubyOnRails
[14:33:41] Liothen: has joined #RubyOnRails
[14:33:49] kareeoleez: for the most of the commercial low end routers
[14:33:54] kareeoleez: from a web interface
[14:34:00] kareeoleez: same for all hardware devices
[14:34:05] kareeoleez: e.g. network cameras
[14:34:25] roelof: no one who wants and can help me ?
[14:34:33] smathy: kareeoleez, !enternotspace
[14:34:33] helpa: kareeoleez: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[14:34:44] fox_mulder_cp: kareeoleez: most devices web-controls maked by cgi with perl on backside
[14:34:45] emachnic: has joined #RubyOnRails
[14:34:57] kareeoleez: fox_mulder_cp: ok, I am using ruby for that
[14:34:59] DoubleMalt: has joined #RubyOnRails
[14:35:07] kareeoleez: fox_mulder_cp: that's not the problem
[14:35:12] fox_mulder_cp: roelof: what is your problem?
[14:35:17] smathy: kareeoleez, you just have to write whatever config file your system needs, usually a symlink of /etc/localtime for most newer Linux distros, and then restart some things after that to pick up the new value.
[14:35:18] emachnic: has joined #RubyOnRails
[14:35:22] roelof: hello, Im playing with rubocop and found this issue : https://gist.github.com/rwobben/9f6683188c097ea9731567f8b1012dd1 How to solve this ? fox_mulder_cp
[14:35:27] kareeoleez: smathy: makes sense
[14:35:52] kareeoleez: smathy: I was asking If there's a gem for that
[14:36:02] fox_mulder_cp: 17:22 < fox_mulder_cp> kareeoleez: rm /etc/localtime && ln -s /usr/share/zoneinfo/Europe/Kiev /etc/localtime
[14:36:05] smathy: kareeoleez, and yeah, you'll probably need to configure /etc/sudoers to allow your web app's user to do that without a password.
[14:36:10] kareeoleez: smathy: because either you just list all paths to a selectbox
[14:36:17] tjohnson: has joined #RubyOnRails
[14:36:17] smathy: kareeoleez, no, no gem for that sort of thing.
[14:36:19] kareeoleez: smathy: or I should map them all one by one
[14:36:27] rickmasta: has joined #RubyOnRails
[14:36:39] fox_mulder_cp: kareeoleez: gem for one oneliner?
[14:36:56] fox_mulder_cp: smathy: thanks for sudoers hint
[14:37:02] kareeoleez: smathy: it's easy to use a system or `export TZ=.....` command
[14:37:13] kareeoleez: smathy: the hard one is to "assign" strings to paths
[14:37:29] smoitra: has joined #RubyOnRails
[14:37:48] fox_mulder_cp: roelof: oh. my skills now can't help u, sorry :(
[14:38:17] crystal77: has joined #RubyOnRails
[14:38:37] bwlang: has joined #RubyOnRails
[14:38:44] roelof: if I google I think I have to rewrite the unless to a if then with a return
[14:38:53] smathy: kareeoleez, it's really not that simple at all, setting an env var in one process (thankfully) doesn't impact the rest of the system.
[14:39:02] idefine: has joined #RubyOnRails
[14:39:16] kareeoleez: smathy: I don't focus on the O/S side for now
[14:39:27] kareeoleez: smathy: it's another section
[14:39:30] kareeoleez: smathy: but thanks
[14:39:35] smathy: kareeoleez, you're talking about setting the timezone on a router via a web interface.
[14:40:07] emachnic: roelof: Maybe `return unless parts.empty?`
[14:40:16] fox_mulder_cp: kareeoleez: > a = '/etc/localtime'
[14:40:16] FooMunki: has joined #RubyOnRails
[14:40:17] fox_mulder_cp: => "/etc/localtime"
[14:40:25] sevenseacat: you've been talking the whole time about setting the system timezone from a rails app but you're not looking at the OS side?
[14:40:54] smathy: She's gone everyone.
[14:41:32] sevenseacat: come, leech, leave.
[14:41:55] smathy: Heh, don't be sad, the world full of nonsense.
[14:42:45] dopamean_: has joined #RubyOnRails
[14:42:58] dcope: hey all, i have an AR accessor on a model called `index`. a gem i just installed has it's own method called `index` for AR models. what's the best way to redefine mine without having to rename the column?
[14:43:00] fox_mulder_cp: ACTION read some big sites for admins on cyrillic region, bvut really - 80% of 'cooladmins' must be blocked to touch all devices, which has a logic onboard ((
[14:43:33] smathy: roelof, trust yourself a bit here, if you've googled and that's what you think, try it.
[14:43:34] fox_mulder_cp: dcope: what is the gem name?
[14:43:41] dcope: fox_mulder_cp: sunspot
[14:43:48] dcope: for solr searching
[14:44:36] smathy: dcope, http://api.rubyonrails.org/classes/Module.html#method-i-alias_attribute
[14:45:14] sevenseacat: nice, didnt know about that one
[14:45:23] dcope: smathy: awesome! this is perfect. thank you :)
[14:45:35] smathy: You're welcome dcope
[14:48:46] artto_: has joined #RubyOnRails
[14:50:46] dcope: oh no, this *just* does an alias
[14:50:56] dcope: so it's still calling the `index` method :P
[14:51:12] roelof: smathy: I have now this : https://gist.github.com/rwobben/13decc7c54b16c96140d59b3600341df and still rubocop is not happy :(
[14:51:18] jhack: has joined #RubyOnRails
[14:51:39] roelof: maybe I use the auto-correct to see what the right solution is
[14:52:45] smathy: roelof, before you do that, just talk me through the first two lines of your method.
[14:53:02] smathy: ...like in English, explain what the first line does, and then the second line.
[14:53:05] sameerynho: has joined #RubyOnRails
[14:53:52] roelof: oke, if the parts array is empty. it schould return to the function which calls this method
[14:53:54] dcope: solved by just making my own accessor methods with read_attr and write_attr
[14:54:15] elaptics: roelof: that's not what your code is doing
[14:54:19] roelof: line 2 if if parts is not empty then do the rest of the function
[14:54:50] elaptics: roelof: your code is doing the reverse of what you just said
[14:55:57] roelof: oops, so this return unless parts.empty? schould be unless !parts.empty
[14:57:23] ornerymoose: has joined #RubyOnRails
[14:57:47] ornerymoose: has joined #RubyOnRails
[14:57:55] roamingdog: has joined #RubyOnRails
[14:58:18] smoitra: has joined #RubyOnRails
[14:58:46] smathy: ACTION chuckles at `unless ! .empty` ;)
[14:59:31] smathy: roelof, you need to start considering the very real possibility that programming is just not for you.
[14:59:44] roelof: maybe it is
[14:59:48] mrgreenfur: has joined #RubyOnRails
[15:00:09] mrgreenfur: Morning! Anyone using hashicorp’s vault to store app secrets?
[15:00:42] macsteps: has joined #RubyOnRails
[15:01:25] mikecmpbll: has joined #RubyOnRails
[15:01:29] disgrntld: has joined #RubyOnRails
[15:02:45] roelof: but im not since 2012 busy with ruby and rails. I re-entered since 2 weeks after 2 years no ruby or no rails
[15:03:30] mvxlr: has joined #RubyOnRails
[15:05:04] Megamos: has joined #RubyOnRails
[15:05:29] artto: has joined #RubyOnRails
[15:06:32] xall: has joined #RubyOnRails
[15:06:49] brent__: has joined #RubyOnRails
[15:06:59] smathy: roelof, we're not talking about anything to do with Rails here, this is a simple change where you were replacing a `unless parts.empty?` block. First you replaced it by `return unless parts.empty?` which is immediately the opposite thing, but then you ALSO ADDED an `if parts.empty?` around the code you previously had wrapped in `unless parts.empty?` - but those logic fuckups aren't even the worst part here.
[15:07:32] drptbl: has joined #RubyOnRails
[15:07:49] smathy: roelof, your whole goal was to quieten rubocop that was telling you: "Use a guard clause instead of wrapping the code inside a conditional expression." -> so you added the guard clause AND STILL wrapped the code inside a conditional.
[15:08:07] roelof: oke, that way
[15:08:22] smathy: roelof, if your logic had all been correct and you had returned on the first line, why would you then ALSO need an `if`?
[15:09:11] helmutrs: has joined #RubyOnRails
[15:09:32] diegoaguilar: has joined #RubyOnRails
[15:09:48] roelof: oke, my old problem : overthinking things and then loose the big picture
[15:10:17] Sharcho: has joined #RubyOnRails
[15:10:18] Sharcho: has left #RubyOnRails: ()
[15:10:39] smathy: ...and this is like step 1 in a 1000 steps. Programming is SO MUCH HARDER than this, OMG, it's like you're trying to learn how to drive and you're stumbling at putting the seatbelt on.
[15:11:00] diegoaguilar: has joined #RubyOnRails
[15:12:43] idefine_: has joined #RubyOnRails
[15:13:36] smathy: roamingdog, if you're talking to me, you think it's not nice to be straight with someone?
[15:14:20] roamingdog: people come here for help, not to be told they're not born to program
[15:15:29] roelof: smathy: oke, but rubocop can give wierd advices : I do return if !parts.empty and then I see this message : Favor unless over if for negative conditions.
[15:15:51] idefine: has joined #RubyOnRails
[15:15:52] RegulationD: has joined #RubyOnRails
[15:16:02] kies: has joined #RubyOnRails
[15:16:14] roelof: solved it
[15:16:29] roamingdog: roelof: care to gist what you've got now?
[15:17:08] smathy: roamingdog, you should feel free to help them the way you think is best, and I'll help them the way I think is best.
[15:17:39] pawnbox: has joined #RubyOnRails
[15:18:07] Maletor: has joined #RubyOnRails
[15:18:11] elaptics: roelof: I would invert the statement, so instead of if !parts.empty? or unless parts.empty? I'd simply do if parts.present?
[15:18:38] arpegius: has joined #RubyOnRails
[15:19:56] AnoHito_: has joined #RubyOnRails
[15:20:05] roelof: roamingdog: moment, I trying now a rspec test but my c9.io box is again very slow
[15:20:35] yellow5: has joined #RubyOnRails
[15:21:14] chouhoul_: has joined #RubyOnRails
[15:21:42] monoprotic: has joined #RubyOnRails
[15:22:18] roamingdog: but array doesn't have method 'present?' check the length instead?
[15:22:23] roelof: im giving up. rubocop is happy now but rspec not
[15:22:38] netzfisch: has joined #RubyOnRails
[15:22:53] dionysus69: has joined #RubyOnRails
[15:23:35] iamvery: has joined #RubyOnRails
[15:23:48] elaptics: roamingdog: arrays do have the present? method if you're using rails - it's added to Object
[15:23:51] roamingdog: my bad, i was in irb, in rails it exists of course
[15:23:53] roelof: I think I need to more familiar with ruby before I can use rubocop
[15:23:59] arup_r: has joined #RubyOnRails
[15:24:01] neanderslob: has joined #RubyOnRails
[15:24:23] urkle: has joined #RubyOnRails
[15:24:41] jwang: has joined #RubyOnRails
[15:24:59] yellow5: has joined #RubyOnRails
[15:25:08] roamingdog: does strike me as counterintuitive, a=[], a does exists but it's empty, so i'd expect a.present? to be true
[15:25:32] smathy: roamingdog, that's the whole point of .present?
[15:25:33] smoitra: has joined #RubyOnRails
[15:25:49] bruno-: has joined #RubyOnRails
[15:26:20] roamingdog: i've been thinking of .present? as .not_nil?
[15:26:38] davidw: has joined #RubyOnRails
[15:26:52] w0rd-driven: has joined #RubyOnRails
[15:26:58] smathy: roamingdog, that already exists by just evaluating anything in a boolean context.
[15:27:17] smathy: ...well, except for `false`
[15:28:00] roamingdog: just the wording i find funky a bit. how about .full? :)
[15:28:27] kareeoleez: has joined #RubyOnRails
[15:28:29] roamingdog: fox_mulder_cp: i believe the phrase is, 'you have no powers here'
[15:28:45] smathy: roamingdog, just means "meaningful values are present"
[15:29:03] smathy: There you go.
[15:29:20] roamingdog: smathy: does that work if nick has changed a few times over the years?
[15:29:51] roamingdog: like, i'm roamingdog, used to be nice_burger
[15:29:58] elaptics: I don't think it's tracking anything but the time the nickname itself is seen
[15:30:19] hobodave: has joined #RubyOnRails
[15:30:24] smathy: roamingdog, I don't think so, I think it just tracks the nick text itself.
[15:31:17] roamingdog: a real veteran
[15:31:17] elaptics: roamingdog: I assume nice_burger existed pre Sept 2012 then?
[15:31:18] maxz: has joined #RubyOnRails
[15:31:31] roamingdog: yes, and briefly, shit_burger, before that
[15:31:46] roamingdog: still makes me laugh though
[15:32:00] elaptics: roamingdog: helpa is a newbie bot compared to my railsing :D I've been doing this since 2006ish
[15:32:20] gopz: has joined #RubyOnRails
[15:32:27] elaptics: not specifically here in irc all that time :D
[15:32:28] roamingdog: i'm sure; i've seen your name forever
[15:33:00] roelof: has left #RubyOnRails: ()
[15:33:17] brent__: hello roamingdog, working on a second part of that problem you helped me with last night
[15:33:36] brent__: wondering if you kind of remember what we went over and maybe can poitn me in the right direction
[15:33:41] chouhoulis: has joined #RubyOnRails
[15:34:01] roamingdog: have to remind me
[15:34:31] brent__: adding a :view_count to my Articles model
[15:35:01] roamingdog: you had just created a migration
[15:35:19] brent__: so i got the view_count working and it's incrmeenting fine
[15:35:51] idefine: has joined #RubyOnRails
[15:36:02] brendan-: has joined #RubyOnRails
[15:36:12] brent__: i wanted to create a new view for articles thats shows the top n articles by view_count
[15:36:30] roamingdog: brent__: should be a breeze
[15:36:32] AntiSpamMeta: has joined #RubyOnRails
[15:36:50] brent__: i'm somewhat lost how to start with a new view, thtas not part of the default paths given
[15:37:01] smathy: roamingdog, you want to come into #ruby and help roelof, he's asking precisely the same question he said he'd work on in there now.
[15:37:06] artto: has joined #RubyOnRails
[15:37:34] smathy: Not to me.
[15:37:58] arup_r: ok some technical question now which, why this commit changed all double quote to single quote? https://github.com/rails/rails/commit/432a65fab2a6c7eb6ff77062e73f7627470f7da7#diff-eab83e40fb6006545eae52b2a4ceac08
[15:38:18] roamingdog: brent__: better have a look here http://guides.rubyonrails.org/routing.html
[15:38:40] smathy: arup_r, because some people have nothing better to do.
[15:38:44] rodfersou|lunch: has joined #RubyOnRails
[15:38:55] The_Phoenix: has joined #RubyOnRails
[15:39:11] roamingdog: smathy: oh, thought you meant he wasn't posing questions to you. not funny, i see now
[15:39:19] The_Phoenix: has joined #RubyOnRails
[15:39:32] tubbo: i think it was an effort to pair the docs with the current style standards for ruby that most people follow, arup_r
[15:40:03] brent__: roamingdog; that was my first thought. adding " get 'top' => 'articles#top' " to my routes
[15:40:27] smathy: tubbo, if true then I'll amend my statement, *most people* have nothing better to do.
[15:40:37] brent__: and then making an articles#top method in my controller that sorts the articles
[15:40:50] The_Phoenix: has joined #RubyOnRails
[15:41:08] roamingdog: arup_r: and there's a feeling that since double quotes are evaluated in ruby but not singles, doubles should only be used when you expect/want evaluation
[15:41:32] smathy: arup_r, tubbo, that guy has so many awesome contributions: https://github.com/rails/rails/commit/f1220516fba3add0f3b491a440fd6525fdb61587
[15:41:35] roamingdog: brent__: sounds good so far
[15:41:51] tubbo: smathy: haha he's Mr. RuboCop
[15:42:09] smathy: Yep :eyeroll:
[15:42:22] smathy: He must sleep so well after such a productive day.
[15:42:25] tubbo: frankly i think rails' codebase could use a bit of a facelift. it's like a wayback machine for ruby's various code style iterations over the years
[15:42:47] smathy: Jeez, look at the dude: https://github.com/gazay He's worn out from all that " hunting.
[15:42:55] brent__: roamingdog: then how do i get that articles#top to show a new view? Does just creating an articles view 'top.html.erb' automatically link it to the #top?
[15:43:10] roamingdog: brent__: try it
[15:43:10] tubbo: probably just ran `rubocop --auto-correct`
[15:43:20] roamingdog: or if you have tried it, what's happening?
[15:43:21] tubbo: or he uses a real man's editor and just did :%s/\"/'/gc
[15:43:22] ornerymoose: has joined #RubyOnRails
[15:43:33] smathy: tubbo, you don't think that the amazing level of contribution and productive application and very good record for bug fixes and lack of regressions might just actually disprove the whole "style is important" idea?
[15:43:38] gopz: How can I bundle a bunch of 'execute <sql>' statements into a single transaction for a migration? There are a bunch of inserts, but if one of them fails and I re-run the migration the data is duplicated for the execute statements that succeeded
[15:44:04] smathy: tubbo, you think he'd do that and risk an interpolation fault?
[15:44:30] smathy: ...who am I kidding, he probably just `sed`ed the codebase.
[15:44:31] tubbo: smathy: i *also* like to live dangerously
[15:44:51] tubbo: rubocop --auto-correct does this automatically, that's probably what he used. i use it too.
[15:44:56] smathy: I can hear him now: "That's what we have a test suite for doods."
[15:45:24] smathy: rubocop is a profanity in my house.
[15:45:29] tubbo: smathy: i'm personally in the "style is important" camp, but i'm not in the "style is so important it should fail the build" camp. right now, we're trying to find a happy medium...automated PR comments when style degrades.
[15:45:42] tubbo: rubocop has been a huge help at my jbo
[15:45:43] arup_r: smathy: yes that guy is awesome! :p
[15:45:51] arpegius: has joined #RubyOnRails
[15:45:53] moeabdol: has joined #RubyOnRails
[15:46:24] [Butch]: has joined #RubyOnRails
[15:46:51] tubbo: the idea is that a tech lead and the dev in question should know when things are about to fail style checks. and they can make the determination whether to allow the violation or not.
[15:46:51] ornerymoose_: has joined #RubyOnRails
[15:47:50] duderonomy: has joined #RubyOnRails
[15:48:54] ferr: has joined #RubyOnRails
[15:49:28] Jasaka: has joined #RubyOnRails
[15:49:30] arup_r: ErhardtMundt_: hello
[15:49:36] ErhardtMundt_: there are a lot of gems to make db:schema:dump produce a more consistent schema.rb
[15:49:43] ErhardtMundt_: which one do you use/suggest?
[15:50:26] tubbo: i've never needed to do that, ErhardtMundt_
[15:50:45] n008f4g_: has joined #RubyOnRails
[15:50:50] tubbo: i consider db/schema.rb the same as Gemfile.lock, it's tracked in Git but you shouldn't edit the file.
[15:50:50] idefine: has joined #RubyOnRails
[15:51:56] ErhardtMundt_: tubbo: I see what you mean
[15:52:09] etiago: has joined #RubyOnRails
[15:52:19] hypersymmetry: If I’m using render: nothing, can I also return a body along with the response to a request?
[15:52:49] ErhardtMundt_: but it would be lovely to have it consistent and without the annoying padding and stuff
[15:53:09] mikecmpbll: opinions on single vs double quoting style?
[15:53:16] tvon: has joined #RubyOnRails
[15:54:04] Coldblackice: has joined #RubyOnRails
[15:54:07] tubbo: ErhardtMundt_: *shrug* whatever you want to do. smathy and I just had this discussion of when it's appropriate to enforce consistent code style in your project. i do not believe this is one of those times.
[15:54:13] tubbo: mikecmpbll: seriously? :P
[15:54:23] smathy: tubbo, I think there's a more fundamental concept that *is* important which is readability/comprehensibility, I think "style" and tools like rubocop are attempts to make that work but that they are neither necessary nor sufficient to achieve the real thing of value.
[15:54:25] artto: has joined #RubyOnRails
[15:54:44] mikecmpbll: just setting up rubocop on our projects, didn't realise someone had talked about it alerady haha
[15:54:50] tubbo: mikecmpbll: i usually turn StringLiterals off in rubocop ;)
[15:55:03] mikecmpbll: yeah, might just do that.
[15:55:56] tubbo: smathy: agreed. i don't believe anything other than human eyes can really do that job 100%. but i think tools like rubocop, especially on large projects that receive many pull requests, aid in code review processes. it just lets you deal with scrutinizing the logic more so than the style, because you know a robot will do it for you.
[15:56:16] smathy: ErhardtMundt_, you mean consistent between different devs/machines/etc? Like you're seeing changes of no substance?
[15:56:26] tubbo: smathy: but by no means do i think they are entirely necessary for every project, and i don't believe the tool itself is sufficient to do the whole job.
[15:56:33] smathy: tubbo, like I said, also not necessary.
[15:56:49] smathy: tubbo, I think so much of what rubocop flags is stupid and insignificant.
[15:57:07] idefine: has joined #RubyOnRails
[15:57:07] ErhardtMundt_: smathy: yeah, changes of no substance
[15:57:12] DoctorMonocular: has joined #RubyOnRails
[15:57:16] smathy: ...and I think any human can make necessary clarity adjustments very easily without such a tool.
[15:57:23] smathy: ErhardtMundt_, with a postgres backend?
[15:57:45] idefine: has joined #RubyOnRails
[16:00:01] arpegius: has joined #RubyOnRails
[16:00:04] njero: has joined #RubyOnRails
[16:00:20] ferr: has joined #RubyOnRails
[16:01:09] wolfravenous: has joined #RubyOnRails
[16:01:24] hobodave: has joined #RubyOnRails
[16:01:48] roamingdog: appeasing rubocop may not always be the best use of time, but sure is fun making that number go down
[16:01:53] manfrin: has joined #RubyOnRails
[16:02:12] crystal77: has joined #RubyOnRails
[16:02:52] hobodave_: has joined #RubyOnRails
[16:03:49] smathy: Gamification.
[16:04:09] smathy: ...CodeClimate have made a whole business around that.
[16:06:18] theod: has joined #RubyOnRails
[16:06:24] blackmes1: has joined #RubyOnRails
[16:08:04] brent__: roamingdog: that ended up working for me.
[16:09:00] bronson: has joined #RubyOnRails
[16:11:34] rainkinz: has joined #RubyOnRails
[16:12:13] roamingdog: brent__: for extra pts, did you limit how many are shown on top page, and are they in order of viewcount?
[16:13:28] snowy: has joined #RubyOnRails
[16:15:33] Devalo: has joined #RubyOnRails
[16:15:51] ErhardtMundt_: unfortunately :X
[16:16:17] brent__: roamingdog: they are: @articles = Article.order(view_count: :desc).limit(5)
[16:16:50] rafalee: has joined #RubyOnRails
[16:17:08] roamingdog: brent__: dang, that's exactly the line i'm looking at. you're either resourceful or not as noobie as i thought :)
[16:17:49] roamingdog: anyone know how to rubocop a single file?
[16:18:06] brent__: i'm looking to make a similar filtered view that shows articles created within certain months. the goal is create links for each month, and when clicking on that link getting a view of articles craeted in that month
[16:18:53] Maletor: has joined #RubyOnRails
[16:19:17] roamingdog: oh duh, just pass the file (talking to myself)
[16:19:38] brent__: i was thinking of creating an articles#by_month(month) and having the specific links pass that month argument
[16:20:01] brent__: does that make sense?
[16:20:31] chouhoulis: has joined #RubyOnRails
[16:20:39] smathy: ErhardtMundt_, actually, that's usually better than pg for this problem, if you just ensure that all machines are using the same version, and then have everyone but one person drop their dev DBs and rebuild from the schema, all should be good.
[16:20:45] pawnbox: has joined #RubyOnRails
[16:21:19] ErhardtMundt_: smathy: easier to say :D
[16:21:55] ErhardtMundt_: smathy: I saw gems to remove the unnecessary space padding and also sort
[16:22:33] smathy: Seriously, dozens of rails projects, 5 different teams, and I've never had this problem with mysql.
[16:22:50] roamingdog: brent__: makes sense to me, probably many ways to go about it
[16:22:58] zave: has joined #RubyOnRails
[16:23:18] chouhoul_: has joined #RubyOnRails
[16:23:40] smathy: ErhardtMundt_, it's possible (although very unlikely with mysql, and you'd notice it because it'd be things like the collation or charset) for other settings to impact this too, so if you really want then everyone should use the same my.cnf too.
[16:23:56] zave: has joined #RubyOnRails
[16:24:43] macsteps: has joined #RubyOnRails
[16:26:13] ErhardtMundt_: smathy: the point is that, theoretically, a ruby schema file only makes sense to decouple the schema from the db backend
[16:30:03] roamingdog: has joined #RubyOnRails
[16:31:14] moeabdol: has joined #RubyOnRails
[16:31:24] kareeoleez: has anyone used geoJSON data with Rails ? I am looking for a gem
[16:31:27] polyidus: has joined #RubyOnRails
[16:32:35] agent_white: has joined #RubyOnRails
[16:34:10] mdel: has joined #RubyOnRails
[16:35:35] sp1rs: has joined #RubyOnRails
[16:36:52] orangey: has joined #RubyOnRails
[16:36:59] orangey: Hello all!
[16:37:06] agit0: has joined #RubyOnRails
[16:37:20] orangey: I'm trying to make a few edits to a plugin for Discourse. However, when I do ./launcher enter app and make a change, it isn't reflected.
[16:37:34] Maletor: has joined #RubyOnRails
[16:37:45] orangey: and instead I have to make the change outside the VM and then rebuild the whole app.. There must be a way to make edits on the fly to plugins and then have them tested without a full rebuild, no?
[16:43:24] fedexo: has joined #RubyOnRails
[16:43:31] flashpoint9: has joined #RubyOnRails
[16:44:31] roamingdog_: has joined #RubyOnRails
[16:45:38] AntiSpamMeta: has joined #RubyOnRails
[16:45:46] jiblet: has joined #RubyOnRails
[16:46:11] atrius: has joined #RubyOnRails
[16:46:51] tildes_: has joined #RubyOnRails
[16:47:30] roamingdog: orangey: you in the right room?
[16:47:47] wldcordeiro: has joined #RubyOnRails
[16:48:16] orangey: roamingdog: #ruby sent me here. Really, I want to play with a few lines of a .rb file in discourse without spending 30 mins rebuilding the whole thing.
[16:48:48] orangey: It would be amazing if somebody could help out so I spend less time figuring out how to edit the file than editing the file.
[16:49:39] roamingdog: orangey: my main pain with programming too, fighting with tools instead of working, but i've never heard of discourse
[16:49:54] havenwood: roamingdog: It's a popular Rails app for forums.
[16:50:04] havenwood: https://www.discourse.org
[16:50:59] artto: has joined #RubyOnRails
[16:51:00] orangey: roamingdog havenwood: aha. Thank you.
[16:51:09] orangey: I'm sorry I assumed that it was known what it is.
[16:51:18] roamingdog: i'm a bit of a hermit
[16:52:16] roamingdog: has joined #RubyOnRails
[16:53:16] gheegh: has joined #RubyOnRails
[16:54:44] roamingdog_: has joined #RubyOnRails
[16:55:40] orangey: I thinkI have to leave this problem for smarter people than I.
[16:55:50] orangey: It's going to obviously take hours for me to get a proper discourse dev setup going.
[16:56:08] orangey: and everytime I touch the server, the whole thing breaks and necessitates a rebiuld.
[16:56:39] AntiSpamMeta: has joined #RubyOnRails
[16:57:44] mikecmpbll: has joined #RubyOnRails
[16:58:32] wolfravenous: has joined #RubyOnRails
[16:59:00] roamingdog_: has joined #RubyOnRails
[16:59:29] Cohedrin: has joined #RubyOnRails
[17:02:03] adlerdias: has joined #RubyOnRails
[17:02:24] bronson: has joined #RubyOnRails
[17:02:31] openstruct: has joined #RubyOnRails
[17:02:44] ss_much: has joined #RubyOnRails
[17:04:57] VeryBewitching: has joined #RubyOnRails
[17:05:32] orangey: http://blog.discourse.org/2013/04/discourse-as-your-first-rails-app/
[17:07:11] akshat: has joined #RubyOnRails
[17:07:14] ornerymoose: has joined #RubyOnRails
[17:09:48] rafalee: has joined #RubyOnRails
[17:11:12] ravi_sun66: has joined #RubyOnRails
[17:13:09] nickenchuggets: has joined #RubyOnRails
[17:13:10] nickenchuggets: has joined #RubyOnRails
[17:14:10] arBmind: has joined #RubyOnRails
[17:15:14] mikecmpbll: has joined #RubyOnRails
[17:17:04] flashpoint9: has joined #RubyOnRails
[17:18:35] cnk: has joined #RubyOnRails
[17:19:32] rakm: has joined #RubyOnRails
[17:21:29] brianpWins_: has joined #RubyOnRails
[17:23:56] benlieb: has joined #RubyOnRails
[17:25:03] wolfravenous: has joined #RubyOnRails
[17:27:23] mwlang: has joined #RubyOnRails
[17:29:04] ravi_sun66: has joined #RubyOnRails
[17:29:35] mwlang: Is there a gem out there that makes it easy to handle pasting clipboard contents into textarea? Specifically, I want to paste images on clipboard from screenshot capture and have it attached to current record and rendered. I’ve implemented dragging of files and dropping to get same effect, but want to skip the file creation process and just paste clipboard.
[17:29:40] Craigimus: has joined #RubyOnRails
[17:30:33] idefine: has joined #RubyOnRails
[17:30:36] flashpoint9: has joined #RubyOnRails
[17:32:04] DoctorMonocular: has joined #RubyOnRails
[17:33:40] djbkd: has joined #RubyOnRails
[17:35:04] tubbo: mwlang: i've been a big fan of https://github.com/mojombo/clippy
[17:36:12] mwlang: tubbo: that’s textarea => clipboard (the opposite direction I’m intending)
[17:36:16] diegoaguilar: has joined #RubyOnRails
[17:36:30] tubbo: mwlang: oh yeah, sorry haha
[17:36:42] tubbo: mwlang: it's actually a JS event you can bind to.
[17:36:53] tubbo: mwlang: dropzone.js
[17:37:03] diegoaguilar: has joined #RubyOnRails
[17:38:13] aiguu: has joined #RubyOnRails
[17:39:45] aiguu: has left #RubyOnRails: ()
[17:39:48] aiguu: has joined #RubyOnRails
[17:39:52] aiguu: has left #RubyOnRails: ()
[17:40:54] aiguu: has joined #RubyOnRails
[17:41:17] croberts: has left #RubyOnRails: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[17:41:38] mdw: has joined #RubyOnRails
[17:41:44] diegoviola: has joined #RubyOnRails
[17:43:01] gopz: has joined #RubyOnRails
[17:43:44] gopz: roamingdog just pass the file as an argument
[17:44:01] smoitra: has joined #RubyOnRails
[17:45:25] arup_r: has joined #RubyOnRails
[17:45:53] tubbo: orangey: y u no docker
[17:45:55] idefine: has joined #RubyOnRails
[17:46:31] orangey: tubbo: And now we come full circle.. I can't docker because I don't know how to edit a plugin and not have it destroy the system.
[17:46:47] orangey: i.e., how do I reload discourse so it updates with the modified plugin?
[17:47:00] tubbo: orangey: i think you have to rebuild the container.
[17:47:06] tubbo: orangey: because your DB is on another container, right?
[17:47:12] tubbo: so data loss won't occur
[17:47:38] tubbo: orangey: unfortunately i can't see more than 50 lines of scrollback when i sign back into my IRC bouncer, so i lost what you said before. lemme check the logs.
[17:47:52] orangey: tubbo: what do you use?
[17:48:04] tubbo: orangey: ZNC
[17:48:17] orangey: tubbo: You should look at quassel. I love it.
[17:48:19] tubbo: i *know* there's a way to make this work because we have a discourse setup and it has plugins installed.
[17:48:21] orangey: but no CLI client
[17:48:36] tubbo: orangey: quassel isn't a bouncer, it's a client.
[17:48:37] orangey: tubbo: I want to *edit* plugins and see what happens.
[17:48:43] orangey: tubbo: It's both.
[17:48:45] idefine_: has joined #RubyOnRails
[17:48:56] orangey: unless I understand incorrectly
[17:49:01] a1fa: has joined #RubyOnRails
[17:49:01] orangey: it has a server and a client component
[17:50:03] tubbo: orangey: seems kinda like Weechat (https://en.wikipedia.org/wiki/WeeChat), which has a "client-server model" but it's localized to the same machine
[17:50:13] mwlang: tubbo: not seeing clipboard image support there…looking for a gem to do this: https://www.lucidchart.com/techblog/2014/12/02/definitive-guide-copying-pasting-javascript/ without having to code all that up.
[17:50:33] tubbo: it's not like irssi which has a built-in proxy
[17:50:53] G: has joined #RubyOnRails
[17:50:58] tubbo: mwlang: so dropzone.js does exactly what that article says. sometimes you actually have to write code :P
[17:51:16] a1fa: Paperclip or CarrierWave for image and document upload?
[17:51:23] tubbo: mwlang: it doesn't have to mention images specifically because it doesn't care
[17:51:33] bronson: has joined #RubyOnRails
[17:51:40] tubbo: a1fa: there are more than two choices. https://github.com/refile/refile https://github.com/markevans/dragonfly/
[17:51:45] fox_mulder_cp: a1fa: image|pd - only file.
[17:51:51] mwlang: tubbo: hmmm…so it handles a clipboard paste?
[17:51:57] mwlang: if so, then I’m golden.
[17:52:20] fox_mulder_cp: a1fa: u can upload anything, not only doc|txt|jpg
[17:52:53] tubbo: mwlang: it might not, but either way there's no "gem" to do this, it's purely a JS thing. rails doesn't care.
[17:53:15] fox_mulder_cp: a1fa: carrierware mount into string field, which contains text path to file
[17:53:19] tubbo: orangey: i'm not sure you can edit plugins on-the-fly like that. but i wouldn't know, never actually developed a discourse plugin. i see now that's more what your thing is about.
[17:53:57] mwlang: tubbo: I think I found the solution with dropzone.js: https://sowingseasons.com/blog/coding/2016/01/add-paste-from-clipboard-to-dropzone-js/30744077
[17:54:18] tubbo: orangey: how about trying to run everything on your local machine? are you on a UNIX-based OS?
[17:54:30] fox_mulder_cp: tubbo: u speak about click to edit or wysiwyg editors?
[17:54:43] a1fa: tubbo, fox_mulder_cp which one do you recommend?
[17:55:00] fox_mulder_cp: a1fa: i use carierware, it is easy for me
[17:55:11] ullu: has joined #RubyOnRails
[17:55:14] tubbo: fox_mulder_cp: neither.
[17:55:29] n008f4g_: has joined #RubyOnRails
[17:55:30] tubbo: a1fa: i use refile on brother.ly, but i use dragonfly at work. they're basically the same idea.
[17:55:48] tubbo: separate rack app taking care of all the uploading and file serving
[17:55:50] wldcordeiro: has joined #RubyOnRails
[17:57:19] fox_mulder_cp: in some framework i see good idea - you has an a some blocks on a page, when u can magic cookie at your session u can click on this blocks and block text opens in a small js editor area, with i18n langs selection. after u save it it updated in sql db.
[17:57:46] RegulationD: has joined #RubyOnRails
[17:57:59] fox_mulder_cp: so, u want add a customized block with html tags and edit your pages as u want.
[17:58:47] fox_mulder_cp: i have a some ideas how to make it with rails, but my js knowledges smaller, than rails (
[17:59:08] orangey: tubbo: I'm on linux
[17:59:36] tubbo: orangey: looks like you can
[17:59:38] orangey: tubbo: indeed, I don't particularly have an interest in ruby (no offence). I just need to get a plugin sending POST instead of GET
[17:59:57] context: can someone please explain what fox_mulder_cp just said
[17:59:58] smoitra_: has joined #RubyOnRails
[18:00:54] a1fa: tubbo: separate app because of security/performance?
[18:00:58] fox_mulder_cp: context: hm. i may rephrase, english is not my native :(
[18:00:59] polyidus: has joined #RubyOnRails
[18:01:08] context: fox_mulder_cp: sounds like its time to learn js
[18:01:10] d5sx43: has joined #RubyOnRails
[18:01:14] silvertail: has joined #RubyOnRails
[18:01:38] tubbo: orangey: guess you have to make a choice then. certainly, setting up all the ruby/rails dependencies is a little harder than just building a docker container...but it also gives you some development benefits.
[18:01:47] ravi_sun66: has joined #RubyOnRails
[18:02:08] tubbo: orangey: more accurately...i don't know at all how you'd initiate live code reloading on a docker container
[18:02:11] tubbo: just in general
[18:02:17] tubbo: do you know of anyone else doing that?
[18:02:21] silvertail: does anyone here have some experience with activeadmin?
[18:02:38] fox_mulder_cp: tubbo: i use docker in my infrastructure
[18:02:47] orangey: tubbo: The dev environment is in vagrant.
[18:02:47] jrochkind: has joined #RubyOnRails
[18:02:50] orangey: which is great.
[18:03:20] tubbo: orangey: well yeah, but that's just to run the container. i'm not sure how but i'm pretty sure you *don't* need to set up a vagrant VM if you're already running linux with LXC support...
[18:03:26] tubbo: i mean, isn't that the whole point here? :)
[18:03:33] jrochkind: I feel like I’ve seen an ActiveRecord feature where you can take some columns and they’ll be a different class. They’ll look like a belongs_to, but it’s not a separate table or row, it’s just some columns taken out of the current model and made a separate class.
[18:03:44] tubbo: jrochkind: serialize?
[18:03:49] jrochkind: Anyone know what i’m talking about? Now I can’t find it, don’t know if I just don’t know the name to lookup, or it’s been removed from AR.
[18:03:56] fox_mulder_cp: orangey: Net::HTTP::Post
[18:04:05] jrochkind: Serialize will take an object and serialize it into ONE column. I’m talking about something that took several columns.
[18:04:07] orangey: fox_mulder_cp: I'm chceking now.
[18:04:08] FooMunki: has joined #RubyOnRails
[18:04:19] orangey: fox_mulder_cp: I finally just got a dev setup going!!! woohoo!!!!!!!!!
[18:04:26] jrochkind: the data is still one attribute per column. Just a slice of columns is turned into it’s own object.
[18:04:47] jrochkind: or maybe i just imagined it.
[18:05:00] fox_mulder_cp: orangey: now i write my own apps hosting control panel with docker, dns, mail sql and etc
[18:05:00] tubbo: jrochkind: i wonder if models respond to slice()
[18:05:08] jrochkind: yeah, that’s not it.
[18:05:24] jrochkind: they prob do, but that’s not the tool i’m thinking of.
[18:05:31] tubbo: jrochkind: sounds ike you need to `rails plugin new` ;)
[18:05:37] fox_mulder_cp: orangey: so, all customers apps with appache/php use its own container oer app
[18:05:43] stannard: has joined #RubyOnRails
[18:05:43] hobodave: has joined #RubyOnRails
[18:05:45] xall: has joined #RubyOnRails
[18:05:46] jrochkind: i have a distinct memory of it existing! I bet it’s a feature that was removed cause not used much.
[18:06:02] tubbo: or you're just not describing it well
[18:06:21] jrochkind: i can try to describe it better, but I don’t know if it’ll help. :)
[18:10:42] jrochkind: I found it! `composed of`. Not sure if it’s still in AR though.
[18:11:00] jrochkind: It’s still in the docs, but there’s lots of discussion about removing it a few years ago, heh.
[18:11:07] jrochkind: http://api.rubyonrails.org/classes/ActiveRecord/Aggregations/ClassMethods.html
[18:11:33] kareeoleez: has joined #RubyOnRails
[18:11:37] kareeoleez: Can I load a .json file from /app/data/file.json to JS in Rails ?
[18:12:04] mwlang: on fire today. Just set up whole new project, controller, various gems, root route, first controller action, view template, layout for app and styled with bootstrap and write first controller test. first attempt: rspec passes and rails s and hitting home page works. zero typos along the way. That *never* happens! Now time to play with dropzone.js. :-D
[18:12:11] zave: may i ask a capistrano question here?
[18:12:15] kareeoleez: I render a json file in localhost:3000/dashboard/index.json but I can't get to display it in console.log("/index.json")
[18:12:40] zave: the capistrano channel is very low on action
[18:12:58] jrochkind: looks like there was a concrete plan to remove composed_of in Rails 4… and yet it is still there, haha.
[18:14:55] smathy: zave, yes.
[18:15:22] smathy: mwlang, nice one.
[18:15:52] zave: smathy: great thank you. i'm wondering about config/deploy.rb...:linked_files
[18:16:01] zave: if i put a file in there, it is supposed ...
[18:16:16] smathy: zave, !enternotspace
[18:16:16] helpa: zave: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[18:16:26] Klumben: has joined #RubyOnRails
[18:17:41] tubbo: kareeoleez: !vague
[18:17:41] helpa: kareeoleez: Your question has just been deemed vague; please consider rewording it. It may also help to give us any relevant code or errors so that we may better assist you.
[18:17:54] zave: (ok sorry) to create a symlink from the file in the app dir to the shared dir, does that also prevent the file from being deployed to the application/app_name/config directory?
[18:19:15] tubbo: kareeoleez: just not sure what you're trying to do. or why you want to "render a .json file to JS in Rails".
[18:20:01] piotrj: has joined #RubyOnRails
[18:20:45] fox_mulder_cp: kareeoleez: may u want output some in json? so u can create test app and run rails scaffold some. thi commands create template for u with json/html output data
[18:22:54] kareeoleez: fox_mulder_cp: you're an asshole
[18:23:13] kareeoleez: fox_mulder_cp: clearly a troll and you don't help anyone with your gibberish
[18:23:17] idefine: has joined #RubyOnRails
[18:23:35] kareeoleez: fox_mulder_cp: you clearly don't understand english
[18:23:54] kareeoleez: sorry guys but I'm fed up
[18:24:01] polyidus: has joined #RubyOnRails
[18:25:15] idefine_: has joined #RubyOnRails
[18:25:18] orangey: Hmm. OK, now I'm trying just to introduce the dependency: `require': cannot load such file -- http (LoadError)
[18:25:19] theod: has joined #RubyOnRails
[18:25:30] orangey: the dependency is "http", and it says that's all I need within the installation instructions
[18:25:47] orangey: I try to introduce it with: require 'http'
[18:25:57] macsteps: has joined #RubyOnRails
[18:25:58] cnk: kareeoleez: I don't think console.log("/index.json") is correct syntax
[18:26:09] cnk: does that work for non-json endpoints?
[18:26:11] idefine_: has joined #RubyOnRails
[18:26:16] B4daBing73: has joined #RubyOnRails
[18:27:02] fox_mulder_cp: orangey: require 'net/http' require 'json' require 'uri'
[18:27:20] orangey: fox_mulder_cp: why isn't that in the instructions?
[18:27:30] kareeoleez: cnk: console.log($.getJSON("/index.json"))
[18:27:46] orangey: fox_mulder_cp: Is there something unique about ROR or such?
[18:27:52] orangey: fox_mulder_cp: ps, that worked perfectly!
[18:28:07] chouhoulis: has joined #RubyOnRails
[18:28:10] fox_mulder_cp: orangey: in rails it loaded automatically, but i;m test some from plain .rb
[18:28:24] chouhoulis: has joined #RubyOnRails
[18:28:25] orangey: fox_mulder_cp: OK, thank you for the hint.
[18:28:32] orangey: I think I'm going to be able to slay this bug.. THANK GOD!
[18:28:43] orangey: and of course thank all of you guys!
[18:28:57] chouhoulis: has joined #RubyOnRails
[18:29:08] pawnbox_: has joined #RubyOnRails
[18:29:09] fox_mulder_cp: orangey: u are second, which i help here )
[18:29:13] arup_r1: has joined #RubyOnRails
[18:29:45] fox_mulder_cp: orangey: some thinking, that i'm idiot and troll )
[18:30:44] piotrj: has joined #RubyOnRails
[18:31:25] orangey: fox_mulder_cp: ah, well, sometimes people can be hard to understand I guess..
[18:31:44] tanuki: I've got something of a stupid question: As a relative beginner on Rails (but not to programming), should I be using the scaffold generator? The books I've been reading disagree.
[18:31:52] gopz: I have a bunch of statements like > execute "INSERT INTO <table>(<column>) VALUES ('v1'), ('v2')" in a migration and I want them all to be a in a transaction so that if one of them fails for some reason, the data is not inserted for the other ones. Does anyone know an easy way of doing this?
[18:32:02] roshanavand: has joined #RubyOnRails
[18:32:30] azor: has joined #RubyOnRails
[18:33:30] futilegames: has joined #RubyOnRails
[18:33:35] fox_mulder_cp: tanuki: it looks like for quick, really generating model. controller and views for something testing purposes, but in reall app - it generates more code, that needed, so it's may be add u problems, such as securing app
[18:34:30] kgrz: has joined #RubyOnRails
[18:34:47] stannard: has joined #RubyOnRails
[18:34:49] jstransky: has joined #RubyOnRails
[18:35:20] fox_mulder_cp: tanuki: more code -more unrested fails.. etc
[18:36:56] fox_mulder_cp: *untested fails
[18:37:32] orangey: Odd, so now I get: "undefined method `post' for HTTP:Module", even though the instructions clearly state it should be doable: https://github.com/httprb/http/wiki/Passing-Parameters
[18:38:00] arpegius: has joined #RubyOnRails
[18:38:01] tubbo: orangey: Net::HTTP is in the stdlib. that is a gem you are looking at.
[18:38:23] fox_mulder_cp: orangey: #req = Net::HTTP::Post.new(uri, initheader = {'Content-Type' =>'application/json'})
[18:38:41] tubbo: except, you know, without the '#'
[18:38:47] tubbo: because that would comment out the line haha
[18:38:57] orangey: tubbo: I'm really sorry that I don't understand what you just said. Are you telling me that even though I thought I loaded the gem, I didn't?
[18:39:16] orangey: tubbo: How do I load the gem? That's what I was trying to do. I already installed it.. It seems the Net::HTTP::Post_new thing is a bit.. complex.
[18:39:21] Megamos: has joined #RubyOnRails
[18:39:52] fox_mulder_cp: orangey: https://gist.github.com/foxmuldercp/d329a4ac55862f9850be43c5ad033538
[18:40:34] orangey: fox_mulder_cp: that looks complex as opposed to that gem I linked.. How do I load it?
[18:40:45] njero: nothing.. i ruby comment # shouldn't be an alien :)
[18:41:15] fox_mulder_cp: orangey: see my gist - it work script to start my docker containers
[18:41:34] tubbo: orangey: let's step back for a second.
[18:41:46] crystal77: has joined #RubyOnRails
[18:41:53] orangey: tubbo: OK.
[18:42:04] fox_mulder_cp: orangey Post.new dot, not undescrore
[18:42:04] tubbo: fox_mulder_cp: irrelevant. please stop helping.
[18:42:16] orangey: fox_mulder_cp: your gist is complex as compared to my ability.
[18:42:35] tubbo: orangey: what exactly are you trying to do? i thought you were trying to make edits to your Docker container? :)
[18:43:25] DoctorMonocular: has joined #RubyOnRails
[18:43:33] orangey: tubbo: I have a plugin: https://github.com/discourse/discourse-oauth2-basic. On this line, it uses GET https://github.com/discourse/discourse-oauth2-basic/blob/master/plugin.rb#L53 . I want it to use POST
[18:43:39] orangey: tubbo: I have the dev environment setup now.
[18:43:55] orangey: and to do this, I am trying to use https://github.com/httprb/http#readme , which was recommended to me.
[18:44:11] tubbo: orangey: oh great. well this is what you need to change right here: open(user_json_url, 'Authorization' => "Bearer #{token}" ).read
[18:44:21] crystal77: has joined #RubyOnRails
[18:44:21] tanuki: fox_mulder_cp: I'm working through Rails 4 In Action, and they don't use the scaffold generator (we're doing it all by hand). But the RoR Tutorial uses the scaffold generator.
[18:44:25] tubbo: orangey: what that's doing is reading the response body of the request into JSON.parse()
[18:44:40] tubbo: orangey: open(), unfortunately, only makes GET requests (iirc)
[18:44:59] orangey: tubbo: Yes. I got that. Here's my current line: user_json = JSON.parse(HTTP.post(user_json_url))
[18:45:20] orangey: which, as per the instructions ( https://github.com/httprb/http/wiki/Passing-Parameters ) should work.
[18:45:28] tubbo: orangey: the issue here is that wouldn't this change the behavior for *all* plugins depending on this one?
[18:45:34] orangey: but obviously I'm not loading the gem, since I have: require 'net/http'
[18:46:01] tubbo: orangey: right. you *can* load the gem if you want to throw `gem 'http'` in Gemfile...but i'm not sure that's necessary
[18:47:08] fox_mulder_cp: tanuki: don't use something, unless u can't know what this stuff doing. scaffolding make using rails easy, but generate some advanced code, that prevents
[18:47:26] orangey: tubbo: Just added it into the Gemfile to see if I can load it as expected now
[18:47:33] orangey: It appears so..
[18:47:34] tubbo: orangey: run `bundle` as well to get it installed.
[18:48:10] orangey: tubbo: don't plugins get to decide their dependencies somehow?
[18:48:36] n008f4g_: has joined #RubyOnRails
[18:48:39] fox_mulder_cp: tanuki: i sometimes use scaffold, but sometimes it make very big overhead code which is unneded for me
[18:48:58] orangey: tubbo: Because as great as this would be if it works, how can I give this to other people without forcing them to edit their gemfile?
[18:49:32] fox_mulder_cp: tanuki: use scaffold for everything - bad idea - in rails, in django, in asp.net and java too
[18:49:58] tubbo: orangey: well here's your issue. you are changing something at the "root" of the problem, which has effects for anyone downstream using the plugin. so if i depend on the fact that discourse-oauth2-basic is making a GET request, and you go and change it to a POST request, you just broke my code.
[18:50:43] tubbo: orangey: perhaps a better solution is to a.) fork the gem to build your own discourse-oauth2-integration, because it sounds like you're developing against a specific provider, rather than the "one size fits all" nature of discourse-oauth2-basic
[18:50:44] orangey: YES!!!!!!!!! THAT WORKED!!!!!
[18:51:00] orangey: tubbo: Well, some providers have GET and some have POST
[18:51:03] orangey: I'm just going to set it as an option
[18:51:08] apofis: has joined #RubyOnRails
[18:51:12] tubbo: orangey: now that's what i'm talking about :)
[18:51:35] dikaio: has joined #RubyOnRails
[18:52:06] ferr: has joined #RubyOnRails
[18:52:20] tubbo: orangey: i'm not sure how discourse plugins work, but i don't see a .gemspec in that repo so i'm assuming you can't just install it as a gem
[18:52:21] orangey: now I just need some way to figure out what the heck is coming out of this drupal server on the other side.. and it seems there aren't any good rest clients for debugging with things like oauth2 authentication built in.
[18:52:38] Megamos: has joined #RubyOnRails
[18:52:46] tubbo: orangey: therefore, your only option so that users won't have to edit their Gemfile in this case is to remove the gem 'http' dependency, and use the stdlib Net::HTTP that comes built-in with Ruby
[18:53:02] orangey: tubbo: I do not have the skill to do that.
[18:53:16] orangey: tubbo: I literally got this working by changing one small command here (open to HTTP.post)
[18:53:41] fox_mulder_cp: orangey: i post ready to using gist :)
[18:53:45] ferr: has joined #RubyOnRails
[18:54:00] tubbo: orangey: perhaps you were just confused. fox_mulder_cp's gist *does* show a way to make the request, though it's a little more complicated. there's also this: http://ruby-doc.org/stdlib-2.3.1/libdoc/net/http/rdoc/Net/HTTP.html#method-c-post_form
[18:54:09] tubbo: so instead of HTTP.post, it's Net::HTTP.post_form
[18:54:27] SteenJobs: has joined #RubyOnRails
[18:54:30] fox_mulder_cp: becouse some lines upper has an hardcoded json for start my predefined container
[18:57:19] manfrin: has joined #RubyOnRails
[18:59:32] chipotle: has joined #RubyOnRails
[19:00:01] D|2aGYN: has joined #RubyOnRails
[19:02:36] D|2aGYN: has left #RubyOnRails: ()
[19:03:07] orangey: tubbo: How do I submit a blank array? user_json = JSON.parse(Net::HTTP.post_form(URI(user_json_url),{}) ?
[19:03:12] mikecmpbll: has joined #RubyOnRails
[19:04:31] tubbo: orangey: should work, yeah
[19:04:36] orangey: that doesn't seem to pass muster.
[19:04:42] dsimon: maybe [] instead
[19:05:00] tubbo: orangey: kinda depends on what your API wants
[19:05:29] orangey: I was missing a closing bracket: user_json = JSON.parse(Net::HTTP.post_form(URI(user_json_url),{}))
[19:05:34] Devalo: has joined #RubyOnRails
[19:05:43] tubbo: orangey: !dw
[19:05:43] helpa: orangey: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[19:05:48] tubbo: orangey: for future reference..
[19:06:03] tubbo: like if you said "i got a syntax error when i tried this" i would've been able to look at it differently
[19:06:03] choke: has joined #RubyOnRails
[19:06:09] tubbo: but i just assumed that the syntax was fine
[19:06:29] orangey: tubbo: thank you. I didn't know what the error was, actually.
[19:06:37] orangey: tubbo: I'm learning quickly wher eto look for problems, though. : )
[19:06:45] tubbo: orangey: oh really? haha it might've been eaten, you never know :)
[19:06:51] dsimon: oh, was ruby's error output being suppressed?
[19:07:12] dsimon: or yeah, maybe just eaten by whatever was calling it
[19:07:12] orangey: dsimon: No, I'm just a newb
[19:07:22] orangey: tubbo: and now.. "no implicit conversion of Net::HTTPUnauthorized into String"
[19:07:40] dsimon: JSON.parse expects a string, but post_form returns some kind of response object
[19:07:45] dsimon: (or in this case, a response error object)
[19:08:03] orangey: dsimon: thank you for interpreting. I was gonna try different commands for the post.
[19:08:07] tubbo: if you remember, the original code is open(uri).read
[19:08:10] orangey: maybe add a .read?
[19:08:17] tubbo: orangey: i would add a .body
[19:08:22] tubbo: not sure if read works, but i know body works
[19:08:29] orangey: tubbo: trying
[19:08:32] tubbo: now you're getting it :)
[19:08:51] orangey: Thank you for helping me through this.
[19:08:51] tubbo: orangey: what do you normally use to program in?
[19:09:04] dsimon: yeah, it's `body`
[19:09:05] dsimon: http://ruby-doc.org/stdlib-2.0.0/libdoc/net/http/rdoc/Net/HTTPResponse.html
[19:09:15] dsimon: (HTTPUnauthorized descends from Response)
[19:09:30] nartes: has joined #RubyOnRails
[19:09:38] d5sx43: has joined #RubyOnRails
[19:09:52] orangey: tubbo: However, I'm not a programmer. I'm in the medical field and trying to make a nice forum software for our group to communicate with the public / each other.
[19:09:58] orangey: YES!!!!!!!!!!!!!!!!!!!!!!!!!!
[19:10:00] orangey: THAT WORKED!
[19:10:12] nartes: hi, did somebody knows about this problem with guard on Archlinux? https://github.com/guard/guard/issues/833
[19:10:16] tubbo: orangey: well you're certainly acting like one. ;)
[19:10:25] tubbo: that's cool though
[19:10:28] dsimon: orangey, we are duck-typing you as a programmer :-)
[19:10:36] fox_mulder_cp: orangey: may be use already existing apps? :) but programming true way too
[19:10:56] nartes: does somebody know*
[19:11:01] orangey: tubbo: Well, I appreciate beautiful things. And I can look at other people's beautiful code and realize that I am brute force, you know?
[19:11:07] tubbo: i'm always happy to see "non-programmers" doing some level of config or development, it's just proof that someday this is just the way we'll be creating things.
[19:11:10] dsimon: nartes, ruby version?
[19:11:16] tubbo: orangey: hah, it's how we all started..
[19:11:17] dsimon: although actually, this is off topic
[19:11:23] tubbo: monkey see, monkey do
[19:11:40] arup_r1: monkey eat!
[19:11:41] fox_mulder_cp: tubbo: make Abba's cover? )
[19:11:56] nartes: ruby 2.4.0dev (2016-03-30 trunk 54439) [x86_64-linux]
[19:12:01] nartes: dsimon, 2.4.0
[19:12:02] tubbo: nartes: whoa! :)
[19:12:07] tubbo: mister bleeding edge over here
[19:12:16] smathy: That's probably the problem.
[19:12:30] fox_mulder_cp: so, 44 days to rails 5 release
[19:12:31] tubbo: nartes: 2.4 isn't out yet, latest stable is 2.3.1
[19:12:41] orangey: tubbo: do you have a meta.discourse account?
[19:12:41] dsimon: nartes, tell me, in the future, who won the super bowl?
[19:12:42] epochwolf: fox_mulder_cp: estimated
[19:12:44] tubbo: orangey: nope.
[19:12:45] orangey: dsimon: same
[19:12:51] orangey: fox_mulder_cp: same?
[19:13:02] dsimon: i promise to deposit my winnings in a savings account and have my grandchildren split them with you
[19:13:24] dsimon: orangey: no, never heard of that
[19:13:38] fox_mulder_cp: nartes: using beta version - only for testing, and some things can't be work properly
[19:14:19] nartes: fox_mulder_cp, agreed, will try without guard then (
[19:14:25] orangey: https://meta.discourse.org/t/oauth2-basic-support/33879/65?u=tarek
[19:14:31] orangey: I just wanted to give y'all proper props
[19:14:34] nartes: fox_mulder_cp, ok
[19:14:52] tubbo: nartes: why exactly are you using ruby 2.4.0.dev right now?
[19:14:55] tubbo: (just curious)
[19:15:28] smathy: ...and why wouldn't you mention that in your bug report.
[19:15:30] nartes: tubbo, don't know actually, P.S. because i am newbie, i am lazy to compile previous version, and guard is not important
[19:15:38] yellow5: has joined #RubyOnRails
[19:15:49] dsimon: orangey, no worries, just pay it forward
[19:15:52] dsimon: that's what i'm doing :-)
[19:15:52] fox_mulder_cp: so, anybody try to use websockets as actioncable in testing? i try to learn chat's guide, but it make me cry (
[19:16:08] smathy: ACTION sees nartes's update - nice one
[19:16:26] tubbo: nartes: well if you're a newbie, i would strongly suggest CONTINUING to use Guard, but downgrading your Ruby version is pretty much imperative imho.
[19:16:37] tubbo: nartes: because you are GOING to run into more problems. it's not an "if", it's a "when".
[19:17:08] replay: has joined #RubyOnRails
[19:17:12] pipework: tubbo: Run wwtd in guard!
[19:17:27] orangey: dsimon: Thank you so much!
[19:17:38] roshanavand: has joined #RubyOnRails
[19:17:45] tubbo: pipework: what would tebow do? ;P
[19:17:58] smathy: Most bizarre reason to be using a dev release I've ever heard.
[19:18:25] pipework: tubbo: what would travis do, you loser.
[19:18:29] blackmes1: has joined #RubyOnRails
[19:18:38] tubbo: guys i'm too lazy to run stable code so i'm just gonna write issues on random people's projects so their maintainers go on wild goose chases for a problem that doesn't exist.
[19:19:18] orangey: how do I debug stuff? i.e., how can I print out what that command returns?
[19:19:22] orangey: so that I can examine it.
[19:19:34] futilegames: has joined #RubyOnRails
[19:19:52] tubbo: orangey: `puts`, or you can use `debugger` to open a REPL at that line.
[19:20:27] tubbo: pipework: that's the first result if you google it lol
[19:20:30] tubbo: pretty sad
[19:23:08] orangey: tubbo: debugger(user_json); to debug variable user_json? It seems not to quite do it ( wrong number of arguments (1 for 0) ). Or do I just put it before the line I want to debug?
[19:24:24] arup_r1: orangey: do you have account in #ruby, then move there if you want more Ruby questions..
[19:24:30] xall: has joined #RubyOnRails
[19:24:35] arup_r1: want to ask*
[19:24:39] tubbo: orangey: it doesn't take arguemnts
[19:24:39] smathy: ...or the newbie ruby channel, even better.
[19:24:46] tubbo: yeah that might be a good idea, orangey
[19:24:48] orangey: OK, where's the beginner channel?
[19:25:00] orangey: Thank you all for all your help.
[19:25:02] Regulati_: has joined #RubyOnRails
[19:26:17] smathy: ##new2ruby /cc orangey
[19:26:27] arup_r1: can anybody see this question http://stackoverflow.com/questions/37056877/how-to-get-the-proper-key-to-use-expire-fragment ? I want to learn it free from internet if someone answers it :)
[19:27:02] arup_r1: ok it is answered, just saw.. Didn't refresh the page for a while.
[19:29:00] Craigimus: has joined #RubyOnRails
[19:29:35] jenrzzz: has joined #RubyOnRails
[19:30:56] Craigimus: has joined #RubyOnRails
[19:32:16] futilegames: has joined #RubyOnRails
[19:32:56] Craigimus: has joined #RubyOnRails
[19:33:07] yfeldblum: has joined #RubyOnRails
[19:35:05] kgrz: has joined #RubyOnRails
[19:35:37] nartes: tubbo, does pry in some way influences guard? Because that error arises after quiting from interactive mode of guard
[19:36:02] nartes: tubbo, and by the way i am compiling ruby-2.2, actually installing stage
[19:36:35] roamingdog: has joined #RubyOnRails
[19:38:29] lubekpl: has joined #RubyOnRails
[19:39:08] roamingdog: has joined #RubyOnRails
[19:39:30] stannard: has joined #RubyOnRails
[19:40:03] Craigimus: has joined #RubyOnRails
[19:41:03] chouhoul_: has joined #RubyOnRails
[19:41:35] manfrin_: has joined #RubyOnRails
[19:41:53] mdw: has joined #RubyOnRails
[19:43:08] theblang: has joined #RubyOnRails
[19:44:13] jayprakash: has joined #RubyOnRails
[19:49:27] codelahoma: has joined #RubyOnRails
[19:49:46] croberts: has joined #RubyOnRails
[19:49:51] croberts: has left #RubyOnRails: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[19:51:38] fox_mulder_cp: smathy: thanks about room
[19:51:58] fox_mulder_cp: nartes: why not 2.3.1?
[19:52:02] smathy: fox_mulder_cp, np, I only found out about it the other day.
[19:52:16] smathy: ...heh, yeah, I was wondering about that myself :)
[19:52:26] smathy: First 2.4.dev then back down to 2.2
[19:52:34] jfelchner: has joined #RubyOnRails
[19:52:36] nartes: fox_mulder_cp, wait few minutes
[19:52:48] macsteps: has joined #RubyOnRails
[19:53:16] smathy: Everyone stand by, nartes is going to speak soon.
[19:53:48] Craigimus: has joined #RubyOnRails
[19:54:00] alaing: has joined #RubyOnRails
[19:54:02] jayprakash: has left #RubyOnRails: ()
[19:54:05] alaing: has joined #RubyOnRails
[19:54:06] rickmasta: has joined #RubyOnRails
[19:55:08] alaing: Hi, I'm trying to install rspec into my app. I've added rspec to the gemfile bundle installed it but when i run rake rspec:install the following error is returned Don't know how to build task 'rspec:install' (see --tasks)
[19:56:12] LiamW: has joined #RubyOnRails
[19:56:32] FailBit: how do I make rails reload a model after saving it
[19:56:38] FailBit: actually, just after creating it
[19:56:56] FailBit: if there's a better way than after_create { reload }
[19:57:13] alaing: I have this gem 'rspec', '~> 3.4' in the dev/test group part of my gemfile
[19:57:18] supernov_a: has joined #RubyOnRails
[19:57:31] FailBit: specifically, I now have a sequence set to be the default value for one of my columns and when the model is created
[19:57:33] FailBit: rails assigns the id
[19:57:38] FailBit: but doesn't update the other column (?)
[19:57:41] fox_mulder_cp: FailBit: a = Model.create(some: 'there'); a.reload?
[19:58:09] roamingdog: alaing: isn't it rails g rspec:install ?
[19:58:20] Craigimus: has joined #RubyOnRails
[19:58:23] fox_mulder_cp: or a.new(bla: 'bla'), a.save, a.reload
[19:58:58] alaing: roamingdog: ah yes i think is should be but that gives an error too. ould not find generator 'rspec:install'. Maybe you meant 'assets', 'scaffold' or 'css:assets'
[19:59:20] roshanavand: has joined #RubyOnRails
[19:59:31] alaing: Could not find generator 'rspec:install'. Maybe you meant 'assets', 'scaffold' or 'css:assets'
[19:59:37] King_Rex: has joined #RubyOnRails
[19:59:54] roamingdog: alaing: does `rails g` say anything about rspec?
[20:00:12] FailBit: did you bundle after gem'ing rspec?
[20:00:19] FailBit: if you did, rake should detect its tasks
[20:00:37] stannard: has joined #RubyOnRails
[20:00:49] alaing: roamingdog: no mention of rspec
[20:01:12] alaing: FailBit: i did bundle after gem'ing
[20:01:32] alaing: I even added another gem and that installed the gem
[20:02:34] alaing: am i using the right gem? i see there is a rspec-rails
[20:02:45] tubbo: alaing: rspec-rails has the rspec:install generator in it.
[20:02:48] DoctorMonocular: has joined #RubyOnRails
[20:03:12] roamingdog: alaing: dang, beat me to it, just noticed. what tubbo said
[20:03:42] alaing: :-) thank you for clearing that up I'll give that gem a go
[20:04:08] tubbo: FailBit: you might need to be a bit more specific here. typically, after saving, those attributes should still be there
[20:04:33] FailBit: t.integer "id_number", default: "nextval('image_id_number_seq'::regclass)"
[20:04:42] FailBit: when saving a model with this
[20:04:54] FailBit: the model does not seem to be updated with the new value that the database assigns
[20:05:02] FailBit: only with its id
[20:05:27] fox_mulder_cp: FailBit: dont touch id :)
[20:05:50] tubbo: FailBit: hmm...but when you `@model.reload` it does?
[20:06:05] FailBit: so now I have after_create :reload in the model
[20:06:07] jenrzzz: has joined #RubyOnRails
[20:06:07] jenrzzz: has joined #RubyOnRails
[20:06:08] dionysus69: has joined #RubyOnRails
[20:06:16] Craigimus: has joined #RubyOnRails
[20:06:39] srinidhi: has joined #RubyOnRails
[20:06:40] tubbo: FailBit: well you're setting the default to a query fragment there (so you can take advantage of sequences), but yeah i think you might need to do that just because rails isn't the controller of db updating in this case. you're offloading the value of this field to the db server itself. rails can't know when your db server is doing under-the-hood changes...
[20:07:03] fox_mulder_cp: FailBit: hooks - bad idea.use in controller .reload method... ooh. u want owerwrite it?
[20:07:29] yardenbar: has joined #RubyOnRails
[20:08:00] tubbo: which is why you have to re-query the server to get the data into ruby :)
[20:08:39] FailBit: hm, maybe I was under the assumption that the database returned that column on save
[20:09:09] jhack: has joined #RubyOnRails
[20:09:20] njero: has joined #RubyOnRails
[20:09:36] djbkd: has joined #RubyOnRails
[20:10:28] fox_mulder_cp: FailBit: it updated object when in saved after .new
[20:10:42] tubbo: i think it's just that in most cases, it's easier to just do self[attribute] = value than parse a sql table result to update the local data in your ruby class :)
[20:10:49] tubbo: except in this case
[20:10:55] fox_mulder_cp: so, id u try a = Some.new; a.save; a = u see that id is filled by sql
[20:11:06] FailBit: fox_mulder_cp: because of the past idiot dba
[20:11:11] FailBit: there are two id columns
[20:11:14] FailBit: one internal
[20:11:16] FailBit: one user facing
[20:11:27] fox_mulder_cp: FailBit: really idiot
[20:11:36] FailBit: previously we had extremely race-condition prone logic to assign the public facing id
[20:11:50] FailBit: I moved this to a sequence but was confused as to why rails wasn't updating the model
[20:12:02] fox_mulder_cp: user.id = user_id, user.face_id = face_id
[20:13:19] fox_mulder_cp: FailBit: requence - u use pgsql? hm. may be move id to uuid;s>
[20:13:38] FailBit: I don't have a lot of wiggle room here
[20:13:46] FailBit: that would involve several hours of downtime to migrate everything
[20:14:23] fox_mulder_cp: FailBit: integers have end, but uuids not )
[20:14:46] FailBit: it's abigint
[20:14:54] FailBit: I doubt we will ever run out
[20:15:04] tubbo: yeah and when you do you can always move to MongoDB ;) </troll>
[20:15:25] fox_mulder_cp: tubbo: ahaha L)
[20:15:27] FailBit: we moved from mongo
[20:15:39] tubbo: FailBit: i know, we've had this conversation before.
[20:15:44] tubbo: i3.kym-cdn.com/entries/icons/original/000/012/132/thatsthejoke.jpg
[20:16:03] tubbo: ACTION wishes his company would move from Mongo sometimes...
[20:16:48] fox_mulder_cp: ACTION was banned yesterday when try to use redis. haha ))
[20:18:14] fox_mulder_cp: FailBit: so i'm intreste how to use sequence - i need inteeger value, which be guarded by pgsql for one my objects
[20:18:20] Craigimus: has joined #RubyOnRails
[20:19:17] pawnbox: has joined #RubyOnRails
[20:19:17] fox_mulder_cp: primary id as uuid, but in filesystem /var/clients/b18e3aa6-bb84-4faa-849f-93a65898107d - unbreakable path, as for me (
[20:21:44] ur5us: has joined #RubyOnRails
[20:25:15] bronson: has joined #RubyOnRails
[20:28:03] nartes: tubbo, i am a total freak, i was using guard-test for rails 4.2.6. And replacing it with guard-minitest solves all the issue. And i stay on bleeding edge )
[20:30:41] gopz: has joined #RubyOnRails
[20:30:47] jgt1: has joined #RubyOnRails
[20:31:29] one_zero: has joined #RubyOnRails
[20:32:50] adre: has joined #RubyOnRails
[20:33:34] stannard: has joined #RubyOnRails
[20:33:54] apotry: has joined #RubyOnRails
[20:35:15] Travis-42: Is there any decent way to put together a query chaining multiple UNIONs in the context of ActiveRecord? I can do find_by_sql, but then I can't easily apply any other scopes or order/limits
[20:35:49] kgrz: has joined #RubyOnRails
[20:35:50] chipotle: has joined #RubyOnRails
[20:36:15] fox_mulder_cp: Travis-42: a.scope.scope.scope :)
[20:36:26] morenoh149: has joined #RubyOnRails
[20:36:38] Travis-42: fox_mulder_cp: can you use a scope to UNION queries?
[20:36:51] morenoh149: what typically gets returns when you delete a resource? 204 no content or echo back the deleted resource?
[20:37:05] FailBit: has left #RubyOnRails: ("WeeChat 0.4.2")
[20:37:57] fox_mulder_cp: morenoh149: in html - redirect to / or something, in json 200 ok..
[20:38:19] morenoh149: json. 200 ok and echo the deleted resource?
[20:38:52] fox_mulder_cp: morenoh149: hm. wait
[20:39:17] fox_mulder_cp: morenoh149: format.json { head :no_content }
[20:39:28] Radar: morenoh149: 204.
[20:39:31] morenoh149: I see. no body
[20:39:34] Radar: GOOD MORNING
[20:40:07] fox_mulder_cp: morenoh149: https://gist.github.com/foxmuldercp/202790d2fbf801b37fcc28771c768367
[20:40:51] fox_mulder_cp: morenoh149: it's from default scaffolded controllers
[20:41:46] Mia: has joined #RubyOnRails
[20:41:46] Mia: has joined #RubyOnRails
[20:43:15] tanuki: When using the form_for.submit method, how do I change the class name it uses?
[20:43:29] tanuki: I have a class Submission that I'm presenting to the user as Application.
[20:44:21] tanuki: I can override the button text in one case, but when the form is in a partial, how do I dynamically choose "Create Application" or "Update Application"?
[20:45:32] fox_mulder_cp: tanuki: -> "Save Application" solve your problem )
[20:45:40] roshanavand: has joined #RubyOnRails
[20:45:54] djbkd: has joined #RubyOnRails
[20:49:54] fox_mulder_cp: tanuki: in russian i have a tons of 'create|save|update|new' and some other variants to say it
[20:49:58] bronson: has joined #RubyOnRails
[20:50:14] chouhoulis: has joined #RubyOnRails
[20:50:33] cd83x: has joined #RubyOnRails
[20:50:39] AntiSpamMeta: has joined #RubyOnRails
[20:51:45] MarcoGL: has joined #RubyOnRails
[20:51:51] fschuindt: has joined #RubyOnRails
[20:52:09] fschuindt: Does paper_trail uses ImageMagick?
[20:52:41] supernov_a: has joined #RubyOnRails
[20:53:21] FooMunki: has joined #RubyOnRails
[20:54:09] speakingcode: has joined #RubyOnRails
[20:54:30] fox_mulder_cp: me make 3 commits and may go to sleep
[20:54:46] flashpoint9: has joined #RubyOnRails
[20:54:58] baweaver: paperclip and carrierwave do for thumbnails iirc
[20:55:04] smathy: ACTION is trying (failing) to imagine what feature of papertrail someone would think would need ImageMagick
[20:55:33] smathy: ...does it make graphs or something that I'm unaware of?
[20:56:28] mdw: has joined #RubyOnRails
[20:58:44] nartes: has left #RubyOnRails: ("Leaving")
[20:59:05] htmldrum: has joined #RubyOnRails
[20:59:25] sneakerhax: has joined #RubyOnRails
[20:59:58] diegoaguilar: has joined #RubyOnRails
[21:02:53] supernov_a2: has joined #RubyOnRails
[21:03:57] macsteps: has joined #RubyOnRails
[21:08:13] duncannz: has joined #RubyOnRails
[21:08:16] cnk: smathy: no but I can see confusing the names papertrail and paperclip
[21:09:04] smathy: Ah, maybe yeah. fschuindt ^^^
[21:09:34] polyidus: has joined #RubyOnRails
[21:12:53] polyidus: has joined #RubyOnRails
[21:18:56] workmad3: has joined #RubyOnRails
[21:19:03] MEATCHICKEN: has joined #RubyOnRails
[21:19:32] MEATCHICKEN: when we call render in a view
[21:19:40] MEATCHICKEN: what is self that is receiving render?
[21:21:58] smathy: meatchicken, `raise self.class` and see.
[21:22:08] smathy: Sorry, self.class.to_s
[21:22:10] diegoviola: has joined #RubyOnRails
[21:22:14] diegoviola: has joined #RubyOnRails
[21:22:21] MEATCHICKEN: smathy, it appears to be an anonymous class lol
[21:22:40] MEATCHICKEN: My team made the awful decision to pick trailblazer in this project
[21:22:43] DoctorMonocular: has joined #RubyOnRails
[21:22:47] MEATCHICKEN: and all I am trying to do is render a partial
[21:23:05] MEATCHICKEN: Trail blazer is intercepting calls to render thus I am trying to call the rails render
[21:23:10] smathy: ...well, trb doesn't impact the rails views at all.
[21:23:20] smathy: ...but in a trb cell template it's totally different.
[21:23:55] smathy: First of all, take a look at the new cells 4.1 - he has put some partial rendering stuff in that.
[21:24:15] rafaelfranca: has joined #RubyOnRails
[21:24:50] MEATCHICKEN: smathy, yeah I'm in a trb cell template
[21:25:05] MEATCHICKEN: smathy, I'll take a look at cells 4.1 - I'll be able to render partials normally?
[21:26:34] smathy: meatchicken, right, so that was never supposed to be able to render rails partials from a cells template.
[21:27:01] smathy: meatchicken, no, but I think it makes it easier to render cells partials.
[21:27:20] smathy: meatchicken, you might be able to just call `::ActionController::Base.helpers.render` to get to the Rails view render method.
[21:27:21] smathy: Try that.
[21:27:47] smathy: ...but yeah, basically mixing rails views and cells templates is not "the way" to do it.
[21:30:26] MEATCHICKEN: I'll debate whether it is "the way" to do it after a quick prototype
[21:30:54] MEATCHICKEN: debate with myself ofc lol
[21:31:04] MEATCHICKEN: "::ActionController" - you're preceding actioncontroller with ::
[21:31:06] MEATCHICKEN: what does that mean?
[21:31:23] cpruitt: has joined #RubyOnRails
[21:31:38] pipework: meatchicken: top-level namespace reference.
[21:32:25] MEATCHICKEN: pipework, wouldn't ActionController by itself suffice?
[21:32:33] pipework: meatchicken: not in all situations
[21:32:44] MEATCHICKEN: or would that try to reference ActionController from the current scope
[21:33:23] hobodave: has joined #RubyOnRails
[21:36:36] kgrz: has joined #RubyOnRails
[21:37:38] stannard: has joined #RubyOnRails
[21:37:40] tvon: has joined #RubyOnRails
[21:39:53] smathy: It's just to be safe.
[21:40:16] smathy: ...in case anything between the calling context and the root namespace has a constant called ActionController defined.
[21:43:14] dikaio: has joined #RubyOnRails
[21:44:36] yfeldblum: has joined #RubyOnRails
[21:45:52] dikaio: has joined #RubyOnRails
[21:47:05] GodFather: has joined #RubyOnRails
[21:47:12] FooMunki: has joined #RubyOnRails
[21:47:16] SteenJobs: has joined #RubyOnRails
[21:48:27] n008f4g_: has joined #RubyOnRails
[21:51:34] pawnbox: has joined #RubyOnRails
[21:51:40] Doddlin: has joined #RubyOnRails
[21:51:48] Doddlin: Evening to y’all!
[21:53:23] manfrin: has joined #RubyOnRails
[21:53:51] Doddlin: I have a question which is probably fairly easy… I have 3 models, the ’Race’, the ’Team’, and the ’Sailor’. Out of UX I would like the user to be able to add Sailors to the current team on the Team-edit-page. However, when I try to create a form with @sailor on the team-edit it gives me an error. What would be the correct way to construct this? :)
[21:54:45] theod: has joined #RubyOnRails
[21:56:38] nettoweb: has joined #RubyOnRails
[21:57:02] DoctorMonocular: has joined #RubyOnRails
[21:59:03] Devalo: has joined #RubyOnRails
[22:01:41] hobodave: has joined #RubyOnRails
[22:02:57] dikaio: has joined #RubyOnRails
[22:03:13] cpruitt: Doddlin: I’m out for the day but quick tip: Post your code & post your error. Far more likely to get help. :-)
[22:03:33] Doddlin: cpruitt, thanks! Actually I was just being stupid
[22:03:39] ornerymoose: has joined #RubyOnRails
[22:03:50] Doddlin: I hadn’t restarted my server after adding sailors as a resource
[22:04:54] cpruitt: Ummm…. shouldn’t really have to restart when just adding a model (Rails should reload as needed) but glad you got it working. Have a good one. I gotta jet.
[22:05:00] jgt1: has joined #RubyOnRails
[22:05:03] chopin: has joined #RubyOnRails
[22:06:58] d5sx43: has joined #RubyOnRails
[22:07:01] xall: has joined #RubyOnRails
[22:08:47] chopin_: has joined #RubyOnRails
[22:12:21] blackmes1: has joined #RubyOnRails
[22:18:10] mantro: has joined #RubyOnRails
[22:19:15] mantro: has left #RubyOnRails: ()
[22:20:01] jfelchner_: has joined #RubyOnRails
[22:20:03] moeabdol: has joined #RubyOnRails
[22:20:05] thesubr00t: has joined #RubyOnRails
[22:21:32] thesubr00t: Is there a way to validate a has_many association to limit them to the current_user associated records?
[22:25:23] jsrn_: has joined #RubyOnRails
[22:27:13] etiago: has joined #RubyOnRails
[22:31:14] lacuna: has joined #RubyOnRails
[22:31:21] emachnic: has joined #RubyOnRails
[22:31:24] rafaelfranca: has joined #RubyOnRails
[22:32:00] benlieb: has joined #RubyOnRails
[22:35:58] wolfravenous: has joined #RubyOnRails
[22:38:19] yfeldblum: has joined #RubyOnRails
[22:38:41] kgrz: has joined #RubyOnRails
[22:39:13] xall: has joined #RubyOnRails
[22:42:11] FooMunki: has joined #RubyOnRails
[22:46:28] Palsson: has joined #RubyOnRails
[22:49:25] roshanavand: has joined #RubyOnRails
[22:53:58] roshanavand: has joined #RubyOnRails
[22:54:27] maxz: has joined #RubyOnRails
[22:55:28] FooMunki: has joined #RubyOnRails
[22:57:44] Moeh: has joined #RubyOnRails
[22:58:41] mices: has joined #RubyOnRails
[22:58:46] rafaelfranca: has joined #RubyOnRails
[22:59:19] mices: i'm gonna use acts_as_commentable_with_threading unless someone advises otherwise, anybody?
[23:00:37] Devalo: has joined #RubyOnRails
[23:04:57] djbkd: has joined #RubyOnRails
[23:05:46] djbkd: has joined #RubyOnRails
[23:05:55] DoctorMonocular: has joined #RubyOnRails
[23:08:53] mices: i'm thinking if comments are commentable(acts_as_commentable) in a polymorphic relationship, then acts_as_commentable alone should be good enough?
[23:10:29] mwlang: Is it possible to wrap form_for helper so I can DRY adding validation error messages at top of each form?
[23:11:15] smathy: mwlang, someone else had that exact idea. Called it simple_form
[23:12:03] mwlang: smathy: hmmm…going back to RTFM…
[23:12:07] mices: why doesn't he call them notices why does he call them validation error messages
[23:12:58] smathy: mwlang, well, depends how dry you mean, it still has the one line.
[23:14:13] manfrin: has joined #RubyOnRails
[23:17:02] bronson: has joined #RubyOnRails
[23:18:41] eljimmy: has joined #RubyOnRails
[23:20:07] pawnbox: has joined #RubyOnRails
[23:20:16] qejk: has joined #RubyOnRails
[23:21:19] dalbusch1t: has joined #RubyOnRails
[23:21:53] snowy: has joined #RubyOnRails
[23:22:46] JesseH: has joined #RubyOnRails
[23:24:57] Radar: It's mentioned in Chapter 4 of R4IA.
[23:25:05] Radar: I am shocked that you didn't know about it, mwlang
[23:25:39] Radar: https://github.com/rubysherpas/r4ia_examples/blob/master/ticketee/app/views/projects/_form.html.erb
[23:25:42] mwlang: Radar: Don’t be too shocked. I usually build the simplest thing possible.
[23:26:26] mwlang: but in this case, we’re building about 50 forms that have roughly the same pattern…the only thing changing is the guts of the form — that is, the input fields.
[23:29:15] roshanavand: has joined #RubyOnRails
[23:29:41] mwlang: oh, wait, I see what you’re shocked about…yeah, I know of simple_form and am using it in the project. Just asked question using form_for because it’s part of Rails — simple_form is gem add-on, but answer would work for either. :-)
[23:29:48] edward__: has joined #RubyOnRails
[23:31:30] djbkd: has joined #RubyOnRails
[23:32:59] mwlang: been fiddling since asking the question and it looks like wrappers are the way to do it with simple_form.
[23:33:41] gambl0re: has joined #RubyOnRails
[23:33:41] gambl0re: has joined #RubyOnRails
[23:34:50] Maletor: has joined #RubyOnRails
[23:37:32] quazimodo: has joined #RubyOnRails
[23:38:59] kies: has joined #RubyOnRails
[23:39:34] kgrz: has joined #RubyOnRails
[23:42:19] brent__: so i have this view i'm trying to create, my action is Articles#by_month(month), i made my paths for the links by_month_path(1-12 depending on what link was clicked), however when it says i didn't give #by_month any arguments
[23:43:27] unreal_: has joined #RubyOnRails
[23:44:23] brent__: maybe i'm not understanding how to pass a controller method an argument
[23:44:58] Radar: brent__: !rule0
[23:44:58] helpa: brent__: 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.
[23:45:31] ruid: has joined #RubyOnRails
[23:45:34] brent__: if i give #by_month(month=5) everything works, so it has to do w/ me passing the argument in my path
[23:45:37] brent__: i'll make a gist now
[23:45:59] Radar: thank you.
[23:46:03] maletor1: has joined #RubyOnRails
[23:46:08] yfeldblum: has joined #RubyOnRails
[23:46:35] supernov_a: has joined #RubyOnRails
[23:47:57] rubyonrails604: has joined #RubyOnRails
[23:49:08] ricsdeol: has joined #RubyOnRails
[23:49:22] DevastatingDave: has joined #RubyOnRails
[23:49:36] brent__: https://gist.github.com/brentluna/9485c01d04a9dd490a2dd0141088b3ad
[23:51:11] brent__: like i said, if i give by_month a default value, it works, so it apperas i'm not understanding how to pass #by_month an argument from my link
[23:52:21] Radar: brent__: Controller methods don't take arguments like that.
[23:52:51] Radar: brent__: You should define it as by_month_articles_path (i.e. a collection route on the articles resource) and then call that like:
[23:52:56] Radar: by_month_articles_path(month: 1)
[23:53:05] Radar: then access it in your controller as params[:month]
[23:53:13] Radar: And https://github.com/radar/by_star will help you do the month querying.
[23:53:46] cydrobolt: has joined #RubyOnRails
[23:57:02] brent__: Radar: very helpful looking gem. Does this look more in line? https://gist.github.com/brentluna/9485c01d04a9dd490a2dd0141088b3ad
[23:57:22] Radar: brent__: this is still not right: https://gist.github.com/brentluna/9485c01d04a9dd490a2dd0141088b3ad#file-rails-rb-L9-L10
[23:57:25] Radar: brent__: !routing
[23:57:25] helpa: brent__: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[23:57:29] Radar: look at collection routes