« Back to channel list

#RubyOnRails - 18 October 2015

« Back 1 day Forward 1 day »
[00:00:58] p8m: has joined #RubyOnRails
[00:01:33] DoubleMalt: has joined #RubyOnRails
[00:02:38] mary5030: has joined #RubyOnRails
[00:03:28] blackhuey: has joined #RubyOnRails
[00:04:52] mary5030: has joined #RubyOnRails
[00:05:46] FailBit: well that's interesting
[00:05:49] FailBit: User::HABTM_Roles
[00:05:52] FailBit: Role::HABTM_Users
[00:06:00] FailBit: found that through AR::Base.descendants
[00:06:38] SteenJobs: has joined #RubyOnRails
[00:06:59] trosborn: has joined #RubyOnRails
[00:07:05] nYmo: has joined #RubyOnRails
[00:08:32] atomical: has joined #RubyOnRails
[00:10:15] greengriminal: has joined #RubyOnRails
[00:13:41] lessless: has joined #RubyOnRails
[00:18:04] jun: has joined #RubyOnRails
[00:21:07] chopin: has joined #RubyOnRails
[00:21:07] GriffinHeart: has joined #RubyOnRails
[00:21:52] mostlybadfly: has joined #RubyOnRails
[00:24:00] doctorly: has joined #RubyOnRails
[00:25:09] alanp: has joined #RubyOnRails
[00:25:35] atomical_: has joined #RubyOnRails
[00:26:36] workmad3: has joined #RubyOnRails
[00:27:40] nYmo: has joined #RubyOnRails
[00:28:10] nYmo: has left #RubyOnRails: ()
[00:28:59] greengriminal: has joined #RubyOnRails
[00:30:00] uberjar: has joined #RubyOnRails
[00:30:34] TheRokh: has joined #RubyOnRails
[00:30:38] uberjar: Hi. Does ActiveSupport provide a way to get the TimeZone for an abbreviated timezone such as "EDT" or "UTC" ?
[00:30:49] pwnd_nfsw: has joined #RubyOnRails
[00:30:59] imp4t: has joined #RubyOnRails
[00:31:01] njero: has joined #RubyOnRails
[00:31:19] uberjar: I would like to be able to support either stirng if a user specifies it in a certain API field
[00:32:12] Jasaka: has joined #RubyOnRails
[00:32:19] uberjar: either the long form or the short form.. I see how to go from long to short: Time.now.in_time_zone("EDT").strftime('%Z') but not the other way around..
[00:34:20] pwnd_nsfw: has joined #RubyOnRails
[00:35:01] SteenJobs: has joined #RubyOnRails
[00:35:13] baweaver: has joined #RubyOnRails
[00:37:57] uberjar: I figured it out: TZInfo::Timezone.get('America/New_York').current_period.abbreviation.to_s
[00:38:15] njero: has joined #RubyOnRails
[00:40:09] jenrzzz: has joined #RubyOnRails
[00:43:33] framlinqp: has joined #RubyOnRails
[00:43:49] IFrank00: has joined #RubyOnRails
[00:46:35] trosborn: has joined #RubyOnRails
[00:48:18] framling: has joined #RubyOnRails
[00:48:22] mloy: has joined #RubyOnRails
[00:49:47] imp4t: has joined #RubyOnRails
[00:50:22] weihan: has joined #RubyOnRails
[00:53:13] GnuYawk: has joined #RubyOnRails
[00:53:13] GnuYawk: has joined #RubyOnRails
[00:54:18] spellbook: Is there a way to check how many entries have been made so far in the database while seeding? I'm seeding ~6000 entries, each of which comes from a get request to an external api. Also, when I think about it, is it terrible to make so many requests to an external api?
[00:54:30] FailBit: Model.count
[00:54:46] FailBit: and spellbook, it's fine if their API terms allow it
[00:54:52] stardiviner: has joined #RubyOnRails
[00:55:19] weihan: has joined #RubyOnRails
[00:55:38] spellbook: Ok. Thanks FailBit
[00:57:21] jun: has joined #RubyOnRails
[00:58:09] weihan: has joined #RubyOnRails
[00:59:22] kayloos: has joined #RubyOnRails
[00:59:23] pontiki: has joined #RubyOnRails
[01:02:14] zapp3r: has joined #RubyOnRails
[01:02:27] weihan: has joined #RubyOnRails
[01:05:10] zapp3r: has left #RubyOnRails: ()
[01:06:10] jun: has joined #RubyOnRails
[01:08:34] atomical: has joined #RubyOnRails
[01:12:49] GriffinHeart: has joined #RubyOnRails
[01:13:19] sunya7a__: has joined #RubyOnRails
[01:13:19] sunya7a_: has joined #RubyOnRails
[01:13:19] sunya7a: has joined #RubyOnRails
[01:14:54] greenride: I'm looking at Rails source. In particular, request_forgery_protection.rb. If I understand correctly, it's verification mechanism is to check whether the csrf token in the form submission matches the one in the session, which is often stored in a cookie. How does that offer any protection?
[01:15:40] greenride: The file path is gems/actionpack-4.1.1/lib/action_controller/metal/request_forgery_protection.rb
[01:18:03] greenride: Couldn't a malicious site just forge both the cookie and the authenticity_token in the form?
[01:20:35] pwnd_nsfw: http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html
[01:20:45] pwnd_nsfw: "This token is stored as a random string in the session, to which an attacker does not have access."
[01:21:27] greenride: pwnd_nsfw: If the session is stored in the cookie, can't the attacker just forge the cookie too?
[01:23:13] greenride: They don't need to obtain the cookie from the victim site. The attacker can just forge a brand new cookie and ensure it matches the authenticity_token that is also forged. Right?
[01:23:21] workmad3: has joined #RubyOnRails
[01:25:16] pwnd_nsfw: http://guides.rubyonrails.org/security.html
[01:25:46] imp4t: has joined #RubyOnRails
[01:28:13] greenride: pwnd_nsfw: I read through that guide, but it doesn't answer my question (or, I don't understand that it's answering my question).
[01:28:54] GnuYawk: has joined #RubyOnRails
[01:29:08] rhizome: how do you forge a cookie?
[01:29:24] Kara: has joined #RubyOnRails
[01:29:56] greenride: There is no server side storage of the cookie. And, the cookie's data is included in the request made to the server. Just create an arbitrary cookie with the same data format.
[01:30:42] karam: has joined #RubyOnRails
[01:30:51] pwnd_nsfw: Doesn't the secret key play some bit in it?
[01:30:54] greenride: Then, the authenticity_token (which is generated by the malicious site) can be placed inside the cookie (that is forged) for the request.
[01:32:16] stamina: has joined #RubyOnRails
[01:32:36] greenride: Section 2.5... that's what I was missing. Let me read it.
[01:35:14] atomical: has joined #RubyOnRails
[01:36:18] gaboesqu_: has joined #RubyOnRails
[01:40:42] SteenJobs: has joined #RubyOnRails
[01:43:16] ruurd: has joined #RubyOnRails
[01:44:12] imp4t: has joined #RubyOnRails
[01:45:40] Uo9er_: has joined #RubyOnRails
[01:45:41] wldcordeiro: has joined #RubyOnRails
[01:46:22] Travis-42: has joined #RubyOnRails
[01:46:39] Travis-42: has joined #RubyOnRails
[01:47:06] greenride: pwnd_nsfw: I sort of see what's going on. Because the malicious site doesn't have the secret, it can't create the cookie's digest signature. What confuses me now is why the request even needs to provide the authenticity_token. Why not just stop at checking the session_id and digest signature of the cookie?
[01:48:19] Travis-42: I have a link tag with about a dozen attributes attached to it, that is rendered using link_to about 20 times on a page. It turns out, this allocates over a megabyte of memory on each page view, which is pretty high. Does this seem normal? Might it be better to just use plain html?
[01:48:22] wilson91: has joined #RubyOnRails
[01:49:06] wilson91: has left #RubyOnRails: ()
[01:49:21] wilsonc91: has joined #RubyOnRails
[01:49:37] wilsonc91: Is anyone around who could help me with something? I'm trying to fix up a stale branch (3-> 4 port) and im a bit new to RoR. One of the forms is displaying a memory address instead of the form. http://pastebin.com/KrUjw6ek
[01:52:03] Travis-42: wilsonc91: it would help if you could include the whole file, or at least the output that you see
[01:52:42] wilsonc91: Sure. One second.
[01:54:07] wilsonc91: http://pastie.org/10489729 Instead of the form I just get that output
[01:54:19] wilsonc91: The top form works fine, just the bottom (last) <fieldset>
[01:56:26] Travis-42: which is the line outputting the TestSupportFile? I don???t see the context of where it comes from
[01:57:42] moeabdol: has joined #RubyOnRails
[01:57:43] Travis-42: this line, looks odd: <%= f.object.test_support_files do |tsf| %> it seems that it should be something more like, <% f.object.test_support_files.each do |tsf| %>
[01:58:02] atomical_: has joined #RubyOnRails
[01:58:03] wilsonc91: Starting at L56 in _form
[01:58:04] Travis-42: it looks like you???re outputting ???f.object.test_support_files???
[01:58:15] Travis-42: instead of looping through it
[01:58:15] wilsonc91: Ah! I'll try that.
[01:58:21] wilsonc91: (Not my code! just trying to fix it :)
[01:58:32] siddart: has joined #RubyOnRails
[01:59:32] wilsonc91: Seems like it just prints an empty array now: []
[02:00:55] Joufflu: has joined #RubyOnRails
[02:01:01] baweaver: has joined #RubyOnRails
[02:04:31] Pupeno: has joined #RubyOnRails
[02:09:31] vigintas1: has joined #RubyOnRails
[02:10:38] moeabdol: has joined #RubyOnRails
[02:10:43] vigintas: has joined #RubyOnRails
[02:11:12] imp4t: has joined #RubyOnRails
[02:11:53] vigintas: has joined #RubyOnRails
[02:13:09] vigintas1: has joined #RubyOnRails
[02:14:20] vigintas: has joined #RubyOnRails
[02:15:33] vigintas1: has joined #RubyOnRails
[02:18:29] htmldrum: has joined #RubyOnRails
[02:19:18] trosborn: has joined #RubyOnRails
[02:19:52] duncannz: has joined #RubyOnRails
[02:20:41] siaW: has joined #RubyOnRails
[02:24:21] atomical: has joined #RubyOnRails
[02:25:37] barriommx: has joined #RubyOnRails
[02:28:43] paradisaeidae: has joined #RubyOnRails
[02:32:42] tariqc: has joined #RubyOnRails
[02:35:13] jellyjellyrobot: has joined #RubyOnRails
[02:37:27] trosborn: has joined #RubyOnRails
[02:38:28] trosborn: has joined #RubyOnRails
[02:46:43] jhn: has joined #RubyOnRails
[02:47:53] imp4t: has joined #RubyOnRails
[02:48:00] gaboesquivel: has joined #RubyOnRails
[03:01:21] jalcine: has joined #RubyOnRails
[03:01:27] sunya7a__: has joined #RubyOnRails
[03:01:27] sunya7a_: has joined #RubyOnRails
[03:01:27] sunya7a: has joined #RubyOnRails
[03:01:38] mrtomme_: has joined #RubyOnRails
[03:02:37] tariqc: How are you?
[03:02:46] jenrzzz: has joined #RubyOnRails
[03:02:52] gaboesquivel: has left #RubyOnRails: ()
[03:03:44] tariqc: I need help
[03:03:48] U7se6: has joined #RubyOnRails
[03:03:49] Travis-42: has joined #RubyOnRails
[03:05:01] tariqc: I am not able to write a AR query in my RoR application
[03:05:05] tariqc: even though it works within the console
[03:05:08] tariqc: and I don't know why
[03:05:20] tariqc: The class in question is inheriting from an abstract class that is connected to an outside database
[03:05:35] rhizome: sounds kinda fancy
[03:05:45] SteenJobs: has joined #RubyOnRails
[03:05:46] tariqc: So, I would like to write the AR query
[03:06:27] imp4t: has joined #RubyOnRails
[03:06:54] tariqc: How would this query work?
[03:06:56] chrisarcand: has joined #RubyOnRails
[03:06:59] JoshL: has joined #RubyOnRails
[03:07:03] tariqc: The class is not initialized according to the error message
[03:07:11] tariqc: How could I initialize it? Any tips?
[03:07:31] rhizome: first you probably want to create an app
[03:07:42] tariqc: The app is made
[03:08:05] davidcelis: has joined #RubyOnRails
[03:08:05] davidcelis: has joined #RubyOnRails
[03:08:28] rhizome: so then queries are usually dealt with in models. you should have at least one of those if you're using a database.
[03:09:00] tariqc: I do have a model
[03:09:24] tariqc: class Bar < Foo; self.abstract_class = true; self.table_name = 'Bar'; end
[03:09:26] rakm: has joined #RubyOnRails
[03:10:05] tariqc: class Foo < ActiveRecord::Base; self.abstract_class = true; establish_connection(HASH); end
[03:10:37] braincrash: has joined #RubyOnRails
[03:11:28] workmad3: has joined #RubyOnRails
[03:12:01] tariqc: The model works fine in Rails Console
[03:12:08] tariqc: It's just in the app itself that it's not initialized
[03:13:58] tariqc: I'm going to assume that I misconfigured my framework
[03:14:01] tariqc: and try to fix that
[03:19:26] yfeldblum: has joined #RubyOnRails
[03:19:57] Uo9er_: has joined #RubyOnRails
[03:20:27] IFrank00: has joined #RubyOnRails
[03:21:29] jenrzzz: has joined #RubyOnRails
[03:22:39] tariqc: It does seem to be configured properly
[03:25:41] seank_: has joined #RubyOnRails
[03:27:21] wethu: has joined #RubyOnRails
[03:28:21] renews: has joined #RubyOnRails
[03:31:16] tariqc: Do anyone know?
[03:32:38] pontiki: i'm going to guess it's an autoloading problem
[03:33:07] pontiki: if it works in the console, it should also work in the app, as they are the same environment, *but* things can be affected by loading order
[03:33:25] fschuindt: has joined #RubyOnRails
[03:33:54] pontiki: also... Bar should *not* be an abstract class; and table names ought to be lower case plurals
[03:33:57] tariqc: How would I fix the loading error then?
[03:34:25] pontiki: explicitly require the files associated with Foo and Bar
[03:34:35] tariqc: Huh. Clever.
[03:34:36] tariqc: Let me try that
[03:34:45] pontiki: at least that might tell you that's the problem.
[03:35:00] pontiki: then look at things like making sure your file names match the class naming conventions
[03:35:05] arup_r: has joined #RubyOnRails
[03:35:22] pontiki: you might only need to require 'foo' in 'bar'
[03:35:36] fschuindt: I need to provide a way to the user upload a file. This file is going to be parsed and stored in the database, but this proccess could take many time. How can I fire the parsing proccess without having the Rails waiting it finish to respond? Like schedule an proccess and watch its status later
[03:35:37] tariqc: Hm, let me see
[03:35:45] pontiki: this might all be wrong, however, and it could be something else entirely
[03:36:20] arup_r: fschuindt: you can take a help of background jobs
[03:36:23] pontiki: fschuindt: start looking at ActiveJob
[03:36:59] fschuindt: arup_r, pontiki: thank you guys
[03:37:08] tariqc: Require_relativing the entire file works
[03:37:16] tariqc: you say that it is possible to only require 'foo' in 'bar'
[03:37:18] tariqc: how would that work?
[03:38:09] Cache_Money: has joined #RubyOnRails
[03:38:33] bePolite: has joined #RubyOnRails
[03:39:17] pontiki: require 'foo'
[03:39:41] tariqc: okay let me try that...?
[03:39:50] tariqc: Though I should have said that bar and foo are in the same file
[03:39:54] tariqc: named bar
[03:39:59] tariqc: so I'm going to be requiring bar
[03:40:11] pontiki: that changes everything
[03:40:15] tariqc: ...it does?
[03:40:44] tariqc: I should have disclosed that before
[03:40:57] pontiki: which one occurs first in the file?
[03:41:07] pontiki: also, you shouldn't do that in a rails app
[03:41:34] tariqc: I thought it would be less messy
[03:41:43] tariqc: I have twenty or third models
[03:41:44] pontiki: the aforementioned autoloading makes it wonky
[03:42:06] pontiki: what you may wish to consider is using namespacing
[03:42:41] imp4t: has joined #RubyOnRails
[03:42:44] tariqc: Foo comes first, and that inherits from Bar
[03:42:51] tariqc: and the file is named Foo
[03:42:54] baweaver: has joined #RubyOnRails
[03:42:59] pontiki: your abstract can be Foo in `app/models/foo.rb` and the inheriting models called Foo::Bar in `app/models/foo/bar.rb`
[03:43:00] tariqc: let me look up namespacing too
[03:43:01] moeabdol: has joined #RubyOnRails
[03:43:37] seank_: has joined #RubyOnRails
[03:43:57] pontiki: up above, you showed us that Bar inherits from Foo
[03:44:10] wildlander: has joined #RubyOnRails
[03:44:23] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[03:45:24] ahmgeek: has joined #RubyOnRails
[03:45:40] tariqc: The thing is
[03:45:45] tariqc: I'm working on company code
[03:45:51] tariqc: and I can't really disclose that company code to other people
[03:45:56] U7se6: has joined #RubyOnRails
[03:45:59] tariqc: or at least, I don't think it would be a good idea
[03:46:02] tariqc: So what's the recommendation then
[03:46:05] tariqc: if not fake code?
[03:46:35] tariqc: (Also, I apologize for using fake values)
[03:46:47] tariqc: (I didn't know it could lead to problems like this one)
[03:48:59] tariqc: ACTION waits for a response
[03:49:12] pontiki: hire a consultant
[03:49:42] pontiki: create an app that recreates the problem with real names
[03:49:45] linocisco: has joined #RubyOnRails
[03:50:04] linocisco: http://pastie.org/private/ksmwdthkpsi3eoroypulqg
[03:50:32] moeabdol: has joined #RubyOnRails
[03:50:39] pontiki: believe that no one else cares what your company is doing, and that it's extremely unlikely this would reveal any defensible trade secrets
[03:51:23] mary5030: has joined #RubyOnRails
[03:52:04] tariqc: I'll think and choose from those three options
[03:52:06] tariqc: Thanks pontiki
[03:53:35] mary5030: has joined #RubyOnRails
[03:56:25] weihan: has joined #RubyOnRails
[03:58:12] beauby: has joined #RubyOnRails
[03:59:17] woods: has joined #RubyOnRails
[03:59:41] woods: good <insert time of day> everyone!
[04:01:27] imp4t: has joined #RubyOnRails
[04:02:33] baweaver: woods: http://www.total-knowledge.com/~ilya/mips/ugt.html
[04:02:36] baweaver: always morning
[04:03:07] baweaver: simplifies things. When someone arrives it's always morning. When they leave it's always night.
[04:03:13] baweaver: (and yes this is a joke)
[04:03:22] woods: ahh, good to know
[04:04:16] woods: has anyone else had issues running bundle install on a new app? im getting errors on debug_inspector
[04:04:22] woods: im running fedora 22 kde
[04:04:27] Pupeno: has joined #RubyOnRails
[04:04:57] sunya7a__: has joined #RubyOnRails
[04:04:57] sunya7a_: has joined #RubyOnRails
[04:04:57] sunya7a: has joined #RubyOnRails
[04:05:31] woods: the UGT convention is a good one
[04:05:56] baweaver: throw the full error into a gist
[04:06:09] baweaver: along with ruby version, and rails version
[04:06:40] baweaver: ping me when you have that, back and forth working on a few things.
[04:06:48] woods: ok, thanks!
[04:07:04] craysiii: has joined #RubyOnRails
[04:08:37] baweaver: did not mean a literal ping, but that works to.
[04:08:44] woods: i saw the command
[04:08:45] woods: had to do it
[04:08:59] woods: here is the gist
[04:09:00] woods: https://gist.github.com/woodyhavoc/4f6d53a923529527880a
[04:09:18] Guest67642: has joined #RubyOnRails
[04:11:01] arup_r: it seems a DB datetime field accepts "YYYY-MM-DD" not "MM-DD-YYYY". How can I save a datetime "YYYY-MM-DD"? https://gist.github.com/aruprakshit/f836f0ebe8d27c49598b
[04:11:09] Radar: woods: `which ruby` and `gem env`, please.
[04:11:26] Radar: arup_r: what date is 07/11/2015 exactly?
[04:11:43] linocisco: http://pastie.org/private/ksmwdthkpsi3eoroypulqg
[04:11:44] Radar: Is it the 11th of July 2015, or is it the 7th of November?
[04:11:49] arup_r: Radar: US format
[04:12:02] Radar: linocisco: Why are you running it as "sudo"?
[04:12:02] mary5030: has joined #RubyOnRails
[04:12:33] woods: which ruby: /usr/bin/ruby, gem env: https://gist.github.com/woodyhavoc/1ba74a169d4a66e26fde
[04:12:39] linocisco: Radar, same error even without sudo
[04:12:41] Radar: woods: How did you install Ruby?
[04:12:46] Radar: linocisco: How did you install Ruby?
[04:12:51] Radar: (Yes, same question to both)
[04:12:51] woods: sudo dnf install ruby
[04:12:54] Radar: Very rare.
[04:13:02] arup_r: Radar: didn't get you
[04:13:15] Radar: arup_r: You should really submit it as YYYY-MM-DD.
[04:13:32] linocisco: Radar, following http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you/
[04:13:40] Radar: arup_r: You can use Date.strptime in your controller to munge it into the right format.
[04:13:43] Radar: linocisco: That's my guide!
[04:14:03] linocisco: Radar, good to see original writer
[04:14:21] linocisco: Radar, it was fine with rails new blog for first time application
[04:14:27] baweaver: well at least you're on someone's radar there :P
[04:14:34] Radar: linocisco: Can you run `which ruby` and `gem env` and https://gist.github.com the output?
[04:14:39] linocisco: Radar, but when I tried to access that blog again, there is error
[04:14:49] Jon30: has joined #RubyOnRails
[04:15:25] Radar: woods: Ok, looks like it didn't install the Ruby dev package which might be why you're getting errors.
[04:15:34] Radar: woods: I don't know what it's called on Fedora so I'm going to have a guess
[04:15:41] woods: probably ruby-dev
[04:15:44] woods: ill try getting that going
[04:15:50] arup_r: Radar: Ok. In frontend I need to show the format in datepicker as "MM-DD-YYYY". So, inside the controller, should I change it to the DB format
[04:16:06] Radar: arup_r: Yes.
[04:17:06] linocisco: Radar, https://gist.github.com/anonymous/6612c08513a5d12c1c43
[04:17:39] woods: ok, so installing ruby-devel solved it
[04:17:41] Radar: linocisco: and what's `which ruby`?
[04:17:47] Radar: woods: Magic :)
[04:17:55] woods: Radar: thanks for the suggestion!
[04:18:35] Radar: Oh, I think I see it there " /usr/local/bin/ruby"
[04:18:48] Radar: linocisco: Did you install a system Ruby through apt? it looks like you might've.
[04:18:51] woods: I've heard nothing but good things about the rails community, and now I see that the hype is real.
[04:19:11] linocisco: Radar, http://pastie.org/private/7bfzpny787oip0fosalo1a
[04:19:31] Radar: linocisco: Yeah, that's strange. It shouldn't be coming from /usr/local/bin at all. It should be coming from your home directory.
[04:19:41] Radar: linocisco: Could you please uninstall that other Ruby?
[04:20:11] siddart: has joined #RubyOnRails
[04:20:16] linocisco: Radar, I took one day class where I was to install ruby many times usig tarballs and apt. I dont know what and how to remove
[04:20:35] Radar: linocisco: Ok, no worries. Let me try to help here.
[04:20:47] Radar: linocisco: rm /usr/local/bin/ruby
[04:21:02] Radar: And can you show me what `which gem` is too, please? I think it'd be /usr/local/bin/gem.
[04:21:13] Radar: linocisco: rm -rf /usr/local/lib/ruby/gems/2.2.0
[04:21:18] sotojuan: has joined #RubyOnRails
[04:22:52] linocisco: Radar, /usr/local/bin/gem
[04:23:06] Radar: linocisco: rm /usr/local/bin/gem too then
[04:24:39] linocisco: Radar, now which gem=>/usr/bin/gem
[04:24:59] Radar: linocisco: Remove that one too.
[04:25:05] Radar: linocisco: sudo apt-get remove ruby
[04:25:34] Radar: linocisco: Trying to get this to the point where both `which ruby` and `which gem` don't show anything.
[04:25:38] sotojuan: has left #RubyOnRails: ()
[04:26:20] Radar: If they're still showing stuff, then please tell me and I'll find the right commands to remove them.
[04:26:23] craysiii: i used the rails girls install scripts which used rvm instead of rbenv, is there any logical reason for me to switch ?
[04:26:39] linocisco: Radar, like you said, which showed nothing after removing ruby
[04:26:45] Radar: craysiii: RVM is a little bloated feature-wise. rbenv is less so, and chruby+ruby-install are as light as you can get.
[04:27:08] Radar: linocisco: Ok, I think we're at a good spot here. Could you go through that guide again from the top and let me know after installing ruby using ruby-install what `which ruby` shows you?
[04:27:23] craysiii: on my dev machine it should be fine though, right? and it shouldn't affect me deploying to an env with rbenv?
[04:27:33] Radar: linocisco: What looks like has happened is that you've got a couple of failed Ruby installs and they're "competing" with each other.
[04:27:41] Radar: We've removed their executables now which should stop that.
[04:27:45] Radar: craysiii: that's right.
[04:28:01] linocisco: Radar, thanks alot. I will follow your guide again
[04:30:08] craysiii: is there a way to get the rails generator to stop generating things inside test/
[04:31:37] Cache_Money: has joined #RubyOnRails
[04:36:02] Radar: but I have forgotten the option
[04:36:10] Radar: config.generators.test_framework = nil maybe?
[04:37:05] rickmasta: has joined #RubyOnRails
[04:37:06] Radar: Just gave a junior dev feedback on one of their applications :D
[04:37:16] IFrank00: has joined #RubyOnRails
[04:37:31] imp4t: has joined #RubyOnRails
[04:39:11] arup_r: what is the feedback for the dev /
[04:39:20] arup_r: Hired/ rejected :) ?
[04:39:34] rickruby: has joined #RubyOnRails
[04:39:41] EXCHGR: has joined #RubyOnRails
[04:39:57] Radar: 1 page listing the things they could improve in their app
[04:40:08] Radar: 1/2 page of actionable feedback
[04:41:41] golgaroth: has joined #RubyOnRails
[04:42:45] Stuffness: has joined #RubyOnRails
[04:43:17] youngbaks: has joined #RubyOnRails
[04:45:47] nemo_: has joined #RubyOnRails
[04:46:19] krz: has joined #RubyOnRails
[04:47:23] annlewis: has joined #RubyOnRails
[04:48:00] mary5030: has joined #RubyOnRails
[04:48:02] linocisco: Radar, >>> Successfully installed ruby 2.2.0 into /home/naymyowin/.rubies/ruby-2.2.0
[04:48:15] Radar: linocisco: what does `which ruby` show you now?
[04:48:23] linocisco: Radar, should I proceed to install chruby now?
[04:49:01] linocisco: Radar, which ruby showed nothing
[04:49:14] Radar: linocisco: ok, good. Yes, install chruby now.
[04:49:49] mary5030: has joined #RubyOnRails
[04:50:44] jun: has joined #RubyOnRails
[04:51:59] moeabdol: has joined #RubyOnRails
[04:53:41] codelahoma_: has joined #RubyOnRails
[04:54:37] Motoservo_: has joined #RubyOnRails
[04:54:43] User4587_: has joined #RubyOnRails
[04:55:21] jun__: has joined #RubyOnRails
[04:55:22] Cache_Money: has joined #RubyOnRails
[04:55:31] linocisco: Radar, when I run "chruby" , it showed two lines. ruby-2.2.3
[04:55:57] egray: has joined #RubyOnRails
[04:55:59] imp4t: has joined #RubyOnRails
[04:56:27] linocisco: Radar, is that normal?
[04:56:27] Radar: linocisco: Ok, so there might be two different versions of Ruby installed there. You can run chruby ruby-2.2.3 and it should switch to 2.2.3
[04:56:35] Radar: linocisco: verify with ruby -v after switching
[04:57:00] robotbrain_: has joined #RubyOnRails
[04:57:24] linocisco: Radar, yes. ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
[04:57:38] Radar: linocisco: Ok, keep following the rest of that guide :)
[04:57:40] kramsee: has joined #RubyOnRails
[04:57:47] Killerkeksdose_: has joined #RubyOnRails
[04:58:02] many_: has joined #RubyOnRails
[04:58:16] jcm: has joined #RubyOnRails
[04:58:16] kiki_lam1: has joined #RubyOnRails
[04:58:17] richipar1o: has joined #RubyOnRails
[04:58:25] ltd_: has joined #RubyOnRails
[04:58:27] Grag_Harker: has joined #RubyOnRails
[04:59:35] workmad3: has joined #RubyOnRails
[05:00:19] arathald_: has joined #RubyOnRails
[05:00:44] FastJack_: has joined #RubyOnRails
[05:01:20] bePolite_: has joined #RubyOnRails
[05:01:36] skakri`: has joined #RubyOnRails
[05:01:47] michael_imac: has joined #RubyOnRails
[05:02:10] herenow_: has joined #RubyOnRails
[05:02:13] urkle-: has joined #RubyOnRails
[05:02:18] george2_: has joined #RubyOnRails
[05:02:20] hfp__work: has joined #RubyOnRails
[05:02:25] kalzz_: has joined #RubyOnRails
[05:02:43] jhass|off: has joined #RubyOnRails
[05:02:55] Leeky_: has joined #RubyOnRails
[05:02:56] hfp_: has joined #RubyOnRails
[05:03:10] bartj3: has joined #RubyOnRails
[05:03:33] fluxsource: has joined #RubyOnRails
[05:03:44] Liothen: has joined #RubyOnRails
[05:03:45] Liothen: has joined #RubyOnRails
[05:04:36] universa1: has joined #RubyOnRails
[05:04:46] one_zero: has joined #RubyOnRails
[05:05:46] LBRapid: has joined #RubyOnRails
[05:05:52] markelite: has joined #RubyOnRails
[05:06:09] DarkBushido: has joined #RubyOnRails
[05:07:19] Tempesta: has joined #RubyOnRails
[05:07:58] Avon: has joined #RubyOnRails
[05:08:15] tejasmanohar: has joined #RubyOnRails
[05:09:00] moeabdol: has joined #RubyOnRails
[05:09:16] cschneid: has joined #RubyOnRails
[05:09:37] ahmgeek: has joined #RubyOnRails
[05:09:43] xybre: has joined #RubyOnRails
[05:09:49] cball: has joined #RubyOnRails
[05:10:32] Voxxit: has joined #RubyOnRails
[05:12:29] dotty: has joined #RubyOnRails
[05:13:14] corioliss: has joined #RubyOnRails
[05:13:53] Cache_Money: has joined #RubyOnRails
[05:13:58] ewilliam: has joined #RubyOnRails
[05:14:27] imp4t: has joined #RubyOnRails
[05:14:30] feignt: has joined #RubyOnRails
[05:14:41] daxroc: has joined #RubyOnRails
[05:15:37] zemmihates: has joined #RubyOnRails
[05:18:33] linocisco: Radar, I did "gem install rails -v 4.2.0 --no-rdoc --no-ri" but when I typed rails --version
[05:18:34] linocisco: , it said The program 'rails' is currently not installed. You can install it by typing: sudo apt-get install ruby-railties
[05:18:37] zpe: has joined #RubyOnRails
[05:19:07] Radar: linocisco: yeah, don't follow those instructions :)
[05:19:21] Radar: linocisco: what does `gem env` and `which gem` show?
[05:21:13] linocisco: Radar, The program 'gem' is currently not installed. You can install it by typing:
[05:21:13] linocisco: sudo apt-get install ruby
[05:21:26] linocisco: Radar, which gem showed nothing
[05:21:47] Radar: linocisco: But ruby -v works fine? Shows 2.23?
[05:21:58] linocisco: Radar, I dont know why.yes. it is 2.2.3
[05:22:20] Radar: linocisco: what happens if you do "chruby ruby-2.2.0" and then "which gem"?
[05:22:26] Radar: Same thing, or does it now show a proper path?
[05:22:36] Radar: or even "gem env"
[05:22:47] linocisco: Radar, excuse me for a few mins and be right back sorry .urgent call.
[05:22:51] Radar: linocisco: np
[05:22:53] cleopatra: has joined #RubyOnRails
[05:25:36] WhereIsMySpoon: has joined #RubyOnRails
[05:26:46] mary5030: has joined #RubyOnRails
[05:26:52] linocisco: Radar, http://pastie.org/private/j3xepomsidy7qd2atkkctw. I dont know why
[05:27:16] Radar: linocisco: Did you run that in a new tab or is that after running chruby ruby-2.2.0?
[05:28:49] linocisco: Radar, http://pastie.org/private/0gwqeaf0od8pn98fqcug
[05:29:10] Radar: linocisco: ok, that's good. Looks like you might not have chruby's autoswitcher in place.
[05:29:28] Radar: See the "After this has been installed, we'll need to load chruby automatically, which we can do by adding these lines to ~/.bashrc:" paragraph in the post
[05:29:39] linocisco: Radar, I dont know.
[05:29:39] Radar: And then add the ~/.ruby-version file
[05:29:58] linocisco: Radar, with 2.2.0 again?
[05:30:14] Radar: You could also try it with 2.2.3
[05:30:38] Radar: I'd actually encourage using 2.2.3 because it's the latest version of Ruby
[05:33:06] linocisco: Radar, but I dont know how to install 2.2.3 while I am with 2.2.0
[05:33:20] Radar: linocisco: It looks like it might already have been installed earlier.
[05:33:24] yardenbar: has joined #RubyOnRails
[05:33:33] linocisco: Radar, it is conflicts inside
[05:33:37] Radar: linocisco: put ruby-2.2.3 in ~/.ruby-version, open a new tab and then run `ruby -v` and tell me what that shows you.
[05:33:43] Radar: linocisco: conflicts?
[05:36:11] linocisco: Radar, using new terminal, output is now like that http://pastie.org/private/8jv8kzhjvohx7n6v0fsztg
[05:36:40] sivsushruth: has joined #RubyOnRails
[05:36:47] Radar: linocisco: You shouldn't need `sudo` to launch `nano` there.
[05:36:55] Radar: But other than that, everything seems fine to me.
[05:37:27] linocisco: Radar, so can I try now to browse previous blog ?
[05:37:30] gambl0re: is chris oliver in here?
[05:37:47] Radar: linocisco: yup
[05:37:52] Radar: gambl0re: who
[05:38:05] SteenJobs: has joined #RubyOnRails
[05:38:07] gambl0re: chris oliver..
[05:38:30] Radar: https://twitter.com/excid3?
[05:39:14] Klumben: has joined #RubyOnRails
[05:39:33] gambl0re: i guess he's not in right now..
[05:40:03] Radar: might have something to do with it being 1:39am his time
[05:40:08] Radar: also: he doesn't come in here very often
[05:40:12] GnuYawk: has joined #RubyOnRails
[05:40:15] futilegames: has joined #RubyOnRails
[05:40:36] Radar: gambl0re: Why do you want to contact them?
[05:40:41] gambl0re: its 1:40am where i am also..
[05:40:54] gambl0re: i need to ask some questions.
[05:41:08] Radar: gambl0re: Sooooo ask them of this channel?
[05:41:10] tpendragon: has joined #RubyOnRails
[05:41:12] imp4t: has joined #RubyOnRails
[05:41:17] Radar: Why is Chris Oliver the only person who is able to answer your questions?
[05:42:45] GriffinHeart: has joined #RubyOnRails
[05:43:22] gambl0re: to be honest, i dont feel comfortable asking questions in here anymore
[05:44:18] baweaver: and why is that?
[05:44:38] linocisco: Radar, hi. here is output when running rails server http://pastie.org/private/axlshfmtwjohzoykgfilq
[05:45:46] baweaver: most of the people in here are tolerable as long as you play by the rules.
[05:45:49] gambl0re: i usually end up getting kicked out of the channel...
[05:45:59] baweaver: do you follow the rules?
[05:45:59] Uo9er_: has joined #RubyOnRails
[05:46:03] moeabdol: has joined #RubyOnRails
[05:46:15] baweaver: they're there to help us help you
[05:46:28] gambl0re: yea, but anyways i try to avoid asking any questions. i'll just idle.
[05:46:38] baweaver: ignoring them is a very good way to turn people against you as it makes things far more complicated
[05:47:01] gambl0re: ignoring who?
[05:47:02] baweaver: so if I look back through the logs I'll see that you shared code, followed instructions, and played nicely?
[05:47:06] yfeldblum: has joined #RubyOnRails
[05:47:10] baweaver: whoever happens to be trying to help.
[05:47:44] gambl0re: you're probably gonna have to check far back in the logs since i havent been active in here for a while
[05:48:07] baweaver: It'll filter by user.
[05:48:22] gambl0re: ok check if you want.
[05:48:33] annlewis: has joined #RubyOnRails
[05:49:46] CanTonic: has joined #RubyOnRails
[05:50:38] baweaver: It'll probably be after I get back, but I'll check into what's been happening when I get a second.
[05:50:49] baweaver: anyways, gotta get back home for now.
[05:55:14] triptec: has joined #RubyOnRails
[05:56:58] aguynamedben: has joined #RubyOnRails
[05:58:21] arup_r: has joined #RubyOnRails
[05:58:55] Radar: Stepped out for a bit. Back now.
[05:59:09] beast: has joined #RubyOnRails
[05:59:21] Radar: gambl0re: baweaver has a point. Follow the rules and you won't get kicked.
[05:59:39] Radar: You've been here long enough now you should be familiar with at least the first 4 rules.
[05:59:42] helpa: https://gist.github.com/996779
[05:59:45] imp4t: has joined #RubyOnRails
[05:59:57] cleopatra: hello people :)
[05:59:57] Radar: linocisco: Looks like the permissions are a bit weird on your app there
[06:00:07] lxsameer: has joined #RubyOnRails
[06:00:07] lxsameer: has joined #RubyOnRails
[06:00:09] Radar: linocisco: run `ls -al .` in the app directory, please.
[06:00:23] linocisco: Radar, ok. that is why i m confusing
[06:01:01] linocisco: Radar, http://pastie.org/private/gso2ltwktqqqgmai47oana
[06:01:14] Radar: linocisco: It's all owned by root!
[06:01:34] Radar: linocisco: `sudo chown -R naymyowin:naymyowin .`
[06:02:42] linocisco: Radar, chown: missing operand after ???naymyowin:naymyowin???
[06:02:53] Radar: hm, did I get that syntax wrong? Maybe so.
[06:03:27] Radar: linocisco: Did you put the . at the end of `chown` there?
[06:03:32] Radar: `sudo chown -R naymyowin:naymyowin .`
[06:03:35] Radar: There's a dot at the end
[06:03:49] linocisco: Radar, let me try again
[06:04:27] linocisco: Radar, http://pastie.org/private/7eddjoaiqyxhg6td9lli1w
[06:04:38] Radar: linocisco: Much better. Try running rails s again
[06:05:36] linocisco: Radar, I got it now. thanks . let me shutdown my laptop and run again
[06:06:12] linocisco: Radar, btw, whenever we do apt-get update, does it alter required files to run rails? I am curious to know
[06:06:14] madebymarkca: has joined #RubyOnRails
[06:06:27] Radar: linocisco: It shouldn't do that. You've removed those files now.
[06:07:05] linocisco: Radar, ok. to make sure let me shutdown my laptop and try again
[06:10:20] jenrzzz: has joined #RubyOnRails
[06:10:22] SteenJobs: has joined #RubyOnRails
[06:12:16] Peteykun: has joined #RubyOnRails
[06:13:19] youngbaks: has joined #RubyOnRails
[06:15:37] baweaver: has joined #RubyOnRails
[06:19:28] SuppliedRelic: has joined #RubyOnRails
[06:20:29] _tpavel: has joined #RubyOnRails
[06:24:52] trosborn: has joined #RubyOnRails
[06:25:05] srinidhi: has joined #RubyOnRails
[06:25:19] renews: has joined #RubyOnRails
[06:26:00] htmldrum: has joined #RubyOnRails
[06:26:00] srinidhi: has joined #RubyOnRails
[06:26:45] imp4t: has joined #RubyOnRails
[06:28:43] srinidhi: has joined #RubyOnRails
[06:30:47] lessless: has joined #RubyOnRails
[06:33:59] baweaver: gambl0re: haven't seen any instances of you being kicked or otherwise
[06:36:40] joshkovach: has joined #RubyOnRails
[06:37:33] mary5030: has joined #RubyOnRails
[06:41:59] greenride: When creating rails JSON apis, protect_from_forgery with: null_session is typically used, and CSRF protection is provided through the Authorization header containing a token. However, CSRF protection isn't present prior to user login. What's the standard way to provide CSRF protection for the /users/sign_in POST?
[06:42:38] siddart: has joined #RubyOnRails
[06:43:14] mloy: has joined #RubyOnRails
[06:44:36] sivsushruth: has joined #RubyOnRails
[06:44:52] cleopatra: greenride, only for action sign_in?
[06:45:17] imp4t: has joined #RubyOnRails
[06:46:23] arup_r: lol ,. many people don't know yet HAML syntax like me.. :D http://htmltohaml.com/
[06:46:24] greenride: cleopatra: Yes. After the sign_in, the CSRF protection is provided by the `Authorization: Token token=<32 digit hex number>` header.
[06:46:32] arup_r: It is down due to huge load
[06:47:36] workmad3: has joined #RubyOnRails
[06:49:16] annlewis: has joined #RubyOnRails
[06:49:19] greenride: cleopatra: Abstractly, it would be for any post, put, patch, or delete action where a user is not signed in. My main use case is the sign_in, sign_up, password reset, etc. None of these requests would have an Authorization header with a token.
[06:49:29] cleopatra: greenride i use this code skip_before_filter :verify_authenticity_token, :if => Proc.new { |c| c.request.format == 'application/json' }
[06:51:25] greenride: cleopatra: That just skips the check. Right? In theory, that would allow for a cross site attack signing in a user as someone else. Or, signing up that user for some other email address. Right?
[06:52:06] GriffinHeart: has joined #RubyOnRails
[06:52:34] pontiki: has joined #RubyOnRails
[06:52:36] cleopatra: yes this check and skips
[06:53:12] cleopatra: because i had the same problem working whit flux and json api
[06:53:45] cleopatra: you can see this
[06:53:47] cleopatra: http://stackoverflow.com/questions/9362910/rails-warning-cant-verify-csrf-token-authenticity-for-json-devise-requests
[06:54:20] bePolite_: has joined #RubyOnRails
[06:54:38] bruno-: has joined #RubyOnRails
[06:54:43] kiki_lam1: has left #RubyOnRails: ()
[06:54:44] greenride: If you're using an Authorization token, you won't be leaking data. So, it would probably pass a security audit. However, this seems to be a step backwards from the level of protection provided by the authentication token in form_for.
[06:55:06] stardiviner: has joined #RubyOnRails
[06:57:45] greenride: cleopatra: I saw that stackoverflow post. So far, I've just been turning off CSRF protection for json APIs, but I'm wondering if there's a better way.
[06:58:24] cleopatra: maybe you can use jwt
[06:59:35] greenride: That's a pretty heavy solution for this problem...
[07:00:19] cleopatra: greenride, can i ask you use backbone? or angular?
[07:00:51] greenride: For this situation, Angular
[07:01:53] greenride: I've used backbone, angular, ember, and react... same issue with all frameworks... it's an api issue unrelated to the frontend framework.
[07:03:43] imp4t: has joined #RubyOnRails
[07:04:36] roxtrongo: has joined #RubyOnRails
[07:04:53] lxsameer: has joined #RubyOnRails
[07:05:03] cleopatra: greenride, I searched about it , but not find anything better!
[07:05:58] greenride: cleopatra: have you seen the codeschool tutorial?
[07:06:11] greenride: on rails api?
[07:07:29] greenride: or http://apionrails.icalialabs.com/book ?
[07:08:47] greenride: the method recommended there avoids the csrf problem everywhere except the sign_in, sign_up, and password_reset.
[07:08:59] jun: has joined #RubyOnRails
[07:09:08] bePolite_: has joined #RubyOnRails
[07:09:51] cleopatra: no but will read this http://apionrails.icalialabs.com/book later
[07:09:54] njero: has joined #RubyOnRails
[07:12:08] pawnbox: has joined #RubyOnRails
[07:12:10] greenride: Essentially, they use an Authorization header with a user token that is stored in the user model (or its own table). That header provides csrf protection even though Rail's csrf protection is turned off. That method will pass security audits.
[07:12:42] greenride: However, a rogue site can sign in a user as someone else (for whom they have the username and password).
[07:12:59] greenride: But, they can't get any data.
[07:13:46] kies^: has joined #RubyOnRails
[07:14:07] dikaio: has joined #RubyOnRails
[07:14:40] c0py: has joined #RubyOnRails
[07:18:13] greenride: cleopatra: Here's the security problem that your site and mine currently face. http://stackoverflow.com/questions/6412813/do-login-forms-need-tokens-against-csrf-attacks
[07:19:34] renews: has joined #RubyOnRails
[07:22:10] imp4t: has joined #RubyOnRails
[07:28:48] ayonkhan: has joined #RubyOnRails
[07:30:45] njero: has joined #RubyOnRails
[07:38:10] trosborn: has joined #RubyOnRails
[07:40:16] freezevee: has joined #RubyOnRails
[07:40:53] arup_r: I want to call a method before render inside a controller action. Does http://api.rubyonrails.org/classes/AbstractController/Callbacks/ClassMethods.html#method-i-around_action fit my need ?
[07:41:00] cleopatra: has joined #RubyOnRails
[07:44:00] arup_r: let me try and see
[07:44:38] honzahovorka: has joined #RubyOnRails
[07:45:04] Peteykun: has joined #RubyOnRails
[07:47:01] jenrzzz: has joined #RubyOnRails
[07:48:08] U7se6: has joined #RubyOnRails
[07:50:01] annlewis: has joined #RubyOnRails
[07:52:13] imp4t: has joined #RubyOnRails
[07:52:16] srinidhi: has joined #RubyOnRails
[07:54:52] thinkswan: has joined #RubyOnRails
[07:58:22] workmad3: has joined #RubyOnRails
[08:00:27] glennt: has joined #RubyOnRails
[08:00:57] gambl0re: has joined #RubyOnRails
[08:06:12] stardiviner: has joined #RubyOnRails
[08:09:22] darutoko: has joined #RubyOnRails
[08:13:00] IFrank00: Hello Im using the delayed_paperclip and it use resque. I add it the redid gem to the gem file but how do I start redis im getting Redis::CannotConnectError
[08:13:41] rhizome: IFrank00: rake -T
[08:13:49] renews: has joined #RubyOnRails
[08:15:24] IFrank00: rhizome, still get the error :/ maybe I miss a step on setting it up
[08:17:12] sevenseacat: has joined #RubyOnRails
[08:19:23] rhizome: you shouldn't get an error running rake -T
[08:19:50] DEA7TH: has joined #RubyOnRails
[08:20:19] IFrank00: rhizome, im getting error on the localhost:3000/resque
[08:21:35] pawnbox: has joined #RubyOnRails
[08:21:44] IFrank00: rhizome, with rake -T I get a list I see the rake resque:work and others
[08:21:51] rhizome: right, because it doesn't sound like resque is running
[08:22:05] gambl0re: has joined #RubyOnRails
[08:22:11] arup_r: How can I cancel the Ajax call, based on some condition. My attempt didn't work https://gist.github.com/aruprakshit/b6449679b08a56168615
[08:23:53] stardiviner: has joined #RubyOnRails
[08:26:26] thinkswan: has joined #RubyOnRails
[08:26:47] njero: has joined #RubyOnRails
[08:28:14] arup_r: Anybody knows ...
[08:31:34] IFrank00: rhizome, now is working just close the terminal reopen it and work
[08:40:51] Moonlight-Angel: has joined #RubyOnRails
[08:41:07] marr: has joined #RubyOnRails
[08:41:23] bePolite_: has joined #RubyOnRails
[08:42:27] arBmind: has joined #RubyOnRails
[08:43:16] Spami: has joined #RubyOnRails
[08:44:46] craysiii: has joined #RubyOnRails
[08:47:05] Jon30: has joined #RubyOnRails
[08:48:24] IFrank00: rhizome, ok got the delay_paperclip working and the redid now I have the Queues paperclip 1 now I need to run it how I make a worker run that thank you
[08:50:55] annlewis: has joined #RubyOnRails
[08:51:40] IFrank00: ok got it working that to
[08:52:32] IFrank00: rhizome How can I do they task of adding the queues to the workers automatic
[08:52:43] ekem: anyone know how to make a rake test /test/models/... not fail if you've used strong parameters?
[08:53:09] ekem: i think the solution looks something like: params = ActionController::Parameters.new(raw_parameters)
[08:53:22] ekem: but im not sure where to setup the parameters for testing
[08:54:11] apg: has joined #RubyOnRails
[08:56:39] sivsushruth: has joined #RubyOnRails
[08:58:52] defsdoor: has joined #RubyOnRails
[09:02:13] imp4t: has joined #RubyOnRails
[09:02:35] solars: has joined #RubyOnRails
[09:03:40] GriffinHeart: has joined #RubyOnRails
[09:08:04] renews: has joined #RubyOnRails
[09:09:31] cleopatra: has joined #RubyOnRails
[09:11:26] imp4t: has joined #RubyOnRails
[09:13:15] cornerma1: has joined #RubyOnRails
[09:14:29] workmad3: has joined #RubyOnRails
[09:14:55] sivsushruth: has joined #RubyOnRails
[09:17:33] Moonlight-Angel: has joined #RubyOnRails
[09:20:34] imp4t: has joined #RubyOnRails
[09:21:51] Moonlight-Angel: has joined #RubyOnRails
[09:22:37] n1ck7: has joined #RubyOnRails
[09:23:34] CheckYourSix: has joined #RubyOnRails
[09:24:24] jenrzzz: has joined #RubyOnRails
[09:27:12] yfeldblum: has joined #RubyOnRails
[09:27:19] workmad3: has joined #RubyOnRails
[09:32:12] futilegames: has joined #RubyOnRails
[09:34:09] siaW: has joined #RubyOnRails
[09:36:09] Uo9er_: has joined #RubyOnRails
[09:36:35] roxtrongo: has joined #RubyOnRails
[09:36:56] arup_r: Any way I fixed it. https://gist.github.com/aruprakshit/b6449679b08a56168615/edit I need to add this `return false if users.length is 0`
[09:37:02] arup_r: to cancel an Ajax call
[09:38:10] imp4t: has joined #RubyOnRails
[09:46:10] U7se6: has joined #RubyOnRails
[09:47:48] imp4t: has joined #RubyOnRails
[09:51:30] annlewis: has joined #RubyOnRails
[09:52:09] AzaToth: has joined #RubyOnRails
[09:52:56] jenrzzz: has joined #RubyOnRails
[09:55:47] michael_mbp: has joined #RubyOnRails
[10:02:05] Anubix: has joined #RubyOnRails
[10:02:42] Anubix: Some expert for setting up Mina deploy?
[10:04:05] jgt: has joined #RubyOnRails
[10:04:49] GriffinHeart: has joined #RubyOnRails
[10:05:35] siddart: has joined #RubyOnRails
[10:05:55] imp4t: has joined #RubyOnRails
[10:10:01] dici: has joined #RubyOnRails
[10:11:47] workmad3: has joined #RubyOnRails
[10:13:47] Pupeno: has joined #RubyOnRails
[10:14:52] mloy: has joined #RubyOnRails
[10:15:08] apg: has joined #RubyOnRails
[10:18:44] Us54er: has joined #RubyOnRails
[10:21:05] DoubleMalt: has joined #RubyOnRails
[10:24:23] imp4t: has joined #RubyOnRails
[10:24:43] User458764: has joined #RubyOnRails
[10:27:55] mrbubbles: has joined #RubyOnRails
[10:28:52] Cervajz: has joined #RubyOnRails
[10:29:05] stardiviner: has joined #RubyOnRails
[10:31:24] Cervajz_: has joined #RubyOnRails
[10:37:09] voker57: has joined #RubyOnRails
[10:37:09] pawnbox: has joined #RubyOnRails
[10:38:50] doublemalt_: has joined #RubyOnRails
[10:41:32] linocisco: has joined #RubyOnRails
[10:41:44] linocisco: Radar, hi it is ok
[10:41:49] Radar: linocisco: great :)
[10:42:00] Radar: I like hearing that
[10:42:33] linocisco: Radar, sorry for late response I was busy. So what is next to learn? How can develop rail app? railsguide.org?
[10:42:48] Radar: linocisco: !r4ia
[10:42:48] helpa: linocisco: 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
[10:42:50] imp4t: has joined #RubyOnRails
[10:42:57] apg: has joined #RubyOnRails
[10:43:21] linocisco: Radar, it is also your book. great
[10:43:45] linocisco: Radar, btw, what editor should we use? atom or subline bla bla? most said atom
[10:43:52] Grundell: has joined #RubyOnRails
[10:43:53] Radar: I like Sublime Text 3.
[10:44:08] craysiii: I use sublime text 3 as well
[10:44:08] Anubix: has joined #RubyOnRails
[10:44:31] Anubix: Some expect for setting up Mina deploy? I can pay for it
[10:45:14] mloy: linocisco, emacs >:)
[10:45:24] mloy: I do like ST3 though.
[10:45:42] linocisco: mloy, thanks for input
[10:45:43] mloy: I used it to port an ST2 extension to ST3 and was a fan of how emacsy it is.
[10:45:47] Radar: I'm off to bed now :) have a good day/night/whatever
[10:45:59] stamina: has joined #RubyOnRails
[10:46:05] kidoz: has joined #RubyOnRails
[10:46:06] mloy: gn Radar
[10:49:04] Cervajz: has joined #RubyOnRails
[10:49:40] Cervajz__: has joined #RubyOnRails
[10:50:11] wethu: has joined #RubyOnRails
[10:51:13] linocisco: Radar, sample app project in that book is modified twitter app?
[10:52:17] annlewis: has joined #RubyOnRails
[10:52:57] imp4t: has joined #RubyOnRails
[10:54:51] renews: has joined #RubyOnRails
[10:58:57] atomical: has joined #RubyOnRails
[11:00:29] SteenJobs: has joined #RubyOnRails
[11:01:03] imp4t: has joined #RubyOnRails
[11:02:22] jenrzzz: has joined #RubyOnRails
[11:06:23] workmad3: has joined #RubyOnRails
[11:10:25] saffron: has joined #RubyOnRails
[11:12:03] blackmesa: has joined #RubyOnRails
[11:12:26] cswelin: has joined #RubyOnRails
[11:13:35] saffron: has left #RubyOnRails: ()
[11:15:39] sivsushruth: has joined #RubyOnRails
[11:15:46] cball: has joined #RubyOnRails
[11:19:26] prestorium: has joined #RubyOnRails
[11:19:30] imp4t: has joined #RubyOnRails
[11:37:44] roxtrongo: has joined #RubyOnRails
[11:39:48] blackmesa: has joined #RubyOnRails
[11:44:29] tsujp: has joined #RubyOnRails
[11:47:02] johnflux: has joined #RubyOnRails
[11:47:34] Uo9er_: has joined #RubyOnRails
[11:51:56] renews: has joined #RubyOnRails
[11:53:25] annlewis: has joined #RubyOnRails
[11:55:18] doublemalt_: has joined #RubyOnRails
[11:55:21] DoubleMalt: has joined #RubyOnRails
[12:00:48] atomical: has joined #RubyOnRails
[12:06:51] jgt: has joined #RubyOnRails
[12:08:38] Pazician: has joined #RubyOnRails
[12:10:21] atomical: has joined #RubyOnRails
[12:13:28] vasilakisFiL: has joined #RubyOnRails
[12:19:53] moeabdol: has joined #RubyOnRails
[12:24:20] n1ck7: has joined #RubyOnRails
[12:24:26] arBmind: has joined #RubyOnRails
[12:25:55] taxen: has joined #RubyOnRails
[12:28:58] taxen: I have User, Membership and Group model. Membership has a "has_accepted" boolean field. Group is has_many through membership - user is has_many groups through membershop. I want to select all groups where a user has accepted a membership. Any ideas?
[12:35:18] jgt: has joined #RubyOnRails
[12:40:30] mhib: has joined #RubyOnRails
[12:41:24] Peteykun: has joined #RubyOnRails
[12:41:32] stardiviner: has joined #RubyOnRails
[12:43:22] tbuehlmann: taxen, a specific user?
[12:44:27] taxen: tbuehlmann: yeah, I'd like to query all groups a user has a membership to where the "has_accepted" flag on the membership is true
[12:45:11] taxen: tbuehlmann: a given user. not a specifc one :)
[12:46:10] User458764: has joined #RubyOnRails
[12:46:11] renews: has joined #RubyOnRails
[12:46:15] n1ck7: has joined #RubyOnRails
[12:47:49] tbuehlmann: then: user.groups.where(memberships: {has_accepted: true})
[12:47:53] Anubix: has joined #RubyOnRails
[12:49:13] Anubix: has left #RubyOnRails: ()
[12:49:43] Anubix: has joined #RubyOnRails
[12:50:17] Anubix: I need help with Mina deploy on DigitalOcean. I pay for it on PayPal. Can somebody help me?
[12:52:18] netzfisch: has joined #RubyOnRails
[12:53:04] atomical: has joined #RubyOnRails
[12:53:47] DEA7TH: https://gist.github.com/VelizarHristov/cd94d6cbd26aa5d67b0a
[12:54:12] annlewis: has joined #RubyOnRails
[12:54:18] DEA7TH: Where does this method belong? It is clearly only useful for displaying dots on a (Google) map.
[12:54:33] workmad3: has joined #RubyOnRails
[12:55:03] DEA7TH: I'm thinking one of the following: Helper; ViewModel (decorator); Model, passed to the view via the controller.
[12:55:19] tbuehlmann: DEA7TH, a decorator/presenter
[12:55:35] taxen: tbuehlmann: thanks, works like a charm
[12:56:04] DEA7TH: tbuehlmann: So then is it ok if the controller passes the objects, and then the decorator extracts this from them?
[12:56:26] DEA7TH: to be clear, this is logic which is called from the viewer. (but happens outside of it)
[12:56:41] tbuehlmann: DEA7TH, I'd let the controller find the model and decorate the record. then call it in the view
[12:56:48] tbuehlmann: (if understood correctly)
[12:56:57] DEA7TH: oh good. I was worried since I never used decorators before
[12:58:33] ahmgeek: has joined #RubyOnRails
[13:02:19] kalusn: has joined #RubyOnRails
[13:04:04] workmad3: has joined #RubyOnRails
[13:10:41] Peteykun: has joined #RubyOnRails
[13:11:13] jgt: has joined #RubyOnRails
[13:11:44] nurey: has joined #RubyOnRails
[13:11:58] The_Phoenix: has joined #RubyOnRails
[13:12:46] bruno-: has joined #RubyOnRails
[13:14:45] arBmind1: has joined #RubyOnRails
[13:17:13] annlewis: has joined #RubyOnRails
[13:20:18] arBmind: has joined #RubyOnRails
[13:20:20] blackmesa: has joined #RubyOnRails
[13:21:07] netzfisch: has joined #RubyOnRails
[13:23:36] tvw: has joined #RubyOnRails
[13:25:11] bmalum: has joined #RubyOnRails
[13:30:26] stenofilen: has joined #RubyOnRails
[13:32:57] ahmgeek: hey folks, I am into the first step in a new company, I haven't did any test in ruby before, they asked me to do a task with tests in two days, and to dig as much as I can in those two days in the tests world.
[13:33:07] ahmgeek: so any help or online links
[13:33:12] ahmgeek: will be more than great.
[13:33:48] atomical: has joined #RubyOnRails
[13:34:10] ekem: somethign about rspec
[13:35:28] FailBit: I don't like rspec
[13:35:33] FailBit: but if that's what you want to use, go for it.
[13:37:47] michael_mbp: has joined #RubyOnRails
[13:38:31] roxtrongo: has joined #RubyOnRails
[13:40:31] renews: has joined #RubyOnRails
[13:42:18] njero: has joined #RubyOnRails
[13:42:32] n1ck7: has joined #RubyOnRails
[13:46:29] U7se6: has joined #RubyOnRails
[13:48:10] h7br1x: has joined #RubyOnRails
[13:49:22] h7br1x: Tubbo: You around?
[13:49:43] ahmgeek: I meant tests in the essence of test.
[13:49:55] ahmgeek: I know nothing about testing at all, TDD.BDD etc..
[13:50:01] ahmgeek: where I should start.
[13:50:24] ahmgeek: before I write tests I need to know a little history maybe, but the souce, I need a souce
[13:50:27] FailBit: do you have an app?
[13:50:37] FailBit: if you have a working app already, design some smoketests
[13:50:41] FailBit: things that the app cannot functionw ithout
[13:51:18] ahmgeek: and I'll write a small app ?
[13:52:40] arBmind1: has joined #RubyOnRails
[13:52:49] h7br1x: Hey guys, I'm trying to setup a dynamic layout based on the hostname. Can anyone explain what I need to do in order to get abc.com to render the abc application layout and xyz.com to render the xyz application layout. I'm still pretty green to rails but this is what I have so far. https://gist.github.com/ktdmedia/3cb83292dcd389408235
[13:57:09] iateadonut: has joined #RubyOnRails
[13:57:43] daffy_duck: has joined #RubyOnRails
[14:02:17] arBmind: has joined #RubyOnRails
[14:03:17] sankaber: has joined #RubyOnRails
[14:04:30] superlou: has joined #RubyOnRails
[14:05:56] bruno-: has joined #RubyOnRails
[14:06:48] Lightsword: has joined #RubyOnRails
[14:08:00] monq: has joined #RubyOnRails
[14:08:49] arBmind1: has joined #RubyOnRails
[14:08:49] n008f4g_: has joined #RubyOnRails
[14:09:48] tbuehlmann: h7br1x, first: do you know how to tell a controller action what layout to use?
[14:10:14] h7br1x: tbuehlmann: Negative.
[14:10:56] h7br1x: Well... Kinda.
[14:11:59] h7br1x: I know about use layout and stuff. The part that's getting me is how to tell it to pick between different layouts by the domain used to access the app.
[14:12:23] Grundell: has joined #RubyOnRails
[14:13:29] tbuehlmann: if you know how to tell the action what layout to use, perfect. what you want to know about is the `request` object
[14:13:45] tbuehlmann: it holds information about the current request. you might be interested in `request.host`
[14:14:46] h7br1x: Alright, I started to get there but this is what I have so far. and don't know where to go next. https://gist.github.com/ktdmedia/3cb83292dcd389408235/#file-application_controller-rb-L25-L27
[14:16:00] tbuehlmann: beside the method name (why does it end with a `?`?), that's a good start
[14:16:24] tbuehlmann: so you just need some kind of condition in order to decide what layout to use
[14:16:38] tbuehlmann: have you checked `request.host`?
[14:17:19] siddart: has joined #RubyOnRails
[14:18:09] h7br1x: Honestly, that snippet was given to me to try by another developer. So I'm not entirely sure why it's `? `?
[14:18:21] moeabdol: has joined #RubyOnRails
[14:19:06] stannard: has joined #RubyOnRails
[14:19:19] hmsimha: has joined #RubyOnRails
[14:21:09] tbuehlmann: I'd go with something like this: https://gist.github.com/tbuehlmann/5811761ba5b373627118
[14:21:29] tbuehlmann: the custom_layout method then has to return a string (the name of the layout)
[14:22:55] lessless: has joined #RubyOnRails
[14:25:18] K_r3aPeR: has joined #RubyOnRails
[14:25:48] h7br1x: So request.host changes to a blank layout, so it's a step in the right direction. I have a layout/localhost.html.erb that I'd like it to call instead. Here's what I have so far https://gist.github.com/ktdmedia/3cb83292dcd389408235
[14:26:40] tbuehlmann: do you know what `request.host ? false : 'application'` means?
[14:27:27] h7br1x: I'm assuming but It's calling the name of the host for a layout name and if there is no layout matching the hostname it will return the default application layout?
[14:28:26] tbuehlmann: it's a different way to write this: https://gist.github.com/tbuehlmann/dd82f9c4a582f4a8b133
[14:28:42] tbuehlmann: it's called the ternary operator
[14:28:55] tbuehlmann: so, that doesn't make too much sense
[14:28:57] atomical: has joined #RubyOnRails
[14:28:58] nemo_: has joined #RubyOnRails
[14:28:59] pabvid: has joined #RubyOnRails
[14:29:43] FailBit: if nil means the same thing as false in that context, then I would write ('application' if request.host)
[14:30:02] demonlove: has joined #RubyOnRails
[14:30:06] tbuehlmann: also, that does not make too much sense
[14:30:14] FailBit: the ternary operator is often unclear and you can leverage ruby syntax to your advantage
[14:30:51] tbuehlmann: `request.host` returns something like 'localhost', 'abc.com' or 'xyz.com'
[14:31:35] tbuehlmann: so, check if request.host is one of them and if so, return the correct string
[14:31:46] n1ck7: has joined #RubyOnRails
[14:31:53] tbuehlmann: like: request.host is 'abc.com', return the string 'abc'
[14:32:44] srinidhi: has joined #RubyOnRails
[14:33:09] FailBit: layout ->{request.host == 'abc.com' ? 'abc' : 'xyz'}
[14:33:46] tbuehlmann: could you not paste a solution, PLEASE? trying some education here
[14:34:01] sankaber: has joined #RubyOnRails
[14:34:11] h7br1x: Your education is working
[14:34:36] h7br1x: https://gist.github.com/ktdmedia/3cb83292dcd389408235 this worked.
[14:34:46] renews: has joined #RubyOnRails
[14:34:48] FailBit: tbuehlmann: the best education is to see what works
[14:34:51] FailBit: trial and error
[14:35:52] FailBit: and I make no assertion that anything I write works
[14:36:00] tbuehlmann: giving people answers and don't let them figuring things out themselves is not education, but I won't discuss that here and now
[14:36:04] tbuehlmann: h7br1x, looks good!
[14:36:28] bluish: has joined #RubyOnRails
[14:36:28] raunicolae: has joined #RubyOnRails
[14:36:32] Uptime: has joined #RubyOnRails
[14:36:38] raunicolae: has left #RubyOnRails: ()
[14:37:09] jlpeters: has joined #RubyOnRails
[14:37:11] h7br1x: I'll agree seeing the solution can be very helpful but the step by step explanation of why that solution works is very helpful. So i appreciate both of you trying to help.
[14:37:38] FailBit: h7br1x: I might point out
[14:37:47] FailBit: you permit users to assign their role on signup
[14:37:55] FailBit: is that intentional?
[14:38:18] jenrzzz: has joined #RubyOnRails
[14:38:31] h7br1x: Thank you tbuehlmann!
[14:39:06] h7br1x: Failbit: Yes, They should be able to select their desired role between free, premium, or creator. I'm sure it could be written better but let I said still pretty green to rails.
[14:39:16] sankaber: has joined #RubyOnRails
[14:39:23] ericjphillips: has joined #RubyOnRails
[14:39:30] Lightsword: has joined #RubyOnRails
[14:39:38] FailBit: I'm just used to using role in a different context
[14:39:51] h7br1x: Would you suggest an alternative?
[14:39:54] vasilakisFiL: has joined #RubyOnRails
[14:40:14] FailBit: where role ??? ['user', 'janitor', 'moderator', 'admin']
[14:40:35] FailBit: but, different projects, different usecases
[14:40:49] h7br1x: What is ???
[14:40:58] GriffinHeart: has joined #RubyOnRails
[14:40:59] FailBit: is contained by
[14:41:44] pawnbox: has joined #RubyOnRails
[14:41:57] ericjphillips: I want to do this https://jsfiddle.net/ericjphillips/gc8qmnr5/ but can I use the forEach method?
[14:42:28] ericjphillips: wrong channel!
[14:42:48] h7br1x: tbuehlmann: so now I'm curious about routing multiple domains, can I use request.host in a similar fashion in my routes?
[14:43:05] tbuehlmann: h7br1x, do you want to have different routes per domain?
[14:43:32] workmad3: has joined #RubyOnRails
[14:43:37] h7br1x: Some pages will be the same
[14:43:44] h7br1x: but the homepage for example would be different
[14:44:11] h7br1x: sorry, the root page :P
[14:44:30] tbuehlmann: are you sure it's one application you're writing and not two? :)
[14:46:26] Uo9er_: has joined #RubyOnRails
[14:47:24] njero: h7br1x: if u want to run on two different hosts might as well run separate apps rt?
[14:47:29] atomical_: has joined #RubyOnRails
[14:47:41] h7br1x: That's a hard maybe lol. I want to use multiple domains to display a different logo for example but they will all use the same content and users.
[14:47:55] sankaber: has joined #RubyOnRails
[14:48:05] tbuehlmann: same application then
[14:48:11] njero: h7br1x: just change route file for each app
[14:48:32] n1lo: has joined #RubyOnRails
[14:48:37] h7br1x: n_e_o: that's what my original question was talking about.
[14:48:37] tbuehlmann: if you really want to have some routes only for some domains, `constraints` are a way to do this: https://stackoverflow.com/questions/4207657/rails-routing-to-handle-multiple-domains-on-single-application
[14:50:04] nemo_: has joined #RubyOnRails
[14:51:19] bmalum: has joined #RubyOnRails
[14:52:25] execute: has joined #RubyOnRails
[14:52:33] h7br1x: I'll give it read.
[14:53:09] execute: if x is an object, would if x return true?
[14:54:02] njero: execute: as far as i know it will :)
[14:54:10] tbuehlmann: only `false` and `nil` are falsy, all other objects are truthy
[14:54:16] beauby: has joined #RubyOnRails
[14:54:38] njero: tbuehlmann: +1
[14:54:42] erich: has joined #RubyOnRails
[14:55:03] aruntomar: has joined #RubyOnRails
[14:55:35] njero: execute: ie, except for TrueClass and NilClass object :P
[14:56:04] DoubleMalt: has joined #RubyOnRails
[14:56:07] njero: execute: *.. i mean FalseClass not TrueClass
[14:56:08] execute: ok thanks guys... here's my problem
[14:56:08] doublemalt_: has joined #RubyOnRails
[14:56:35] njero: execute: fire it :)
[14:58:00] nemo_: has joined #RubyOnRails
[14:58:13] execute: http://pastebin.com/xgP2gxvG
[14:58:38] Grundell_: has joined #RubyOnRails
[14:59:09] execute: so anyway, that code randomly goes to else
[14:59:24] njero: helpa: pastie and pastebin looks same... is this an add or something?
[14:59:46] execute: so anyway, my solution would be to replace if @card .... to if !@card.nil? ....
[14:59:51] execute: would that work betteR?
[15:00:34] tbuehlmann: `if @card` should work since find_by_hash will return a Card instance or nil
[15:00:36] atomical: has joined #RubyOnRails
[15:02:28] execute: tbuehlmann: yeah, i thought it would.. but it randomly hits else and i'm sure card is active and unconsumed
[15:02:54] execute: because on the else, i do a puts @card.inspect it shows it is active and unconsumed
[15:04:57] greengriminal: has joined #RubyOnRails
[15:05:07] Grundell: has joined #RubyOnRails
[15:05:30] Peteykun: has joined #RubyOnRails
[15:06:32] nemo_: has joined #RubyOnRails
[15:11:08] Us54er: has joined #RubyOnRails
[15:15:51] mary5030: has joined #RubyOnRails
[15:16:40] shinnya: has joined #RubyOnRails
[15:17:59] mary5030: has joined #RubyOnRails
[15:21:53] mary5030: has joined #RubyOnRails
[15:24:13] User458764: has joined #RubyOnRails
[15:25:07] chopin: has joined #RubyOnRails
[15:25:39] iateadonut: has joined #RubyOnRails
[15:27:32] aruntomar: has joined #RubyOnRails
[15:29:03] renews: has joined #RubyOnRails
[15:31:22] njero: has joined #RubyOnRails
[15:32:30] ericjphillips: has joined #RubyOnRails
[15:33:25] blackmesa: has joined #RubyOnRails
[15:35:31] matthewd: execute: Then your inspect must be lying to you (compared to the #active? / #unconsumed? methods)
[15:39:18] roxtrongo: has joined #RubyOnRails
[15:39:21] atomical: has joined #RubyOnRails
[15:42:24] dylanerichards_: has joined #RubyOnRails
[15:44:22] dylanerichards_: Hey all -- I'm experiencing some trouble with loading assets properly. When I hit the edit action of PostsController, the Asset Pipeline decides to look for an asset located in a folder that matches the id of the post... Strange because the show action does not evoke this behavior. Any insight on this?
[15:44:28] dylanerichards_: http://stackoverflow.com/questions/33199498/how-to-use-a-different-set-of-assets-for-a-rails-controller-or-action
[15:46:07] tbuehlmann: dylanerichards_, how do include assets in your templates?
[15:46:33] Uo9er_: has joined #RubyOnRails
[15:47:12] dylanerichards_: tbuehlmann_ -- They're just automatically included right now. Everything is placed in the public folder
[15:47:34] MaDErroR123: has joined #RubyOnRails
[15:47:34] dylanerichards_: I'm willing to hardcode the inclusion of whatever assets I need to get this page to load properly
[15:47:36] tbuehlmann: so you don't really use the asset pipeline?
[15:47:41] annlewis: has joined #RubyOnRails
[15:48:00] dylanerichards_: Sorry for confusion
[15:48:25] cleopatra: has joined #RubyOnRails
[15:48:56] tbuehlmann: okay, and how do you include the assets in your templates?
[15:49:53] dylanerichards_: I'm not doing anything in the templates to include them. The styles and js has just been working
[15:50:23] jgt: has joined #RubyOnRails
[15:52:21] rickmasta: has joined #RubyOnRails
[15:53:20] Grundell_: has joined #RubyOnRails
[15:53:21] nemo_: has joined #RubyOnRails
[15:53:26] tbuehlmann: dylanerichards_, so you manually placed the asset files in public/, right?
[15:53:43] dylanerichards_: tbuehlmann -- Correct
[15:53:52] tbuehlmann: how do you reference them in the template?
[15:54:37] bluish: has joined #RubyOnRails
[15:54:41] GnuYawk: has joined #RubyOnRails
[15:54:48] dylanerichards_: There's no reference to any assets in the template. Even in working templates
[15:55:16] tbuehlmann: I don't believe you, check the layout file(s)
[15:55:24] tbuehlmann: like app/views/layouts/application.html.erb
[15:55:38] dylanerichards_: Oh that template
[15:55:44] dylanerichards_: I was looking in posts/index.html.erb
[15:56:14] dylanerichards_: http://puu.sh/kOK9a/cff2acbac6.png
[15:56:21] dylanerichards_: ^screenshot of application.html.erb
[15:57:45] DEA7TH: has joined #RubyOnRails
[15:59:27] nogic: has joined #RubyOnRails
[16:00:21] tbuehlmann: no idea why the assets are loaded the way they are
[16:00:45] tbuehlmann: why exactly don't you use the asset pipeline and rails conventions?
[16:01:19] tbuehlmann: also, can you paste the application.css file?
[16:01:49] SteenJobs: has joined #RubyOnRails
[16:01:59] dylanerichards_: I'm using this paid bootstrap template... The easiest/laziest way of getting the assets to load in a way that'd work (that I knew of) was to just stick everything in public
[16:02:15] dylanerichards_: Thanks for your time, by the way. Hugely appreciated
[16:02:16] Moeh: has joined #RubyOnRails
[16:02:55] Moeh: How can I get a time object from a string like "5.minutes" so that I can do: Time.now + "5.minutes"
[16:03:05] dylanerichards_: http://puu.sh/kOKuO/d1acf1f65d.png <<< application.css
[16:04:13] nemo_: has joined #RubyOnRails
[16:04:28] FailBit: Moeh: use the chronic gem
[16:04:36] FailBit: "5 minutes from now" -> Time.now+5.minutes
[16:05:37] adavia: has joined #RubyOnRails
[16:06:59] sankaber: has joined #RubyOnRails
[16:07:33] Moeh: FailBit: It looks like if the result would be a timestamp, however what I want to check is: if (Time.now - self.last_update) > self.update_every where update_every is something like "5.minutes". eval(self.update_every) works, but of course creates a huge security risk.
[16:08:02] mlutsiuk: has joined #RubyOnRails
[16:08:14] FailBit: https://github.com/hpoydar/chronic_duration
[16:09:15] mlutsiuk: has left #RubyOnRails: ()
[16:12:34] vasilakisFiL: hey! I have users and followers. This is implemented by a table called followings and denotes a relation between 2 users. Which means if I have 100.000 users this table could go up to 100.000.000 :/ I don't think postgres can handle such large tables. What would you suggest doing?
[16:12:49] tweeeaks: has joined #RubyOnRails
[16:16:43] andersoldahl: has joined #RubyOnRails
[16:18:45] tbuehlmann: vasilakisfil, your assumption is wrong!
[16:21:35] tbuehlmann: I'd start with using exactly what you described
[16:21:52] rakm: has joined #RubyOnRails
[16:23:14] renews: has joined #RubyOnRails
[16:25:49] pwnd_nfsw: has joined #RubyOnRails
[16:26:16] mlutsiuk: has joined #RubyOnRails
[16:27:18] bruno-: has joined #RubyOnRails
[16:30:59] siaW: has joined #RubyOnRails
[16:31:41] workmad3: has joined #RubyOnRails
[16:32:32] mary5030: has joined #RubyOnRails
[16:32:47] mlutsiuk: has left #RubyOnRails: ()
[16:32:59] Lightsword: has joined #RubyOnRails
[16:34:54] blackmesa: has joined #RubyOnRails
[16:35:14] mlutsiuk: has joined #RubyOnRails
[16:38:45] oscarb92: has joined #RubyOnRails
[16:41:14] oscarb92: hello, I'm working with RoR 4.1.8 on Windows. I'm having trouble with the JS assets since they are not updating as I run the project in development. I've tried rake cleaning and precompiling the assets, but it doesn't seem to work
[16:42:05] Silox|: has joined #RubyOnRails
[16:42:48] oscarb92: I suspect it has something to do with the fact that I've been changing the system time and date to test appointment features on my app
[16:43:59] Pazician: has joined #RubyOnRails
[16:44:46] n008f4g_: has joined #RubyOnRails
[16:47:14] imp4t: has joined #RubyOnRails
[16:48:32] annlewis: has joined #RubyOnRails
[16:48:47] Thomas-0725: has joined #RubyOnRails
[16:49:16] chouhoul_: has joined #RubyOnRails
[16:51:31] siddart: has joined #RubyOnRails
[16:52:00] gambl0re: is it safe to provide my cc number to gorails.com. is their site secure
[16:52:36] jun: has joined #RubyOnRails
[16:53:32] meoblast001: has joined #RubyOnRails
[16:56:08] acti0nman: has joined #RubyOnRails
[16:56:26] imp4t: has joined #RubyOnRails
[16:57:09] tbuehlmann: the owner of that page behaved like a dork in here some time ago, iirc. that's all I remember, not watching/reading anything from that person again
[16:57:23] tsujp: has joined #RubyOnRails
[17:03:21] SteenJobs: has joined #RubyOnRails
[17:03:21] Moeh: FailBait: Thanks, that helped a lot!
[17:03:36] tbuehlmann: not sure I'm blaming the right site there
[17:03:39] Moeh: I also switched to storing the update_every duration in seconds. Makes a lot of things easier.
[17:04:02] tbuehlmann: just checked my logs, it was "rubycasts io" and the person behind it. taking everything back about gorails
[17:07:33] DoubleMalt: has joined #RubyOnRails
[17:08:37] doublemalt_: has joined #RubyOnRails
[17:09:01] andersoldahl: has joined #RubyOnRails
[17:09:53] thejamespinto: has joined #RubyOnRails
[17:10:34] thejamespinto: hey guys, anybody here ever used Rubber with DigitalOcean? it's asking me for a key_file and I don't know how to set it up. halp plz
[17:10:37] workmad3: has joined #RubyOnRails
[17:11:06] pawnbox: has joined #RubyOnRails
[17:11:14] MaDErroR123: has joined #RubyOnRails
[17:11:34] jgt: has joined #RubyOnRails
[17:11:43] pawnbox: has joined #RubyOnRails
[17:12:39] hyperdrive: has joined #RubyOnRails
[17:13:53] sankaber: has joined #RubyOnRails
[17:14:48] sankaber: has joined #RubyOnRails
[17:17:27] renews: has joined #RubyOnRails
[17:17:28] roxtrongo: has joined #RubyOnRails
[17:20:20] MaDErroR123: has joined #RubyOnRails
[17:21:48] woods: has joined #RubyOnRails
[17:21:55] woods: good morning
[17:22:41] netzfisch: has joined #RubyOnRails
[17:23:15] imp4t: has joined #RubyOnRails
[17:23:44] srinidhi: has joined #RubyOnRails
[17:24:28] capin: afternoon
[17:24:43] mission712_: has joined #RubyOnRails
[17:25:16] stannard: has joined #RubyOnRails
[17:27:18] aruntomar_: has joined #RubyOnRails
[17:28:52] bmalum: has joined #RubyOnRails
[17:30:39] renegadeandy: has joined #RubyOnRails
[17:30:49] siddart: has joined #RubyOnRails
[17:33:31] bluish: has joined #RubyOnRails
[17:35:52] oscarb92: hello, I'm working with RoR 4.1.8 on Windows. I'm having trouble with the JS assets since they are not updating as I run the project in development. I've tried rake cleaning and precompiling the assets, but it doesn't seem to work
[17:36:07] oscarb92: I suspect it has something to do with the fact that I've been changing the system time and date to test appointment features on my app
[17:36:44] baweaver: has joined #RubyOnRails
[17:38:23] qejk: has joined #RubyOnRails
[17:39:17] stamina: has joined #RubyOnRails
[17:39:46] sankaber: has joined #RubyOnRails
[17:40:39] aclearman037: has joined #RubyOnRails
[17:40:52] beast_: has joined #RubyOnRails
[17:41:26] imp4t: has joined #RubyOnRails
[17:41:31] Cache_Money: has joined #RubyOnRails
[17:43:39] sankaber: has joined #RubyOnRails
[17:45:07] vasilakisFiL: tbuehlmann not sure what you mean
[17:45:48] tbuehlmann: I mean that postgres can handle that
[17:46:02] vasilakisFiL: can postgres handle 100.000.000 rows ? didn't know that
[17:46:33] tbuehlmann: see http://www.postgresql.org/about/
[17:46:42] U7se6: has joined #RubyOnRails
[17:47:03] Coldblackice: has joined #RubyOnRails
[17:47:08] aruntomar: has joined #RubyOnRails
[17:47:41] vasilakisFiL: the thing is when I try to find something on table, it shouldn't take much time.. joining this table with users should also be fast
[17:48:54] User458764: has joined #RubyOnRails
[17:49:14] annlewis: has joined #RubyOnRails
[17:53:08] draken: has joined #RubyOnRails
[17:54:41] draken: does anyone know why my index.html.erb of a controller is not showing up after all the stuff in my application.html.erb
[17:55:12] renegadeandy: draken: show the code please
[17:56:47] njero: has joined #RubyOnRails
[17:58:54] bruno-: has joined #RubyOnRails
[17:59:58] imp4t: has joined #RubyOnRails
[18:00:57] draken: what part
[18:01:58] totimkopf: has joined #RubyOnRails
[18:03:23] bleda: has joined #RubyOnRails
[18:03:33] bleda: has joined #RubyOnRails
[18:04:52] skyjumper: has joined #RubyOnRails
[18:07:51] Pupeno: has joined #RubyOnRails
[18:07:51] Pupeno: has joined #RubyOnRails
[18:08:04] tbuehlmann: vasilakisfil, have indices then
[18:08:52] FailBit: <vasilakisfil> can postgres handle 100.000.000 rows ? didn't know that
[18:08:58] FailBit: I'm about to find out!
[18:09:21] FailBit: I've been loading a giant collection of 105m rows since about an hour ago
[18:10:27] vasilakisFiL: tbuehlmann of course I will have indexes
[18:10:35] jgt: has joined #RubyOnRails
[18:11:29] netzfisch: has joined #RubyOnRails
[18:11:30] vasilakisFiL: tbuehlmann my question is what you do when your postgres is not capable of handling those many raws
[18:11:39] renews: has joined #RubyOnRails
[18:11:45] FailBit: ...how many rows do you need
[18:12:04] FailBit: because I'm pretty sure it can handle 100 million rows
[18:12:12] FailBit: especially with indexes...
[18:12:54] kies^: has joined #RubyOnRails
[18:13:14] ElFerna: has joined #RubyOnRails
[18:13:16] tbuehlmann: vasilakisfil, that's a very hypothetical question, not gonna take that. I hope you someday really _have_ that problem. because then you'll have a completely other set of problems to solve :)
[18:13:19] iamjarvo_: has joined #RubyOnRails
[18:13:34] tbuehlmann: and again: "Maximum Rows per Table: Unlimited"
[18:14:35] vasilakisFiL: I don't get you
[18:14:48] vasilakisFiL: let's say that I install postgres in my super raspberry pi.. can it handle 100.000.000 rows ?
[18:14:55] tbuehlmann: do you have 100_000 users?
[18:14:59] FailBit: probably not on a rpi
[18:15:08] tbuehlmann: again, very hypothetical..
[18:15:19] FailBit: I have 150k users
[18:15:35] FailBit: the server I run this off of is ridiculous
[18:15:40] njero: has joined #RubyOnRails
[18:15:49] Ergo: has joined #RubyOnRails
[18:15:56] FailBit: 128G RAM, 8-core Xeon with hyperthreading
[18:15:58] vasilakisFiL: but the point is to learn what to do before hand, not to stuck in that problem
[18:16:00] tbuehlmann: and you want to save from.. bad hardware?
[18:16:13] draken: does anyone know why my index.html.erb of a controller is not showing up after all the stuff in my application.html.erb. Nothing from the index.html.erb is showing up all of a sudden. Even if i make it blank with just 'test' it doesnt appear. Console even says its rendering index.html.erb into application.html.erb but its not appearing
[18:16:34] tbuehlmann: postgres is an RDBMS, able to handle a lot of rows. as that about page says, only your hardware is limiting
[18:16:46] vasilakisFiL: so when my hardware is limiting me
[18:16:54] vasilakisFiL: what should I do ?
[18:17:00] rhizome: get bigger hardware
[18:17:04] vasilakisFiL: that one side
[18:17:06] FailBit: get better hardware
[18:17:13] tbuehlmann: that's even cheaper than getting better software engineers
[18:17:21] vasilakisFiL: can't be that only side
[18:17:24] FailBit: I wouldn't even attempt to run a rails app on ARM
[18:17:26] arup_r: has joined #RubyOnRails
[18:17:30] FailBit: so forget rpi
[18:17:41] vasilakisFiL: guys I am talking here about a test scenario to learn
[18:17:42] rhizome: vasilakisfil: how many users do you have right now
[18:17:50] vasilakisFiL: in my scenario as many as I want
[18:17:59] FailBit: but how many do you have
[18:18:05] FailBit: you didn't answer the question.
[18:18:16] rhizome: is this homework?
[18:18:26] imp4t: has joined #RubyOnRails
[18:18:35] vasilakisFiL: no it's not a homework
[18:18:48] vasilakisFiL: if it was a homework I wouldn't bother you with hypothetical scenarios
[18:19:15] vasilakisFiL: but I am pretty sure throwing more hardware is the easiest solution
[18:19:17] vasilakisFiL: yet most expensive
[18:19:20] rhizome: it's sounding pretty hypothetical so far, though
[18:19:24] FailBit: if you have 2mil users, postgres will work fine
[18:19:31] vasilakisFiL: yeah because the point is to learn
[18:19:36] FailBit: about 32G of RAM should be plenty
[18:19:44] vasilakisFiL: FailBit I have only 1gb ram
[18:19:55] vasilakisFiL: ok that's unfair
[18:19:59] FailBit: but do you have 2million users right now?
[18:20:05] FailBit: I think not
[18:20:06] vasilakisFiL: let's say that I have 8gb ram
[18:20:09] FailBit: you scale as you go
[18:20:33] rhizome: vasilakisfil: database sizing is actually a discrete skill
[18:20:57] vasilakisFiL: rhizome I agree
[18:21:02] vasilakisFiL: it has to do with your hardware
[18:21:13] vasilakisFiL: that's why I brought rPI to the discussion
[18:21:14] rhizome: and postgres. and not rails.
[18:21:29] vasilakisFiL: yeah but I am using rails on top
[18:21:39] vasilakisFiL: you mean I should ask in another channel right ?
[18:22:28] FailBit: you sound like you have an X/Y problem
[18:22:40] FailBit: what is the issue you want to solve right now
[18:22:58] vasilakisFiL: the issue is to learn how to scale while I am unemployed
[18:23:23] baweaver: you learn how to scale while employed
[18:23:26] vasilakisFiL: maybe having a real life experience is better but not anyone is so lucky
[18:23:30] baweaver: doing otherwise is going to make a mess
[18:23:36] nickjj: has joined #RubyOnRails
[18:23:38] vasilakisFiL: why is that ?
[18:23:39] workmad3: has joined #RubyOnRails
[18:23:40] gerep: has joined #RubyOnRails
[18:23:53] baweaver: because then you tend to see everything as a scale problem
[18:24:03] baweaver: whereas very rarely will you have one.
[18:24:11] baweaver: worry about it when it comes
[18:24:20] baweaver: until then focus on getting something working.
[18:24:24] stannard: has joined #RubyOnRails
[18:25:02] vasilakisFiL: don't agree with that.. that's your assumption
[18:25:04] gerep: Hello people! I'm using this gem https://github.com/mkhairi/materialize-sass and I'm trying to override a variable like it explains here: https://github.com/mkhairi/materialize-sass#a-sass But it doesn't change anything, is anyone here using this gem that could help?
[18:25:14] baweaver: what's going to be more successful, something that can scale to 2 trillion users flawlessly but has no features, or something that has scaling problems but has features that draw people?
[18:25:35] baweaver: call it what you want
[18:26:18] ildarsafin: has joined #RubyOnRails
[18:26:50] vasilakisFiL: learning how to scale doesn't necesserily means that you see everything as a scale problem
[18:26:55] baweaver: premature optimization wastes a whole lot of time
[18:27:09] baweaver: when you should focus on solving the actual problem of what you're building.
[18:27:12] vasilakisFiL: who told you about premature optimization ?
[18:27:18] rhizome: if you are looking to boost your resume, there are much more profitable tasks to learn
[18:27:33] vasilakisFiL: I said I already have tables with extreme rows
[18:27:38] vasilakisFiL: in my raspberry PI
[18:27:40] baweaver: that's pretty well exactly what you're talking about
[18:27:53] FailBit: but you don't, you're posing it as a hypothetical
[18:27:54] baweaver: anyways, good luck, have fun.
[18:28:07] havenwood: vasilakisfil: Are you hitting limits or just imagining you might hypothetically?
[18:28:08] vasilakisFiL: yeah it's all about having fun not sure why you are trying to ruin it
[18:28:24] rhizome: you can certainly run tests to see what the limits of your rPI is
[18:28:54] vasilakisFiL: in raspberryPI I am pretty I have limits and these limits
[18:29:05] vasilakisFiL: can be somewhere before 100.000.000 rows
[18:29:30] FailBit: likely you'll run into trouble with 10000 on a rpi
[18:29:36] vasilakisFiL: yeah probably :P
[18:29:49] rhizome: yes. all hardware has limits
[18:30:13] rhizome: the thing is, and this might be useful for you, database limits can be calculated
[18:30:13] vasilakisFiL: then I will modify my scenario of course and see what I can do
[18:30:29] vasilakisFiL: do you have any link on that ?
[18:31:00] rhizome: chapter 1 boils down to "each field consumes X bytes"
[18:31:17] vasilakisFiL: aha are you talking about space ? I was thinking more on cpu power
[18:31:46] rhizome: i don't know what "cpu power" means here
[18:32:07] FailBit: CPU power is irrelevant
[18:32:15] FailBit: databases don't need a ton of CPU
[18:32:20] FailBit: they need memory
[18:33:39] havenwood: vasilakisfil: What's happening that's causing you pain? Are you just just worrying about efficiency? Or are you actually running into something that doesn't work or is too slow?
[18:34:23] Cache_Money: has joined #RubyOnRails
[18:34:24] vasilakisFiL: I would like to get into a job that has scaling problems.. and getting there in the interview they are going to ask me probably questions about scaling.. so the only way to get in there is to take my rPIs and play with them
[18:34:47] vasilakisFiL: and start sharding / replicating in postgres
[18:35:10] rhizome: a company with scaling problems isn't going to interview rails devs about it, but sysadmin/DBA
[18:36:06] vasilakisFiL: well I think being a polygot programmer is a good thing
[18:36:09] _tpavel: has joined #RubyOnRails
[18:36:10] youngbaks: has joined #RubyOnRails
[18:36:13] rhizome: you can certain add rows to your database, run your favorite query, and measure to see when it falls below your favorite threshold
[18:36:18] rhizome: certainly*
[18:36:34] rhizome: add more rows, run query, add rows, query, etc.
[18:36:53] baweaver: Learn more about query efficiency and indexing
[18:36:56] baweaver: it'll serve you far better
[18:37:30] baweaver: because companies that have scaling problems have DBAs or AWS to handle that issue
[18:37:44] baweaver: and would probably slap a rails programmer upside the head for poking at it too much.
[18:38:42] baweaver: they also have money to afford things like DB profiling tools (NewRelic) making it incredibly irrelevant.
[18:39:43] baweaver: If I were interviewing someone for a rails position in that scenario (and I have) I would be far more concerned with algorithmic knowledge and SQL query knowledge
[18:40:22] rhizome: invert this red-black tree
[18:40:35] baweaver: I'm not that much of a prick :P
[18:41:25] vasilakisFiL: not sure if that also applies in startups where everyone does everything
[18:41:33] vasilakisFiL: almost everything
[18:41:37] framling: has joined #RubyOnRails
[18:41:44] baweaver: but they had better know why this is a bad idea: Model.all.select { |m| m.field == val }
[18:43:02] nickjj: has joined #RubyOnRails
[18:43:19] baweaver: in a startup it's even more important to realize that getting features out is way more important
[18:43:39] baweaver: someone beats you to market and it won't matter how silky smooth the scaling is
[18:44:18] baweaver: worry about scaling when it becomes an issue.
[18:44:42] baweaver: and in the mean time just make sure people aren't making ridiculously bad queries.
[18:44:50] vasilakisFiL: but not sure why I can't learn about scaling before hand just for fun
[18:44:50] atomical: has joined #RubyOnRails
[18:44:50] netzfisch: has joined #RubyOnRails
[18:45:09] baweaver: you'd just be wasting your time
[18:45:15] blackmes1: has joined #RubyOnRails
[18:45:54] vasilakisFiL: you are saying that because each scenario is substantially different ?
[18:46:00] baweaver: there are books which cover SQL server optimization at least for MySQL, I'm sure there are some for PostgreSQL as well.
[18:46:29] mkp: has joined #RubyOnRails
[18:46:34] vasilakisFiL: well then why someone who has already scaled is considered more experienced than me who has never scaled ?
[18:46:54] Pazician: has joined #RubyOnRails
[18:46:55] baweaver: because they probably have work experience to back it up
[18:47:59] havenwood: vasilakisfil: They know what the problem isn't. :P
[18:48:13] vasilakisFiL: so playing with my raspberryPIs is just a waste of time ?
[18:48:21] havenwood: vasilakisfil: No, that's great.
[18:48:42] baweaver: if you're trying to get a rails job, it's not exactly the most efficient use of it
[18:49:08] mkp: hey, searching for the rails way to prevent a parent model from being created unless the nested params for its initial child model are valid. (e.g. - I have two models: 1. Account 2.User - An Account has many users and a User belongs to an Account. When creating an Account I have a nested form for the User as well and I don't want to allow the Acco
[18:49:08] mkp: unt to be created unless the User params are valid.)
[18:49:09] baweaver: focus on one thing: learning rails well
[18:49:32] rhizome: this would sound good at an interview: "hey, check out this site. i'm running it on an rPI with rails/postgres/yadda yadda"
[18:49:53] mkp: i'm already validating the user params in the nested form, though as long as the Account params are valid it does not stop the creation of the Account if the User params are empty or invalid.
[18:49:59] beauby: has joined #RubyOnRails
[18:49:59] annlewis: has joined #RubyOnRails
[18:50:19] vasilakisFiL: I think I know rails pretty well
[18:50:24] rhizome: mkp: validates_associated
[18:50:58] rhizome: vasilakisfil: cool! now build a site big enough to have scaling problems on your rPI :)
[18:51:23] vasilakisFiL: I don't think that's easy.. that also means that I have to find an idea that will attract users etc etc
[18:51:44] rhizome: all great things to have tackled before in a job interview
[18:52:15] draken: some how my <%=yield%> vanished
[18:52:26] baweaver: and there you have the real scaling issue for startups: how to get enough users to have a scaling problem
[18:53:04] rhizome: i have at least a few projects that would have scaling problems if anybody used them
[18:54:32] imp4t: has joined #RubyOnRails
[18:55:54] Galas: has joined #RubyOnRails
[18:57:07] FailBit: I have one that suffers under its current scale
[18:58:29] FailBit: it used to be much worse before I came on though
[18:58:51] FailBit: you can be stupid about using your database even if you database is 90% of the reason why you can't scale
[18:59:00] stannard: has joined #RubyOnRails
[18:59:25] FailBit: tip: never use mongodb
[18:59:33] woods: we have no ORM at work, and we have had a bunch of problems lately due to bugs in our manual queries, i really wish they would just adopt rails and leave php behind
[18:59:48] FailBit: I feel that
[19:00:00] woods: yeah, it is awful
[19:00:38] woods: ha, just saw you mentioned mongodb, they were debating between that and postgres for one our databases
[19:00:47] woods: they ended up choosing mongo
[19:01:24] arup_r: woods: you are now in mongo trap.
[19:01:45] FailBit: I'm getting free of this using mosql
[19:02:10] FailBit: in just a few weeks production will be using postgresql and everything will be back in business
[19:03:03] woods: i mostly do front end right now, so i dont have to worry much about database issues
[19:04:24] renews: has joined #RubyOnRails
[19:04:27] FailBit: which sucks sometimes - 10k active users bitching at you is not ideal
[19:04:29] FailBit: sleepless nights
[19:04:33] woods: i can imagine
[19:04:45] woods: we are pretty small still, im not sure how large our client base is
[19:05:16] woods: my plan is to work on a rails prototype, and see if i can convince them to migrate to that
[19:07:20] newton: has joined #RubyOnRails
[19:09:50] pwnd_nfsw: has joined #RubyOnRails
[19:09:59] c0py: has joined #RubyOnRails
[19:12:09] alexx1523: has joined #RubyOnRails
[19:13:00] imp4t: has joined #RubyOnRails
[19:14:39] bmalum: has joined #RubyOnRails
[19:15:18] roxtrongo: has joined #RubyOnRails
[19:16:31] ElFerna: has joined #RubyOnRails
[19:20:42] madebymarkca: has joined #RubyOnRails
[19:21:04] futilegames: has joined #RubyOnRails
[19:22:00] michaeldeol: has joined #RubyOnRails
[19:23:13] b2n5gf: has joined #RubyOnRails
[19:23:54] artto: has joined #RubyOnRails
[19:25:24] _wldcordeiro: has joined #RubyOnRails
[19:25:49] alexjh128: has joined #RubyOnRails
[19:25:52] mkp: has joined #RubyOnRails
[19:29:01] wyattwade: has joined #RubyOnRails
[19:32:01] michaeldeol: has joined #RubyOnRails
[19:32:23] siddart: has joined #RubyOnRails
[19:34:10] codelahoma: has joined #RubyOnRails
[19:35:36] mois3x: has joined #RubyOnRails
[19:35:38] alexjh128: has joined #RubyOnRails
[19:35:51] gambl0re: has joined #RubyOnRails
[19:43:16] shinnya: has joined #RubyOnRails
[19:43:56] darrencauthon: has joined #RubyOnRails
[19:44:12] siaW: has joined #RubyOnRails
[19:44:26] bruno-: has joined #RubyOnRails
[19:46:23] Galas: has joined #RubyOnRails
[19:46:29] Uo9er_: has joined #RubyOnRails
[19:47:02] simkessy: has joined #RubyOnRails
[19:47:51] simkessy: Hey, If I'm creating records using a CSV where each row in a record, should I be utilizing Transactions?
[19:49:14] darrencauthon: has joined #RubyOnRails
[19:49:51] michaeldeol: has joined #RubyOnRails
[19:50:14] n1ck7: has joined #RubyOnRails
[19:50:14] rhizome: transactions why?
[19:50:30] gambl0re: has joined #RubyOnRails
[19:50:45] annlewis: has joined #RubyOnRails
[19:53:47] simkessy: if one fails?
[19:54:00] simkessy: like a validation error
[19:54:17] michael_mbp: has joined #RubyOnRails
[19:54:18] youngbaks: has joined #RubyOnRails
[19:54:28] gambl0re: has joined #RubyOnRails
[19:54:48] bruno-: has joined #RubyOnRails
[19:54:55] blackmes1: has joined #RubyOnRails
[19:55:01] rhizome: i use find_or_initialize with if foo.valid? for something similar. what do you want to do if it's invalid? stop? ignore?
[19:55:21] michaeldeol: has joined #RubyOnRails
[19:57:27] jun: has joined #RubyOnRails
[19:57:31] simkessy: probably stop
[19:57:40] c0py: has joined #RubyOnRails
[19:58:07] simkessy: The way I see if, if one row fails, I don't want to trackdown the ones that passed and delete those and start over right
[19:58:16] rhizome: you're going to stop the whole import if a single record is bad?
[19:58:33] simkessy: I'm not sure what's the best approach
[19:58:33] GriffinHeart: has joined #RubyOnRails
[19:58:51] rhizome: it's highly context-dependent
[20:00:07] MartinElvar: has joined #RubyOnRails
[20:01:41] IFrank00: has joined #RubyOnRails
[20:01:49] simkessy: K then yea I'd rather cancel the entire import if 1 row fails, let the user know what the issue is, have him fix the file, then redo the import
[20:02:12] simkessy: seems like the simplest way
[20:02:51] FailBit: csv is such a persistent format
[20:03:04] FailBit: I see questions about it here every day
[20:03:15] michaeldeol: has joined #RubyOnRails
[20:03:53] ruurd: has joined #RubyOnRails
[20:05:16] ElFerna: has joined #RubyOnRails
[20:06:34] jgt: has joined #RubyOnRails
[20:06:56] simkessy: it's really simple to use, everyone get's it
[20:08:33] hephaestus_rg: has joined #RubyOnRails
[20:08:49] blackmes1: has joined #RubyOnRails
[20:11:46] workmad3: has joined #RubyOnRails
[20:14:02] ElFerna: has joined #RubyOnRails
[20:14:57] artto: has joined #RubyOnRails
[20:15:08] moeabdol: has joined #RubyOnRails
[20:16:56] Radar: GOOD MORNING
[20:18:13] jun: has joined #RubyOnRails
[20:20:24] shilon: has joined #RubyOnRails
[20:20:29] shilon: has left #RubyOnRails: ()
[20:22:08] njero: has joined #RubyOnRails
[20:22:16] arBmind: has joined #RubyOnRails
[20:23:14] mices: i don't understand something about this 'BCrypt::Password.new(remember_digest).is_password?(remember_token)` i thought they're saying the encrypted token is in the users record in the table and if the value of remember_token is encrypted also, then why do we need bcrypt::... to make the comparison
[20:23:57] penguinp1wernz: has joined #RubyOnRails
[20:24:48] mices: i'm sorry i see
[20:25:12] mices: what's in the database isn't encrypted, just the token on the browser
[20:26:25] michaeldeol: has joined #RubyOnRails
[20:27:30] FailBit: is that devise/warden code?
[20:29:25] taxen: has joined #RubyOnRails
[20:31:12] arathald: hey Radar. been working through your book
[20:31:58] FailBit: my entire computer is already lagging out really badly with 70 million rows
[20:31:59] ElFerna: has joined #RubyOnRails
[20:32:08] FailBit: can't wait to see what happens with 105mil..
[20:32:12] nogic: has joined #RubyOnRails
[20:32:35] arathald: turns out I actually had bought the previous version :P
[20:33:53] FailBit: ACTION stops everything
[20:34:28] IFrank00: Can some one point me in the right direction. Im using a background process of a image with delayed_paperclip. I like to update the partial where I have the IMG holder when the IMG is process
[20:37:24] yardenbar: has joined #RubyOnRails
[20:41:54] gerep: has joined #RubyOnRails
[20:42:05] workmad3: has joined #RubyOnRails
[20:44:21] rhizome: IFrank00: javascript
[20:44:56] FailBit: the filesystem cache is causing my system to lag down horribly
[20:45:05] FailBit: dammit linux stop eating my RAM
[20:45:25] rhizome: "filesystem cache?"
[20:45:48] FailBit: there's this one backgroudn process that's been feeding stuff to postgres for a couple hours now
[20:45:51] FailBit: it's reading from a 21GB file
[20:45:56] FailBit: I only have 16GB of RAM
[20:46:06] rhizome: split that bad boy up
[20:49:03] rhizome: split -l 100000 file.csv
[20:49:35] FailBit: it's not quite in csv format, heh
[20:49:47] rhizome: you can do it by bytes or whatever
[20:49:47] blackmes1: has joined #RubyOnRails
[20:49:51] FailBit: it's technically JSON but the rows are separated by lines
[20:50:00] FailBit: which is weird, but whatever - :mongodb:
[20:50:29] rhizome: doesn't importing from mongo output kind of defeat the purpose?
[20:51:06] rhizome: well...of using a database. just spitballing
[20:51:28] FailBit: changing from mongo to postgres
[20:51:40] annlewis: has joined #RubyOnRails
[20:55:10] drPoggs: has joined #RubyOnRails
[20:55:30] FailBit: almost oom'd there
[20:55:36] FailBit: I think I need a more efficient way to do this
[20:55:53] FailBit: although haven't got much left, on row 72mil
[20:57:35] safety_cut: has joined #RubyOnRails
[20:59:56] GriffinHeart: has joined #RubyOnRails
[21:00:07] safety_c_: has joined #RubyOnRails
[21:00:31] malcolmva: has joined #RubyOnRails
[21:00:37] greenride: has joined #RubyOnRails
[21:01:19] ruurd: drop all your indexes
[21:01:41] FailBit: that's not gonna help
[21:01:49] FailBit: the task isn't sticking on sending the data to postgres
[21:01:56] FailBit: it's sticking on parsing the JSON
[21:02:02] FailBit: I'm reading 1 million records at a time
[21:02:15] upgrayeddd: has joined #RubyOnRails
[21:05:02] levifig: has joined #RubyOnRails
[21:05:54] doublemalt_: has joined #RubyOnRails
[21:05:57] DoubleMalt: has joined #RubyOnRails
[21:06:02] htmldrum: has joined #RubyOnRails
[21:06:07] spellbook: has joined #RubyOnRails
[21:07:30] doublemalt_: has joined #RubyOnRails
[21:08:37] DoubleMalt: has joined #RubyOnRails
[21:09:48] rhizome: how many you at now?
[21:10:12] FailBit: I stopped the process so I could split this thing in half
[21:10:23] FailBit: (385922.4ms) SELECT COUNT(*) FROM "user_interactions"
[21:10:26] FailBit: => 73000000
[21:11:33] rhizome: 5-6 records per second
[21:11:55] FailBit: it's batching them
[21:12:03] ruurd: That's S_L_O_W
[21:12:18] DoubleMalt: has joined #RubyOnRails
[21:12:24] spellbook: Is there any reason not to use a column that is not a primary key column as the foreign key?
[21:12:24] FailBit: it takes about 20 seconds to insert 1 million rows into postgres
[21:12:37] FailBit: spellbook: no
[21:12:49] FailBit: and by no I mean "don't do that"
[21:13:05] Thomas-0725: has joined #RubyOnRails
[21:13:36] DoubleMalt: has joined #RubyOnRails
[21:13:47] spellbook: FailBit: Even if you know all the values will be uniques?
[21:14:46] spellbook: FailBit: Why?
[21:15:42] artto: has joined #RubyOnRails
[21:15:57] yfeldblum: has joined #RubyOnRails
[21:17:24] Spami: has joined #RubyOnRails
[21:17:47] rhizome: it's bad luck
[21:18:55] quazimodo: has joined #RubyOnRails
[21:19:23] greenride: has left #RubyOnRails: ()
[21:19:38] rhizome: hmm, doesn't seem to be many complaints out in the wild.
[21:20:03] greenride: has joined #RubyOnRails
[21:20:18] FailBit: probably because nobody ever does that
[21:20:25] FailBit: and I got frozen again
[21:20:27] greenride: What is the standard way to protect against Login CSRF attacks for a Rails JSON api?
[21:20:42] rhizome: there are enough SO entries for me to think counterarguments would surface
[21:21:05] rhizome: greenride: google "rails api csrf"
[21:22:08] netzfisch: has joined #RubyOnRails
[21:23:28] ruurd: has joined #RubyOnRails
[21:25:38] kalusn: has joined #RubyOnRails
[21:25:54] willharrison: has joined #RubyOnRails
[21:25:57] fedexo: has joined #RubyOnRails
[21:26:19] rdavila: has joined #RubyOnRails
[21:27:24] willharrison: I'm trying to use password confirmation on a rails site I am working on. everytime I fill out the form, I am getting back "password cannot be blank" here is my model and controller https://gist.github.com/willharrison/8f62df3b6f3e9250b480
[21:27:34] willharrison: does anyone know what might be causing this?
[21:28:05] Radar: willharrison: why is email and username attr_accessors here? https://gist.github.com/willharrison/8f62df3b6f3e9250b480#file-rb-L9
[21:28:15] Radar: willharrison: show us the form too please
[21:28:54] willharrison: Radar I assumed I needed accessors for them
[21:28:57] willharrison: here is the form https://gist.github.com/willharrison/3ea6677c6f6b8e6dde01
[21:29:14] Radar: willharrison: why? the table in the db has those fields and so the model will have accessors for them automatically
[21:29:24] willharrison: I didn't realize that
[21:29:41] FailBit: if you apply attr_accessor then it will override the rails attributes proxy, methinks
[21:30:26] FailBit: attr_accessible is a different matter and I wish rails wouldn't have used that name
[21:30:35] FailBit: thankfully it doesn't anymore
[21:31:03] willharrison: that fixed it
[21:31:51] shilon: has joined #RubyOnRails
[21:32:48] vasilakisFiL: has joined #RubyOnRails
[21:33:39] moeabdol: has joined #RubyOnRails
[21:35:26] bonhoeffer: has joined #RubyOnRails
[21:36:01] bonhoeffer: all, i???m struggling trying to figure out why an association isn???t loading ??? I have two tests that are not passing https://gist.github.com/tbbooher/edc4d98d4ec7a5764a3c
[21:36:15] bonhoeffer: cf: https://gist.github.com/tbbooher/edc4d98d4ec7a5764a3c#file-relationship_spec-rb-L27
[21:36:57] bonhoeffer: any vector on where to read up on this is much appreciated
[21:38:04] workmad3: has joined #RubyOnRails
[21:46:51] U7se6: has joined #RubyOnRails
[21:48:52] vasilakisFiL: has joined #RubyOnRails
[21:50:18] woods: has joined #RubyOnRails
[21:52:04] dideler: has joined #RubyOnRails
[21:52:32] annlewis: has joined #RubyOnRails
[21:52:44] siaW: has joined #RubyOnRails
[21:54:15] helpa: has joined #RubyOnRails
[21:56:16] VeryBewitching: has joined #RubyOnRails
[21:57:19] bonhoeffer: not sure why the association isn???t persisting
[21:58:11] vasilakisFiL: has joined #RubyOnRails
[21:58:23] Radar: bonhoeffer: use count instead of size
[21:58:57] bonhoeffer: interesting ??? thanks a ton
[22:00:30] Radar: Because it'll do an SQL query for the records, rather than counting what is already there
[22:01:27] greenride: rhizome: I Googled 'rails api csrf' and read several posts. There's a variety of answers but none seem good. They suggest the following. 1. Turn off csrf for json apis. 2. Use Authentication header (with token) only after login. 3. Set CSRF token with GET before login.
[22:01:30] greenride: #1 is subject to CSRF. #2 is subject to Login CSRF. #3 was claimed to be bad practice.
[22:04:01] bonhoeffer: Radar: thanks again ??? very helpful
[22:04:08] car54: has joined #RubyOnRails
[22:04:58] Radar: greenride: I agree with #1.
[22:05:49] bonhoeffer: Radar: but the test still doesn???t pass . . . looking at it in the debugger
[22:05:58] blackmes1: has joined #RubyOnRails
[22:06:00] Radar: bonhoeffer: test output please
[22:06:20] greenride: Radar: Are you suggesting that JSON apis should turn off csrf protection. Or, that turning of csrf tokens subjects them to csrf attacks on browsers?
[22:08:03] ElFerna: has joined #RubyOnRails
[22:09:27] vasilakisFiL: has joined #RubyOnRails
[22:10:13] car54: has joined #RubyOnRails
[22:11:35] greenride: Radar: Code school suggests `protect_from_forgery with: :null_session` for JSON apis and then using an Authorization header with `Token token=<32 digit hex>`. This protects against most CSRF attacks but not a login CSRF attack.
[22:11:38] Radar: greenride: I think that you should turn off CSRF protection on JSON APIs.
[22:12:24] bonhoeffer: Radar: https://gist.githubusercontent.com/tbbooher/edc4d98d4ec7a5764a3c/raw/ce97217a67a62229e4ad59fe78ed1bf59bbdd5bf/results.rb
[22:12:55] bonhoeffer: also included in: https://gist.github.com/tbbooher/edc4d98d4ec7a5764a3c#file-results-rb
[22:13:01] bonhoeffer: i???m looking at it as well . . .
[22:13:21] greenride: Code school suggests turning off as well. With the `Authorization: Token token=<32 digit hex>` this protects against all CSRF attacks except login CSRF. What can be used to protect against Login CSRF attacks?
[22:13:41] bonhoeffer: the key code being: SELECT COUNT(*) FROM "users" INNER JOIN "relationships" ON "users"."id" = "relationships"."grantor_id" WHERE "relationships"."reader_id" = $1 [["reader_id", 15]]
[22:14:28] greenride: Login CSRF = logging in a user with the attacker's credentials.
[22:15:00] rboyd__: has joined #RubyOnRails
[22:16:43] riotjones: has joined #RubyOnRails
[22:18:45] car54_: has joined #RubyOnRails
[22:18:46] mary5030: has joined #RubyOnRails
[22:20:16] diegoviola: has joined #RubyOnRails
[22:21:41] Aeyrix: greenride: Login CSRF doesn't matter tbh
[22:21:49] Aeyrix: in this instance
[22:22:33] greenride: Aeyrix: It doesn't matter from Mobile apps, but it is an issue in web browsers. Right?
[22:22:46] bonhoeffer: oh ??? this might be the problem: Relationship.all.size
[22:22:47] Aeyrix: Web browsers can't be forced to set a hearder.
[22:22:50] FailBit: you sound like those people that throw buzzwords around
[22:23:05] Aeyrix: You can't maliciously set a HTTP header in a browser.
[22:23:10] Aeyrix: It's a great feature, tbh.
[22:23:22] Aeyrix: I compromised a site once because I force my browser to relay "X-Forwarded-For: 127.0.0.1".
[22:23:27] Aeyrix: They didn't expect that. :^)
[22:23:35] FailBit: rails catches that though
[22:23:41] FailBit: IpSpoofingError or whatnot
[22:23:57] Aeyrix: No it doesn't.
[22:24:07] FailBit: ActionDispatch::RemoteIp::IpSpoofAttackError
[22:24:18] Aeyrix: I have it set permanently and have never come across that.
[22:24:20] greenride: Aeyrix: With CSRF turned off, what header is being set with the initial /users/sign_in POST request?
[22:24:35] Aeyrix: greenride: That's where you set an auth token for the user.
[22:24:37] FailBit: I have seen that error many times
[22:24:47] FailBit: if I hadn't seen it I would not know about it actually
[22:24:53] Aeyrix: FailBit: Does your booru have it
[22:25:01] Aeyrix: because i have it set and can access your booru no problem fam
[22:25:25] Aeyrix: Yeah it loaded.
[22:25:31] Aeyrix: X-Real-IP: 127.0.0.1
[22:25:34] Aeyrix: X-Forwarded-For: 127.0.0.1
[22:27:15] oflannabhra: has joined #RubyOnRails
[22:27:21] FailBit: Aeyrix: can you hit this URL https://derpibooru.org/admin/reports
[22:28:04] bmalum: has joined #RubyOnRails
[22:28:08] Aeyrix: Not right now tbh
[22:28:23] pydave6367: has joined #RubyOnRails
[22:28:24] srpski: has joined #RubyOnRails
[22:28:27] greenride: Aeyrix: That's my whole question. With login forms, there's a CSRF token that one obtains from the GET request, which is then a posted parameter in the POST /users/sign_in. This CSRF token doesn't exist in a JSON api's /users/sign_in POST when using 'protect_from_forgery with: :null_session'.
[22:28:35] Aeyrix: FailBit: It redirected me to /
[22:29:35] greenride: Aeyrix: On the /users/sign_in POST, there is no auth_token to set for the user.
[22:30:08] Radar: greenride: Why does that action even need CSRF protection?
[22:30:14] Radar: or auth token protection
[22:30:15] trosborn: has joined #RubyOnRails
[22:30:41] greenride: Radar: To prevent signing someone in with the attacker's credentials.
[22:30:50] Aeyrix: I... what?
[22:30:57] Aeyrix: Can you re-read what you just said, please?
[22:31:18] Aeyrix: Taking a step back here; do you understand what CSRF stands for, and what it means?
[22:31:31] greenride: CSRF = Cross Site Request Forgery
[22:31:32] Aeyrix: I'm happy to explain it if not.
[22:31:45] Aeyrix: Could you explain your understanding of the meaning?
[22:32:21] greenride: If the user doesn't notice the credentials are not his or hers, the user might use the site with the attacker's credentials and enter information such as credit cards, etc. Then, the attacker can login at a later time and obtain the information the user entered.
[22:32:38] srpski: I made a website with using rails
[22:32:43] srpski: www.piksir.com
[22:32:57] srpski: can you please check it?
[22:32:59] Aeyrix: greenride: Not... exactly.
[22:33:04] FailBit: srpski: for what?
[22:33:08] srpski: how can i improve it?
[22:33:12] srpski: image uploading
[22:33:26] FailBit: what if I'm evil 8chan and I upload CP to your site
[22:33:30] ruurd: greenride ... not at all..
[22:33:31] greenride: Aeyrix: CSRF... a roguesite.com submits Post/Put/patch/delete etc. when user clicks on a link in roguesite.com. The http requests are to the victimsite.com.
[22:33:32] FailBit: do you have the ability to remove it?
[22:33:39] srpski: I am good at php but I don't know rails
[22:33:44] Aeyrix: greenride: CSRF is essentially forging actions on behalf of a user without their consent.
[22:33:53] ruurd: CSRF tokens are used to ascertain that a POST is coming from the same origin as a previous GET
[22:33:53] Aeyrix: It's why it's commonly misnamed as "Cross-Site Request Fraud".
[22:34:23] srpski: will you help me?
[22:34:31] Aeyrix: If it was possible to measure the difference between logging a user in and logging a user in without their consent, nobody would.
[22:34:32] greenride: Aeyrix: Right. That's what CSRF is doing. And, login CSRF is forging the sign_in process without the user's consent.
[22:34:41] Aeyrix: And if someone did, everyone would stop and ask "don't you think that's a waste of time?"
[22:34:42] FailBit: srpski: do you have source code publically available for the project?
[22:35:03] srpski: yes it's on github
[22:35:09] FailBit: http://www.piksir.com/2l <- here's an idea: resize the image into the browser viewport using some css
[22:35:24] Aeyrix: FailBit: Remind me to use you as a PoC for my next social engineering demonstration.
[22:35:29] Aeyrix: I could driveby you so hard.
[22:35:39] FailBit: I have no doubt
[22:35:51] wethu: has joined #RubyOnRails
[22:35:54] FailBit: I'm not known for my social eptness
[22:36:45] Radar: greenride: why on earth why would someone want to sign in with someone else's credentials?
[22:36:52] Radar: And you're assuming that they have those credentials even in the first place.
[22:37:05] Radar: If they did have them, you have bigger problems than CSRF ;)
[22:37:06] greenride: Radar: The attacker can just create their own account.
[22:37:18] Radar: greenride: Not at a sign IN route.
[22:38:08] FailBit: srpski: where on github, exactly?
[22:38:17] Radar: FailBit: Guess :)
[22:38:18] srpski: https://github.com/yecgga/imagehost
[22:38:37] quazimodo: has joined #RubyOnRails
[22:38:45] FailBit: you made a rack app?
[22:38:53] greenride: Radar: Attacker creates their own account on let's say amazon.com using Amazon's ordinary web interface. Then, the user exploits Login CSRF on Amazon to log the victim into amazon.com using the attacker's credentials. Then, the user (not noticing) enters PII data into amazon.com. Now, the attacker can login to their own account and retrieve that data.
[22:39:19] shilon: has joined #RubyOnRails
[22:39:30] Radar: greenride: !security
[22:39:30] helpa: greenride: Ruby on Rails Security Guide - http://guides.rubyonrails.org/security.html - Written by Heiko Webers
[22:39:35] Radar: Aeyrix: all yours
[22:39:38] Radar: ACTION goes to do actual work
[22:39:48] Ropeney: has joined #RubyOnRails
[22:39:59] FailBit: ACTION did not recognize the directory layout of a sinatra app
[22:40:00] pwnd_nfsw: I was wondering what was going on there too
[22:40:34] pwnd_nfsw: You can make sinatra app have a very similar structure to a rails app
[22:40:39] beauby_: has joined #RubyOnRails
[22:41:58] srpski: so what now?
[22:42:19] Radar: srpski: This is not a Rails app.
[22:42:24] Radar: and suddenly the app is private on GitHub?
[22:43:38] Radar: "plz help"
[22:43:39] Radar: "What with?"
[22:43:42] Radar: "plz help"
[22:43:50] pwnd_nfsw: how is babby frommed
[22:44:55] Radar: Oh, they got redirected here from #ruby. That'd be why.
[22:45:07] Radar: (p.s. can you tell I'm waiting for a DB backup to be pulled down and imported?)
[22:46:09] VeryBewitching: Data transport is oddly relaxing.
[22:48:59] renews: has joined #RubyOnRails
[22:52:21] blackmesa: has joined #RubyOnRails
[22:52:34] IFrank00: rhizome, All day looking for a way of doing One time refresh with js on the holder IMG, I found some info about js Polling what do you think about that. Good bad idea. I only need the code to run just 1 time
[22:55:32] greenride: Radar: Nothing in the Rails Security guide talks about login CSRF attacks for JSON apis. Are you claiming that login CSRF is a stupid attack vector or that Rails JSON apis with `protect_from_forgery with: :null_session` don't need to protect against login CSRF?
[22:55:52] chopin: has joined #RubyOnRails
[22:58:29] dikaio: has joined #RubyOnRails
[23:01:59] ngscheurich: has joined #RubyOnRails
[23:03:29] quazimodo: has joined #RubyOnRails
[23:04:52] bonhoeffer: has joined #RubyOnRails
[23:06:06] shmilan: has joined #RubyOnRails
[23:10:36] bonhoeffer: has joined #RubyOnRails
[23:11:08] ngscheurich: has joined #RubyOnRails
[23:12:37] nertzy: has joined #RubyOnRails
[23:12:50] IFrank00: has joined #RubyOnRails
[23:14:42] greenride: Aeyrix: Is your position that login csrf is a stupid attack or that rails json apis are already protected even with 'protect_from_forgery with: :null_session'?
[23:14:59] Guest67642: has joined #RubyOnRails
[23:15:59] hephaestus_rg: has joined #RubyOnRails
[23:16:00] andersoldahl: has joined #RubyOnRails
[23:17:37] khoga: has joined #RubyOnRails
[23:18:03] Aeyrix: greenride: My position that login is not something that needs to be protected against cross-site request forgery.
[23:18:48] Radar: ACTION has the same position
[23:19:12] greenride: Aeyrix: This stack overflow post discusses the login csrf issue. http://stackoverflow.com/questions/6412813/do-login-forms-need-tokens-against-csrf-attacks
[23:19:52] greenride: Aeyrix: Google and Yahoo (along with some smaller sites) were hit by login csrf. Of course, I'm not Google, Yahoo, or anywhere near that scale.
[23:20:42] greenride: I agree with the position. Most security audits will point it out but still pass a site with login csrf issues.
[23:21:22] greenride: I was just wondering if there was a way to deal with the issue for JSON apis. Regular Rails login forms are protected.
[23:21:38] moeabdol: has joined #RubyOnRails
[23:22:33] Aeyrix: "JSON apis" is such a massive breadth of field I don't even know where to start.
[23:22:49] Aeyrix: Is it for web browsers? Applications? RESTful or for a javascript frontend?
[23:22:52] greenride: Rails JSON apis
[23:22:58] Aeyrix: That's equally unhelpful.
[23:23:38] Aeyrix: The reason I ask is because for three out of the four I mentioned there, you should be passing credentials as a header.
[23:23:40] greenride: Restful Rails JSON apis for a javascript single page app (angular) that is served from a separate frontend server.
[23:24:36] bonhoeffer: Radar: the problem before (counts of zero) was due to let in rspec not persisting to the database
[23:24:42] lessless: has joined #RubyOnRails
[23:25:15] Radar: bonhoeffer: let persists to the db just fine. If you're not calling the let method, then nothing will happen
[23:25:51] bonhoeffer: hmm ??? back to the drawing board before :each {???} works but let (:foo) {. . .} doesn???t
[23:25:57] Radar: let(:foo) { FactoryGirl.create(:foo) } but no mention of "foo" in the test == FactoryGirl.create won't be called
[23:26:00] Radar: bonhoeffer: use let!
[23:26:09] workmad3: has joined #RubyOnRails
[23:26:23] FailBit: ACTION screams
[23:26:42] VeryBewitching: Need a minute there FailBit? :D
[23:26:54] FailBit: rspeeeeeeeeeeeaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhh
[23:26:56] Radar: bonhoeffer: let is evalulated lazily... i.e. when the method it defines is called
[23:27:06] Radar: bonhoeffer: let! is evaluated when the let! block is defined
[23:27:12] artto: has joined #RubyOnRails
[23:27:18] Radar: FailBit: assert FailBit.angsty?
[23:27:20] Aeyrix: greenride: If you feel a pathological need to protect yourself against CSRF
[23:27:21] Radar: 1 example, 0 failues
[23:27:27] Aeyrix: pass a token in the GET
[23:27:30] Aeyrix: expect it in the response
[23:27:49] FailBit: my experience with rspec has made me want to tear my hair out
[23:29:07] esauOp: has joined #RubyOnRails
[23:29:10] Radar: FailBit: Probably poorly written RSpec tests tbh
[23:29:24] greenride: Aeyrix: using `Authorization: Token token=<32 digit hex number>`, one can pass credentials as a header. However, that token is not available for the /users/sign_in POST. Problem with creating a get and passing a token is that the attacker can just fetch the same token and use it for a post. SOP isn't available for protection in that case.
[23:29:33] PinkPickles: has joined #RubyOnRails
[23:29:37] hephaestus_rg: has joined #RubyOnRails
[23:29:51] Aeyrix: This is why I fucking detest "single-page applications".
[23:29:53] FailBit: Radar: it has to do with nested contexts
[23:29:57] Aeyrix: They're a toxic set of bullshit on web development.
[23:30:18] Aeyrix: Idiotic garbage thought up by marketing weasels who wanted to sit atop "the next big thing".
[23:30:19] greenride: Aeyrix: That's a position I can agree with. =)
[23:30:35] pwnd_nfsw: so popular though
[23:30:45] pwnd_nfsw: It's knowledge to have, even if you despise it
[23:31:24] Aeyrix: I have enough knowledge to know that there is no practical scenario where it provides a tangible benefit over a standard web application.
[23:31:27] Aeyrix: greenride: Read this - http://stackoverflow.com/questions/18378902/how-to-make-sure-rails-api-is-secured-from-csrf/18382223
[23:31:49] Radar: oh oh oh are we doing the thing where we google for the same thing and then cherry-pick links that support our arguments?
[23:32:14] WillAmes: has joined #RubyOnRails
[23:32:17] Aeyrix: Are you hating SPA or loving them?
[23:32:39] Aeyrix: Also that link was actually from a GitHub issue about the Rails documentation not being explicit enough about CSRF prevention.
[23:33:03] arBmind1: has joined #RubyOnRails
[23:34:26] renews: has joined #RubyOnRails
[23:34:52] Aeyrix: I have an inkling that the angular-rails gem actually does this CSRF stuff for you, to be honest.
[23:36:22] nizmow: has joined #RubyOnRails
[23:37:11] superlou: has joined #RubyOnRails
[23:38:21] greenride: Aeyrix: Ideally, I would like to serve the frontend from a different server/domain and get clean separation between angular and the Rails api.
[23:38:41] greenride: Aeyrix: Of course, there are CORS issues.
[23:39:26] Aeyrix: Jesus Christ
[23:39:43] Aeyrix: Okay I'm just going to stop and go do something more productive.
[23:39:43] greenride: Aeyrix: I believe the Angular rails gem sets the CSRF token in the initial delivery of the frontend. Then, the json POST request has the CSRF token to use.
[23:40:08] Aeyrix: greenride: yes, it does
[23:40:50] andersoldahl: has joined #RubyOnRails
[23:43:18] greenride: Aeyrix: Ari Lerner's book (https://leanpub.com/angularjs-rails) goes over the use of a separate nodejs server and rails api. However, he ignores the CSRF issue and turns it off. I was wondering if there was a way to make his approach work with CSRF protection.
[23:44:14] rdavila: has joined #RubyOnRails
[23:44:25] mloy: has joined #RubyOnRails
[23:44:34] Aeyrix: greenride: You seem to be throwing around these words without having any idea what they mean.
[23:44:46] greenride: Which words?
[23:45:28] mois3x: has joined #RubyOnRails
[23:45:57] greenride: What did I state that is incorrect?
[23:46:26] Aeyrix: >CORS issues
[23:46:31] Aeyrix: There really isn't, if you set the headers.
[23:47:30] Aeyrix: wow i didn't realise a friend of mine manages the freebsd postgresql port
[23:47:33] greenride: That's what I meant... CORS issues = headers need to be set. But, point noted, I should have been more precise there.
[23:47:34] Aeyrix: also totally wrong irc window
[23:47:47] Aeyrix: greenride: That's hardly an issue
[23:47:53] Aeyrix: that's approximately half a line in your nginx configuration
[23:48:53] greenride: issues can be small or big. But, agreed. The size of the issue wasn't clear from my comment.
[23:49:09] greenride: Or size of task.
[23:50:17] shmilan: has joined #RubyOnRails
[23:50:28] greenride: Aeyrix: Was the `wrong irc window` directed at me?
[23:50:32] Aeyrix: <greenride> issues can be small or big.
[23:50:39] Aeyrix: okay literally i'm stopping participating in this conversation
[23:50:40] Aeyrix: and no, it wasn't
[23:51:24] blackhuey: has joined #RubyOnRails
[23:51:56] FailBit: hey Aeyrix how's life going
[23:52:19] FailBit: also rhizome the import worked fine, doing some nice indexed querying now
[23:52:26] darrencauthon: has joined #RubyOnRails
[23:52:44] Aeyrix: FailBit: p gud
[23:52:48] Aeyrix: i am currently getting a 99c mousepad
[23:55:05] blackmesa: has joined #RubyOnRails
[23:57:25] quazimodo: has joined #RubyOnRails
[23:58:59] sevenseacat: has joined #RubyOnRails
[23:59:09] Aeyrix: hey sevenseacat :>
[23:59:10] willharrison: has joined #RubyOnRails
[23:59:44] framlinqp: has joined #RubyOnRails