« Back to channel list

#RubyOnRails - 29 March 2016

« Back 1 day Forward 1 day »
[00:00:32] georgedrummond: has joined #RubyOnRails
[00:00:54] Mattx: benlieb, how would that help me? it explicitly says I can't use namespaces
[00:01:06] manfrin: Ahhh -- so overriding delete/destroy works fine (leaves association intact), but the default_scope means that even with a belongs_to, it'll ignore the set association
[00:01:23] manfrin: solution is to just make the belongs_to use an unscoped scope
[00:01:24] cnk: excellent
[00:01:40] manfrin: I'm super happy that that was the issue
[00:01:45] Mattx: benlieb, using my example I would have to put this: get '/:controller', '???#handle'
[00:01:49] cnk: Great. And I learned somethig too
[00:01:55] manfrin: I was afraid I was going to have to intercept after_delete callbacks
[00:02:01] Mattx: but what goes in "???", I can't split the controller name
[00:02:48] keegnotrub: has joined #RubyOnRails
[00:02:52] one_zero: has joined #RubyOnRails
[00:03:08] manfrin: goddamn, I am happy that I'm at the point where when something goes awry in my development, I know rails well enough to just debug the formerly-known-as-magic
[00:03:18] manfrin: I am sad that ruby/rails use is in a decline
[00:03:21] manfrin: damn you javascript
[00:03:29] manfrin: rails is a wonderful framework
[00:04:05] manfrin: I blame hacker schools for churning out junior devs who don't know rails well enough to code performantly, leading to the 'rails is not scalable' meme
[00:04:27] manfrin: yeah, ruby is not as fast as js/scala/whatever, but well written ruby will work well for 99% of companies
[00:04:43] manfrin: you just have a billion n+1s written by junior devs with 3 months of experience
[00:05:19] manfrin: scale back the monorails, pull out the little parts that absolutely need to be megaperformant and make them services in go or whatever
[00:05:26] ryanwinchester: has joined #RubyOnRails
[00:05:37] manfrin: but continue to use the awesomeness that is activerecord and the beautiful isomorphic tools that rails provides
[00:05:50] manfrin: ACTION gushes about ruby
[00:06:18] manfrin: ah well -- I guess phoenix is our liferaft
[00:06:27] ryanwinchester: has left #RubyOnRails: ("Laters")
[00:06:40] manfrin: railsey framework with hip-new-llvm-language performance
[00:09:31] DoctorMonocular: has joined #RubyOnRails
[00:10:58] RegulationD: has joined #RubyOnRails
[00:11:05] xhoy: has joined #RubyOnRails
[00:18:11] tuelz1: has joined #RubyOnRails
[00:21:51] mwcmitchell: has joined #RubyOnRails
[00:25:21] Arcaire: Well, it helps that Phoenix is written in a language created for telecom providers.
[00:26:07] manfrin: also written by (former?) rails core people
[00:26:30] manfrin: phoenix is the rails of next gen
[00:26:42] manfrin: elixir/rust will schism the community a bit, but it's an evolution
[00:26:47] sudoubuntu: has joined #RubyOnRails
[00:26:58] Radar: did someone mention phoenix
[00:27:03] Arcaire: Rust doesn't really overlap with Ruby at all.
[00:27:17] manfrin: cnk in case you care for update: turns out it's a longstanding bug in rails 4 that it ignores descoping associations
[00:27:43] manfrin: yeah Arcaire -- but yehuda's evanglism is capturing some ruby people
[00:28:00] Arcaire: The language will not capture those used to Ruby.
[00:28:15] manfrin: I feel like Rust is for rubyists who want something much more rigid, and elixir/phoenix are for people who want a more performant rails
[00:29:02] _Tariq: has joined #RubyOnRails
[00:29:16] SteenJobs: has joined #RubyOnRails
[00:29:17] Ropeney: Rust does look really interesting
[00:29:36] yfeldblum: has joined #RubyOnRails
[00:30:13] Radar: manfrin: Do you know about the #elixir-lang channel yet?
[00:30:29] manfrin: no not yet; just tipping my toes in
[00:30:44] manfrin: we're building a new project at work, and people proposed elixir (unfortunately shot down), but it's piqued my interest
[00:30:55] manfrin: gonna build a tiny lil app in phoenix and react tonight
[00:31:01] baweaver: has joined #RubyOnRails
[00:31:11] Radar: TBH they're wrong about shooting down Elixir :D
[00:31:12] SteenJobs: hey friends - how can i create a form that essentially has two radio buttons - each corresponding to a different model - and a single submit button? basically when submit is pressed, the model object corresponding to the selected radio button should be created
[00:31:27] Radar: SteenJobs: Have you heard about .constantize?
[00:31:48] manfrin: yeah Radar -- i think everyone agrees it'd be cool to build, but our team is a lone ruby team in a sea of node/c# devs, so it was decided we needed to move towards the company, not further away :{
[00:32:24] Radar: manfrin: I'm sure there's a lot of companies out their hiring people to work on purely Ruby or Elixir teams ;)
[00:32:28] Arcaire: I told this guy I'm from London and now he thinks I'm *in* London
[00:32:29] manfrin: SteenJobs yeah, just make the radio button and in your controller check the returned value
[00:32:30] Arcaire: and I can't correct him
[00:32:44] Arcaire: I also put this in the wrong channel because I can't fuckin read.
[00:32:45] Radar: Arcaire: physically go visit him
[00:32:52] Arcaire: Radar: I can't do that either. I'm booking a gardener.
[00:33:01] Radar: Arcaire: lol
[00:33:01] SteenJobs: Radar: yea…but not sure exactly how that would help in this case…although i’m thinking
[00:33:03] manfrin: Radar I got golden comfort handcuffs, I like where I work and they pay me well and provide good snax and good commute and good wfh
[00:33:10] Radar: SteenJobs: so what's your questions then?
[00:33:13] Radar: manfrin: Oh yeah me too :)
[00:33:28] SteenJobs: Radar: generally when you create a form you specify the model the form corresponds to
[00:33:37] Scient: huehue, teams of node devs
[00:33:41] Radar: SteenJobs: Yes. You might then be looking for form_tag instead.
[00:33:42] Scient: creating one function npm packages
[00:33:45] Scient: and being all smug about it
[00:33:48] manfrin: a bunch of ex coworkers (from a previous company) are each starting their own things right now and I wanna join them but I like comfort ;_;
[00:34:15] manfrin: I miss the exciting world of startups
[00:34:16] Scient: "but these are building blocks!" - no, you turds, you should not be allowed to code.
[00:34:24] manfrin: lol Scient
[00:34:36] blindsight: has left #RubyOnRails: ("Mart Pessage")
[00:34:47] Scient: seriously I had no real opinion towards node before, I've used it, its cool in its own way, it has its place
[00:34:54] Scient: but lately ive been exposed to more and more node devs
[00:35:09] Scient: and ooooh boy have I been in a safe space before :P
[00:35:10] Arcaire: manfrin: Same w/r/t goldens.
[00:35:22] Arcaire: Scient: This is the safest space on Freenode.
[00:35:29] Arcaire: Oh you mean work-related.
[00:35:31] SteenJobs: Radar: but if my fields correspond to two different models, and they don’t both belong to some overarching model, i can’t use the form_for fields_for combo
[00:35:38] Radar: SteenJobs: !code
[00:35:38] helpa: SteenJobs: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[00:35:38] SteenJobs: aright i’ll look into form_tag
[00:35:44] SteenJobs: there’s no code to show
[00:35:51] SteenJobs: since there’s no code written
[00:36:05] Scient: seriously most people seem to be guys who are like "oh ive done a jQuery fadeout animation, NodeJS is also javascript, im a real programmer now!"
[00:36:05] SteenJobs: since the goal of my question is to figure out how to write said code
[00:36:06] manfrin: muddied around in startups for a while and had fun, but the moment I went to a real, established company I realized what I was missing, RSUs and nice pay and no sundaynight fire drills
[00:36:06] hxegon: has joined #RubyOnRails
[00:36:11] manfrin: RSUs are too nice
[00:36:36] manfrin: last startup: we'll give you 25k options!!! (worth 5k if the company ever actually goes public)
[00:36:50] manfrin: new company: here's 100k in stock, just stay here for a few years pls
[00:37:11] manfrin: new company: oh look, our stock has gone up 40%, welp enjoy your extra 40k
[00:37:21] Scient: man, noone even went along with my nodejs help, goddamnit
[00:37:25] Scient: not help, rant
[00:37:29] Scient: jesus... brain, wake up
[00:38:09] twilling: has joined #RubyOnRails
[00:43:50] allcentury: has joined #RubyOnRails
[00:45:10] Radar: Scient: I went along with it but I am staying silent.
[00:45:10] Ropeney: manfrin, Australia?
[00:45:26] Darmani: has joined #RubyOnRails
[00:45:33] Radar: manfrin: So you _were_ willing to relocate to SF? ;)
[00:45:42] manfrin: I'm native :}
[00:45:47] Darmani: Hey everyone.
[00:45:48] manfrin: 4th generation bay area
[00:46:00] manfrin: I am a paradox, a local *AND* a tech worker
[00:46:35] manfrin: I remember getting irrationally mad at an npr segment that I heard as I was driving to work about 'white male tech workers displacing oakland residents' when my grandma grew up in oakland
[00:46:37] hotpancakes: has joined #RubyOnRails
[00:46:50] manfrin: and the lady who was talking about how i was displacing people had just moved to the bay a year earlier
[00:46:59] manfrin: hypocrisy~
[00:47:24] Radar: It won't matter when SF gets swallowed by the sea after the earthquake.
[00:47:30] Radar: Oops left off #spoilers
[00:48:31] manfrin: sf will become an archipelago
[00:48:34] manfrin: buncha islands
[00:48:42] manfrin: I live in the east bay, on flatlands, I'm doomed
[00:48:54] manfrin: ACTION sets reminder to call contractor about putting house on stilts
[00:49:48] mwcmitchell: has joined #RubyOnRails
[00:51:02] xhoy: has joined #RubyOnRails
[00:55:07] chouhoulis: has joined #RubyOnRails
[00:59:07] benlieb: has joined #RubyOnRails
[00:59:32] mwcmitchell: has joined #RubyOnRails
[01:03:01] htmldrum: has joined #RubyOnRails
[01:03:01] htmldrum_: has joined #RubyOnRails
[01:03:10] Inside: has joined #RubyOnRails
[01:03:10] Inside: has joined #RubyOnRails
[01:03:38] existensil: has joined #RubyOnRails
[01:04:09] theblang: has joined #RubyOnRails
[01:04:24] sudoubuntu: has joined #RubyOnRails
[01:04:42] owenjones: has joined #RubyOnRails
[01:06:19] georgedrummond: has joined #RubyOnRails
[01:09:15] baweaver: manfrin: oh hai, more SF folks
[01:09:22] gabr13l: has joined #RubyOnRails
[01:09:23] baweaver: (East Bay - Dublin)
[01:09:37] daguilaraguilar: has joined #RubyOnRails
[01:09:44] mwcmitchell: has joined #RubyOnRails
[01:11:30] gabr13l: hello! I have a class lib/foo.rb and I put a test for it in test/unit_test.rb and it runs fine w/ `rake test test/unit/foo_test.rb`. However i don’t see an entry for ‘Unit’ in `rake stats`. Is `test/unit` the correct place to put that kind of test and are tests placed in test/unit accounted for in `rake stats` ? As always thanks!
[01:11:54] gabr13l: *put a test for it in test/unit/foo_test.rb (derp)
[01:12:57] mwcmitchell: has joined #RubyOnRails
[01:14:23] _Tariq: has joined #RubyOnRails
[01:14:48] FLeiXiuS`: has joined #RubyOnRails
[01:15:54] domgetter: has joined #RubyOnRails
[01:15:59] FLeiXiuS`: has joined #RubyOnRails
[01:17:15] sevenseacat: has joined #RubyOnRails
[01:17:55] mwcmitchell: has joined #RubyOnRails
[01:18:48] _Tariq: has joined #RubyOnRails
[01:20:01] pawnbox: has joined #RubyOnRails
[01:21:58] mwcmitchell: has joined #RubyOnRails
[01:25:04] owenjones: has joined #RubyOnRails
[01:25:41] _Tariq: has joined #RubyOnRails
[01:29:32] Rubie: has joined #RubyOnRails
[01:31:03] benlieb: has joined #RubyOnRails
[01:32:03] uglybandersnatch: has joined #RubyOnRails
[01:33:39] _Tariq: has joined #RubyOnRails
[01:35:49] mwcmitchell: has joined #RubyOnRails
[01:35:51] dtzuzu: has joined #RubyOnRails
[01:37:26] hxegon: has joined #RubyOnRails
[01:39:12] moeabdol: has joined #RubyOnRails
[01:47:38] SteenJobs: has joined #RubyOnRails
[01:48:01] mwcmitchell: has joined #RubyOnRails
[01:51:16] patrick_star_2: has joined #RubyOnRails
[01:52:56] yatish27: has joined #RubyOnRails
[01:53:38] paradisaeidae: has joined #RubyOnRails
[01:56:15] duncannz: has joined #RubyOnRails
[01:56:32] mwcmitchell: has joined #RubyOnRails
[02:06:27] jenrzzz: has joined #RubyOnRails
[02:07:28] mwcmitchell: has joined #RubyOnRails
[02:08:02] benlieb: has joined #RubyOnRails
[02:11:20] k1t: has joined #RubyOnRails
[02:12:23] RegulationD: has joined #RubyOnRails
[02:13:19] georgedrummond: has joined #RubyOnRails
[02:14:50] KensoDev: has joined #RubyOnRails
[02:17:58] sevenseacat: has joined #RubyOnRails
[02:24:47] mwcmitchell: has joined #RubyOnRails
[02:28:01] djbkd: has joined #RubyOnRails
[02:31:32] ZerGabriel: has joined #RubyOnRails
[02:32:08] ZerGabriel: has joined #RubyOnRails
[02:32:46] benlieb: has joined #RubyOnRails
[02:34:51] chagel: has joined #RubyOnRails
[02:38:33] Sadin: has joined #RubyOnRails
[02:40:02] Rubie: has joined #RubyOnRails
[02:40:32] Chagel_: has joined #RubyOnRails
[02:43:08] DragonPunch: has joined #RubyOnRails
[02:46:01] daguilaraguilar: has joined #RubyOnRails
[02:46:50] Dopagod: has joined #RubyOnRails
[02:49:41] pawnbox: has joined #RubyOnRails
[02:52:52] mwcmitchell: has joined #RubyOnRails
[02:57:28] chipotle: has joined #RubyOnRails
[03:03:19] fedexo: has joined #RubyOnRails
[03:04:43] bronson: has joined #RubyOnRails
[03:06:42] hotpancakes: has joined #RubyOnRails
[03:11:05] Darmani: Radar: Good sir?
[03:11:11] Radar: Darmani: hi
[03:11:26] Darmani: Hey, quick question.
[03:12:35] Darmani: Radar: Shit better yet, let me put this on Github
[03:12:43] Darmani: because I know that's what your going to say next -__-
[03:13:19] sevenseacat: Radar: it's working!
[03:13:23] joshhbk: has joined #RubyOnRails
[03:13:52] Radar: appears so
[03:14:27] hamlover69: has joined #RubyOnRails
[03:14:43] Radar: Darmani: you're*
[03:14:44] jkahn: has joined #RubyOnRails
[03:15:35] Darmani: Radar: Lol I didn't know you were a Grammar Nazi.
[03:15:45] sudoubuntu: has joined #RubyOnRails
[03:16:33] Radar: Darmani: Comes with the "Author" skilltree.
[03:17:01] sevenseacat: ACTION puts all points in that skill tree
[03:17:07] Darmani: Radar: That's part of the DLC right? I'm too poor for that shit =P
[03:18:25] hamlover69: How can I grab a URL being passed within another URL and provide a link to it? i have users coming in to my page with " /interstitial?desired_url=http%3A%2F%2Fwww.google.com " how can I grab the desired_url and put it into a link_to?
[03:18:30] hamlover69: is that even possibru? I'm a rails noob
[03:19:02] chagel: has joined #RubyOnRails
[03:19:12] sevenseacat: sure, the desired URL would be accessible via params[:desired_url]
[03:19:33] pawnbox: has joined #RubyOnRails
[03:19:41] braincrash: has joined #RubyOnRails
[03:20:40] hamlover69: Wow it was that easy
[03:20:46] hamlover69: Thanks a lot sevenseacat
[03:20:49] tuelz1: has joined #RubyOnRails
[03:26:25] Darmani: Radar: git add . << -- That adds all the files within the directory right?
[03:33:19] davee_: has joined #RubyOnRails
[03:33:38] htmldrum: has joined #RubyOnRails
[03:33:39] htmldrum_: has joined #RubyOnRails
[03:37:21] Radar: Darmani: Yes
[03:42:12] djbkd: has joined #RubyOnRails
[03:43:41] esclavodeltikita: has joined #RubyOnRails
[03:44:42] Darmani: Radar: It's finally done. I don't think I did it right but ehh, it's up there either way.
[03:44:48] Radar: Darmani: linky link?
[03:44:57] Darmani: https://github.com/mfifth/ticketee_project/tree/nested_resources
[03:45:01] sneakerhax: has joined #RubyOnRails
[03:45:14] Radar: Ok. What seems to be the problem?
[03:45:51] Spami: has joined #RubyOnRails
[03:46:27] Darmani: Where are the validation errors supposed to show up?
[03:46:55] sevenseacat: inline on the fields, which it looks like they do.
[03:47:18] Radar: Darmani: You have a conflict in your Gemfile. Fix that please.
[03:47:32] quazimodo: can we pass a block to Object.new?
[03:47:47] sevenseacat: quazimodo: !try
[03:47:47] helpa: quazimodo: Why don't you try it and find out for yourself?
[03:47:49] Darmani: Radar: I do
[03:47:54] Radar: Darmani: Look for <<<<<
[03:48:02] Radar: Darmani: line 26
[03:48:11] GnuYawk: has joined #RubyOnRails
[03:48:27] Radar: And another furrther now
[03:48:55] Radar: This is what it should look like: https://gist.github.com/radar/8aa273ad28a51dd81399
[03:49:26] pawnbox: has joined #RubyOnRails
[03:49:26] Darmani: Okay I'll fix that, can you show me where my validations show up? I don't remember where I put them.
[03:49:34] Radar: Your Gemfile.lock is also screwed. After fixing these conflicts, delete that Gemfile.lock file and then run `bundle install`. Make another commit.
[03:49:53] Radar: Actually, this whole project is full of conflicts.
[03:49:56] Radar: You will need to fix them up.
[03:50:09] Radar: 25 at my count
[03:50:13] quazimodo: sevenseacat: did try, it didn't complain. Still, curious if this sort of programming is possible https://gist.github.com/siassaj/618e3230f713fb1fc26d
[03:50:22] GnuYawk: Is there an equivalent for attr_accessible in Rails 5?
[03:50:22] Darmani: Radar: Lol...
[03:50:30] Radar: Darmani: Can't look until that's all fixed.
[03:50:35] quazimodo: my first example is wrong, as i just discovered
[03:50:40] johnflux: has joined #RubyOnRails
[03:50:47] Darmani: Radar: Right well.. thanks..
[03:50:49] sevenseacat: GnuYawk: use strong_parameters, just like in rails 4.
[03:50:54] sevenseacat: Darmani: what problem are you having?
[03:51:13] quazimodo: I'm going to ask in #Ruby too
[03:51:20] sevenseacat: quazimodo: good idea.
[03:51:43] Darmani: sevenseacat: I don't have anything specific. I just don't remember where I put the errors for my validations. I would usually put them in the view but I don't see them there.
[03:51:56] sevenseacat: you didnt put them anywhere, they're part of simple_form.
[03:51:57] GnuYawk: sevenseacat: Maybe attr_accessible isn't want im looking for. My model has a has_many relationship, and I want to actually see that that's a possible attribute when I do something like Model.first
[03:52:07] sevenseacat: inline on the fields that have errors
[03:52:27] GnuYawk: All it shows is "id, created_at", "updated_at"
[03:52:54] Darmani: sevenseacat: Oh that gem takes care of that for you too??
[03:52:57] Darmani: That's awesome.
[03:53:00] sevenseacat: Darmani: see page 115
[03:54:12] Radar: GnuYawk: !rule10
[03:54:12] helpa: GnuYawk: Do not beg / plead with people to help you. This includes asking questions like "Any ideas?" after posting your original question.
[03:54:50] sevenseacat: you could check if the object responds to that method, but i dont know how that would be helpful
[03:56:05] GnuYawk: Well I'm passing Model.all into a react component using react_rails, and react doesn't see the has_many relationship because the attribute isn't exposed
[03:56:41] Radar: It's not an attribute. You will need to convert that into an array and explicitly pull out the association if you want to pass the whole chunk to React.
[03:57:02] GnuYawk: Damn, that's pretty stupid honestly
[03:57:56] Radar: opinions served hot. Get your opinions today
[03:58:55] Radar: Source: I am using React in a Rails app and winning at life essentially.
[03:59:15] Arcaire: that's PRETTY STUPID honestly
[03:59:22] Darmani: sevenseacat: Okay so my validation isn't passing for some reason? It's defined within the model but it's doesn't work..
[03:59:31] Arcaire: Source: I've never used react properly and my opinion is not based on FACTS
[03:59:43] GnuYawk: Are you crying or something? Calm down
[03:59:43] Arcaire: I still like my non-SPAs.
[03:59:56] Radar: not sure if the comment was that the suggestion was "dumb and how dare I suggest it" or "wow how come I didn't think of that before?"
[04:00:07] sevenseacat: Darmani: 'it doesnt work' isnt something i can fix with so little info
[04:00:19] Radar: Darmani: Fix the conflicts and then we can look at the app.
[04:00:22] Darmani: sevenseacat: But you're sevenseacat! lol =P
[04:00:36] Arcaire: therefore, you're magic
[04:00:43] GnuYawk: I wasn't saying the solution was stupid, I was saying it's stupid how that's the only way you can pass a model's relationship to a component
[04:00:47] sevenseacat: ACTION is a unicorn
[04:01:07] Radar: GnuYawk: Patches welcome to react_rails, I reckon
[04:01:08] Darmani: Radar: I don't know what conflicts those are dude... You just saw 30 errors and expect me to know what they are and how to fix them?
[04:01:27] Radar: Darmani: Sorry, they're git conflicts. Look for "<<<<" in your project.
[04:02:08] Darmani: Radar: Git conflicts? o.o
[04:02:11] Radar: https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging#Basic-Merge-Conflicts
[04:02:26] Radar: Except their tags there are showing as &lt; ... which is <<<
[04:02:29] Radar: Well, one <
[04:02:36] neilfse: has joined #RubyOnRails
[04:02:45] bronson: has joined #RubyOnRails
[04:02:56] n1lo: has joined #RubyOnRails
[04:03:24] sevenseacat: if you want us to actually look at your app to fix errors, the app has to be in a runnable state
[04:03:40] sevenseacat: otherwise, you need to explain better what the problem is, possibly with relevant code snippets
[04:04:08] Darmani: Well I hate Git. I hate it.
[04:04:16] GnuYawk: Just use BZR, problem solved
[04:04:17] Radar: No need for that.
[04:04:20] rubyonrailed: has joined #RubyOnRails
[04:04:27] Radar: Darmani: Here's an example from app/views/projects/new.html.erb: https://gist.github.com/radar/73d627ac173a85c4aa1f
[04:04:40] Radar: Darmani: The "conflict" there is everything between <<<<<<< and >>>>>>>>.
[04:04:50] Radar: Darmani: There are two parts to the conflict. "HEAD" and "Nested Resources..."
[04:05:05] Radar: Darmani: Git wasn't able to figure out which one is the "right" one, so it's left both of them in the file and then it's asked you to fix it.
[04:05:31] Radar: Darmani: So you need to go through each file where it has these conflicts, pick the right one (probably the "Nested Resources" one) and remove any conflict markers (<<<< or >>>>)
[04:06:17] Darmani: Radar: But I didn't get any errors when I uploaded this as another branch...
[04:06:29] Radar: Darmani: This is the other branch. There are conflicts here. I don't know how they came to me.
[04:06:36] bronson: has joined #RubyOnRails
[04:06:46] Radar: It's your repo. You are the best person to fix this.
[04:07:07] Darmani: Like I said. I hate it.
[04:07:15] Darmani: But okay. i'll try.
[04:07:25] Darmani: Or I'll just delete the whole goddamn thing and reupload it.
[04:08:06] Radar: I reckon you can fix it yourself in 15 minutes.
[04:08:34] roshanavand: has joined #RubyOnRails
[04:08:44] Darmani: Radar: If I was you I probably could.
[04:08:44] Palsson: has joined #RubyOnRails
[04:08:47] Darmani: But I'm me. Lol
[04:08:59] Radar: Darmani: I believe you can do it if you just try :)
[04:09:17] Radar: Darmani: If you fix these things then sevenseacat and/or myself will look at this app.
[04:09:23] _Tariq: has joined #RubyOnRails
[04:09:28] sevenseacat: ACTION thumbs up
[04:09:50] GnuYawk: delete the repo and reupload, who even cares
[04:09:52] Darmani: I just wanted to know where my goddamn validations were showing up lmaoooooo
[04:10:05] Radar: Darmani: You will know after 15 mins of clearing these validations.
[04:10:40] sevenseacat: Darmani: https://ticketee-mfifth.c9users.io/projects/new submit form. see errors.
[04:10:49] Radar: +q Darmani!*@*
[04:10:52] Radar: Your time starts... now.
[04:11:24] Radar: less qq more pew pew is what I say
[04:11:29] Arcaire: But I'm from England
[04:11:36] Arcaire: I only do the latter if I spend a good deal of time doing the former.
[04:11:48] Radar: ACTION is the same
[04:12:41] Devalo: has joined #RubyOnRails
[04:13:15] RegulationD: has joined #RubyOnRails
[04:16:34] roshanavand: has joined #RubyOnRails
[04:17:25] _Tariq: has joined #RubyOnRails
[04:18:02] chipotle: has joined #RubyOnRails
[04:20:10] hxegon: has joined #RubyOnRails
[04:20:24] pawnbox: has joined #RubyOnRails
[04:21:30] _Tariq: has joined #RubyOnRails
[04:21:57] jenrzzz: has joined #RubyOnRails
[04:22:00] n1lo: has joined #RubyOnRails
[04:22:38] Radar: -q Darmani!*@*
[04:22:43] Radar: Darmani: wb. 4 mins early. All done?
[04:23:06] Darmani: You aren't going to be happy.
[04:23:19] Radar: I will eventually be happy/
[04:23:37] Darmani: I deleted the repo.
[04:23:51] sevenseacat: thats one way to fix things
[04:24:05] Darmani: I'm really not even sure how I was supposed to make the corrections, it seemed like I couldn't edit the files.
[04:24:06] Radar: Darmani: Ok, and you're starting a fresh?
[04:24:19] Radar: Darmani: On your local machine you can edit the files. I use Sublime Text 3 in mine.
[04:24:27] sevenseacat: theyre using cloud9.
[04:24:59] Darmani: yeah I'm starting fresh. Just going to upload the latest version of the project right now.
[04:25:16] sevenseacat: if you havent fixed the conflicts, i dont know how thats going to affect anything
[04:25:19] sevenseacat: but we'll see
[04:26:55] Radar: I'd like an app that I can clone, run `bundle install` then run `bundle exec rspec spec` and have a test which breaks
[04:26:56] Darmani: sevenseacat: Assume that I have no knowledge of what you're talking about and that I'm a six year old toddler that needs things explained in that way.
[04:27:00] Radar: That's like the golden egg for me
[04:27:06] Radar: If you have an app which doesn't have a test, that's OK too.
[04:28:08] sevenseacat: Darmani: okay. you have a problem you want help with. we can offer that help because we wrote the book that is giving you the problem. we need to know what the problem is, so we can help you with it.
[04:28:09] Radar: As long as there's a runnable app with no conflicts that has an issue that I can repro.
[04:29:29] Darmani: sevenseacat: I'll tell you as soon as I upload the code again.
[04:31:12] b2zeldafreak: has joined #RubyOnRails
[04:32:04] Darmani: Radar: I typed in something called rebase from the command line?
[04:32:08] Darmani: Now I can't do anything.
[04:32:16] Darmani: ACTION is frustrated.
[04:32:41] Radar: Darmani: What was the exact command you typed?
[04:33:28] Darmani: git rebase... something.
[04:33:53] Radar: Darmani: ... I want the exact command. Don't you have it in your history?
[04:34:05] Radar: "git rebase abort" will probably get you out of this mess now.
[04:34:11] Darmani: I closed the Terminal thinking it would reset whatever I had typed in :[
[04:34:30] Darmani: yeah that did it.
[04:35:18] SeductiveError: has joined #RubyOnRails
[04:38:17] Rubie: has joined #RubyOnRails
[04:40:18] Darmani: Radar: How do I delete all records of my old repo? Everything still seems to be linked to the url that doesn't exist.
[04:40:57] Radar: Darmani: Where?
[04:41:19] Darmani: I'm trying to switch to the new repo from the command line. I dunno how.
[04:41:49] SeductiveError: design question. I want to create a dashboard panel with a sidebar with links to other pages, and I'm split between using a controller for each linked page ( for example "home"), or a single dashboard controller with ajax calls to refresh page layout. Which would be preferred, or is there an even better method?
[04:43:08] pawnbox: has joined #RubyOnRails
[04:43:40] w0rd-driven: has joined #RubyOnRails
[04:45:36] brentw: has joined #RubyOnRails
[04:47:01] beauby: has joined #RubyOnRails
[04:49:57] hightower2: has joined #RubyOnRails
[04:52:43] Arcaire: SeductiveError: Multiple controllers with ajax calls to refresh page layout.
[04:52:46] Arcaire: Keep your code clean.
[04:55:43] mmhan: has joined #RubyOnRails
[04:56:38] hotpancakes: has joined #RubyOnRails
[04:57:33] jkahn: has joined #RubyOnRails
[05:03:38] merida: has joined #RubyOnRails
[05:07:23] p8m: has joined #RubyOnRails
[05:07:29] hotpancakes: has joined #RubyOnRails
[05:09:03] arup_r: has joined #RubyOnRails
[05:11:26] Devalo: has joined #RubyOnRails
[05:11:56] beauby: has joined #RubyOnRails
[05:12:06] Palsson: has joined #RubyOnRails
[05:14:18] pawnbox_: has joined #RubyOnRails
[05:22:14] tuelz1: has joined #RubyOnRails
[05:26:52] chagel: has joined #RubyOnRails
[05:28:27] yfeldblum: has joined #RubyOnRails
[05:31:22] krz: has joined #RubyOnRails
[05:36:35] beauby: has joined #RubyOnRails
[05:37:44] Chagel_: has joined #RubyOnRails
[05:41:37] ayonkhan: has joined #RubyOnRails
[05:43:53] Cohedrin: has joined #RubyOnRails
[05:43:56] artto: has joined #RubyOnRails
[05:44:07] User458764: has joined #RubyOnRails
[05:47:47] chagel: has joined #RubyOnRails
[05:48:41] aganov: has joined #RubyOnRails
[05:51:39] Devalo: has joined #RubyOnRails
[05:52:22] Rubie: has joined #RubyOnRails
[05:52:28] tildes: has joined #RubyOnRails
[05:56:44] arup_r: haha.. what a seductive nick you used.. :p
[05:58:44] mwlang: I need a Danish and English version of an email template. I don’t want to shove the whole email contents into lcoale files, but that’s the way every “how-to” I’ve looked at so far does it.
[05:58:53] mwlang: surely I can do something like signup_email.en.haml or signup_email_da.haml, etc.
[05:59:46] sevenseacat: you sure can put the locale as part of the file name
[06:00:23] sevenseacat: http://guides.rubyonrails.org/i18n.html#localized-views
[06:04:30] mwlang: hmmm…let’s see what I’m doing wrong then…I called my plain text view signup.en.text
[06:04:39] arup_r: has joined #RubyOnRails
[06:04:48] mwlang: but I guess I need to tack on the erb.
[06:05:50] sevenseacat: i presume you need at least one processor
[06:06:57] SeductiveError: arcaire would you say this applies to not CRUD controllers as well?
[06:07:07] merida: has joined #RubyOnRails
[06:07:35] hotpancakes: has joined #RubyOnRails
[06:11:49] bronson: has joined #RubyOnRails
[06:12:18] eyeamaye: has joined #RubyOnRails
[06:13:45] comrad: has joined #RubyOnRails
[06:14:06] rodfersou: has joined #RubyOnRails
[06:19:10] mwlang: ah, figured it out.
[06:19:24] mwlang: default language was Danish and I had only created English template.
[06:19:45] beauby: has joined #RubyOnRails
[06:21:19] mwlang: actually, this brings up an interesting twist. A lot of these emails are going to go to the user in either English or Danish, depending on their locales…but emails to the site administrators need to always go as Danish regardless of user’s locale setting at the time the delivery is triggered.
[06:22:50] mwlang: what’s the smart way to handle this? I’m reluctant to set I18n.locale = :da and then deliver on the site admin emails for concern of forgetting to revert i18n.locale back to user’s preferred for subsequent messages that might come after.
[06:22:51] sandstrom: has joined #RubyOnRails
[06:23:07] darutoko: has joined #RubyOnRails
[06:24:02] mwlang: I suppose I could do it block-style where locale’s set and restored around the actual render and delivery calls
[06:24:42] hotpancakes: has joined #RubyOnRails
[06:25:13] brt: has joined #RubyOnRails
[06:25:37] artto: has joined #RubyOnRails
[06:26:05] lele: has joined #RubyOnRails
[06:27:40] ur5us: has joined #RubyOnRails
[06:27:57] bronson: has joined #RubyOnRails
[06:30:48] baweaver: has joined #RubyOnRails
[06:31:15] arup_r: mwlang: Are you saving the user local settings in DB and also the role of the user? Like in a user profile page or settings page..
[06:31:53] mwlang: arup_r: yes.
[06:32:54] mwlang: arup_r: already figured out a strategy…going with wrapping such emails in blocks. send_danish { mail.deliver }
[06:33:20] mwlang: succinct and intent is very clear.
[06:33:43] arup_r: ok, so in `send_danish` you will be setting the locale right?
[06:34:04] mwlang: now that I think about it, I’ll want an ensure block to guarantee locale reset back to user’s locale.
[06:34:42] arup_r: mwlang: use `ensure` to do that :)
[06:36:01] kirillzh: has joined #RubyOnRails
[06:37:51] mwlang: what a marathon day, but a good one! I’m off to bed. thanks for everyone’s help — even the silent room was helpful (just asking the questions led to the answers!) :-)
[06:38:04] DragonPunch: has joined #RubyOnRails
[06:38:19] Pazician: has joined #RubyOnRails
[06:39:21] gingray: has joined #RubyOnRails
[06:40:31] arup_r: mwlang: good night!
[06:40:42] User458764: has joined #RubyOnRails
[06:44:49] lyoshajapan: has joined #RubyOnRails
[06:46:00] lyoshajapan: Hey, I got a tricky question. Lets say you're testing with Selenium, and you need to mock time for a javascript object (timecop doesnt work for this), how would you trick the jvm inside seleium to think that the time is different?
[06:47:03] beauby: has joined #RubyOnRails
[06:47:08] sevenseacat: i'd write javascript tests, not selenium tests
[06:50:02] apotry: has joined #RubyOnRails
[06:53:50] differentreality: has joined #RubyOnRails
[06:54:27] zave: has joined #RubyOnRails
[06:54:36] htmldrum: has joined #RubyOnRails
[06:54:37] htmldrum_: has joined #RubyOnRails
[06:54:47] scepticulous: has joined #RubyOnRails
[06:56:28] apotry: has joined #RubyOnRails
[06:57:18] mfaeh: has joined #RubyOnRails
[06:59:55] delgiudices: has joined #RubyOnRails
[07:00:10] DoubleMalt: has joined #RubyOnRails
[07:00:50] techsethi: has joined #RubyOnRails
[07:01:43] netzfisch: has joined #RubyOnRails
[07:02:17] valetudo: has joined #RubyOnRails
[07:06:08] hotpancakes: has joined #RubyOnRails
[07:06:58] ql6wlld: has joined #RubyOnRails
[07:07:13] merida: has joined #RubyOnRails
[07:08:06] SteenJobs: has joined #RubyOnRails
[07:08:55] djellemah_: has joined #RubyOnRails
[07:11:04] lyoshajapan: has joined #RubyOnRails
[07:12:43] AlexJakeGreen: has joined #RubyOnRails
[07:12:52] agit0: has joined #RubyOnRails
[07:13:39] lyoshajapan: sevenseacat: thanks for the reply, but I'm not very familiar with js tests. Also, it seems like it would be overkill adding js testing just to test 1 widget
[07:16:32] bronson: has joined #RubyOnRails
[07:20:03] beauby: has joined #RubyOnRails
[07:22:11] dtzuzu: has joined #RubyOnRails
[07:22:59] arBmind: has joined #RubyOnRails
[07:23:30] delgiudices: has joined #RubyOnRails
[07:23:33] njero: has joined #RubyOnRails
[07:24:07] hotpancakes: has joined #RubyOnRails
[07:24:39] mark2: has joined #RubyOnRails
[07:25:05] merida: has joined #RubyOnRails
[07:25:19] bronson: has joined #RubyOnRails
[07:29:50] sandstrom: has joined #RubyOnRails
[07:31:05] AimlessRAven: has joined #RubyOnRails
[07:31:18] AimlessRAven: how to set here %li{"data-thumb" => "/assets/shop/top1-1-90x114.jpg"} image path to @product.image.file.gallery for example
[07:31:30] AimlessRAven: i dont wanna create image_tag, i just want to set image path
[07:31:38] sevenseacat: AimlessRaven: didnt you ask that a hundred times the other day?
[07:31:44] sevenseacat: replace one path with another path.
[07:31:50] sevenseacat: this is not rocket science.
[07:31:56] djellemah: has joined #RubyOnRails
[07:36:18] AimlessRAven: sevenseacat:, dont work, ok look here https://gist.github.com/anonymous/41f7d06da7e865fb4a48
[07:36:31] AimlessRAven: i need to replace this img paths.. with my @product.image.gallery.path
[07:36:38] sevenseacat: so replace it
[07:36:43] sevenseacat: what problem do you get from doing so?
[07:37:45] AimlessRAven: my img is not show
[07:37:46] AimlessRAven: %img{:alt => "Top Fancy", :src => @product.image.file.gallery.path}
[07:39:03] sevenseacat: so what is @product.image.file.gallery.path ?
[07:40:07] AimlessRAven: my product image, i need to set path to @product.image.. not image_tag
[07:41:08] sevenseacat: no, what is the value of it
[07:41:12] sevenseacat: because obviously its not the path of an image
[07:41:13] ausum_possum: has joined #RubyOnRails
[07:41:16] sevenseacat: otherwise the image would show
[07:41:29] sevenseacat: personally I would use image_tag for the whole line
[07:41:38] sevenseacat: that's kinda the point of it
[07:42:25] Megamos: has joined #RubyOnRails
[07:43:10] uglybandersnatch: has joined #RubyOnRails
[07:43:12] futilegames: has joined #RubyOnRails
[07:43:40] AimlessRAven: sevenseacat: (y)
[07:43:40] bronson: has joined #RubyOnRails
[07:51:51] ZerGabriel: has joined #RubyOnRails
[07:53:02] rubyonrailed: has joined #RubyOnRails
[07:53:05] edwinvdgraaf: has joined #RubyOnRails
[07:56:06] yfeldblum: has joined #RubyOnRails
[08:03:40] mmhan: has joined #RubyOnRails
[08:04:40] pawnbox: has joined #RubyOnRails
[08:05:33] hotpancakes: has joined #RubyOnRails
[08:07:30] jsrn: has joined #RubyOnRails
[08:07:36] jenrzzz: has joined #RubyOnRails
[08:08:46] n008f4g_: has joined #RubyOnRails
[08:11:37] tribals: has joined #RubyOnRails
[08:20:07] artto: has joined #RubyOnRails
[08:23:26] AnoHito: has joined #RubyOnRails
[08:24:41] jenrzzz: has joined #RubyOnRails
[08:24:45] tuelz1: has joined #RubyOnRails
[08:25:02] monoprotic: has joined #RubyOnRails
[08:25:02] monoprotic: has joined #RubyOnRails
[08:25:22] tfitts: has joined #RubyOnRails
[08:27:31] merida: has joined #RubyOnRails
[08:27:42] mdw: has joined #RubyOnRails
[08:27:48] tribals: i'm very annoyed by rails templating system. even now i don't saw a rails project with effective and maintainable layouts. Yes, there is partials, different layouts, like `render :something, layout: :otherlayout`, but it's not enough. even if i switch layout, i use same partials anyway. if i need a small change in main layout (for example, brand zone in whatever e-store), i must also change partials (and possible break something currently worked), or
[08:27:48] tribals: copy-paste all set of them (and completely fuck DRY out). templates and controllers dramatically coupled in rails, and it's a pain for me to maintain templates.
[08:28:12] dionysus69: has joined #RubyOnRails
[08:28:13] skislak: has joined #RubyOnRails
[08:28:41] Nuck: has joined #RubyOnRails
[08:28:43] mdw7: has joined #RubyOnRails
[08:29:46] tribals: is there a better, concise way to write decoupled, reusable templates in rails? may be i do something wrong? how you write your layouts?
[08:30:14] SeductiveError: has joined #RubyOnRails
[08:30:49] htmldrum: has joined #RubyOnRails
[08:30:50] htmldrum_: has joined #RubyOnRails
[08:31:11] ur5us: has joined #RubyOnRails
[08:31:21] sevenseacat: templates arent likely to be reusable. partials are.
[08:31:36] srinidhi: has joined #RubyOnRails
[08:31:39] sevenseacat: lets zero in on your example - you change a brand zone, like a logo, and that breaks the whole page?
[08:32:49] tribals: sevenseacat: logo is very simple example that never meet in real-life development
[08:33:00] sevenseacat: let's talk about real-life development problems then
[08:33:14] tribals: let's zero in example deeper
[08:33:29] tribals: (yes, it's also real-life problem)
[08:33:30] atzorvas: has joined #RubyOnRails
[08:33:57] sevenseacat: okay. please share some example code that is causing you problems.
[08:34:17] tribals: just minute, i draw some ascii-art schema
[08:34:38] crankharder: has joined #RubyOnRails
[08:34:42] tribals: which pastebin to use?
[08:35:20] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[08:35:28] sevenseacat: which is listed in the channel rules.
[08:35:33] NuckingFuts: has joined #RubyOnRails
[08:36:08] jonee: has joined #RubyOnRails
[08:36:19] mozzarella: has joined #RubyOnRails
[08:37:09] blackmesa: has joined #RubyOnRails
[08:37:33] theod: has joined #RubyOnRails
[08:38:30] defsdoor: has joined #RubyOnRails
[08:40:10] tribals: https://gist.github.com/tribals/213125f961c4b1c09060
[08:40:13] blackhuey: has joined #RubyOnRails
[08:40:56] sevenseacat: well that's... not useful.
[08:41:07] lyoshajapan: has joined #RubyOnRails
[08:41:31] mmhan: has joined #RubyOnRails
[08:41:44] tribals: yes... i don't now why i think is can be useful
[08:42:15] tribals: no matter, sory
[08:43:50] Irikos: has joined #RubyOnRails
[08:44:24] neanderslob_: has joined #RubyOnRails
[08:44:49] M-shine: has joined #RubyOnRails
[08:45:09] hotpancakes: has joined #RubyOnRails
[08:46:26] defsdoor: are there any hooks on a accepts_nested_attributes assignment that expose the parent ?
[08:46:45] defsdoor: reject_if seems to be a blank reference
[08:49:56] tribals: assume that we've a partial `header`, which shares common page header (not `<head>`), and it even is adapted to be easily-switchable his layout. elements in it properly classified by `class`, and can be easily switch their design through just assigning additional class to them. but i must have some logic in, wait, my view(???) to check some variables and add or not add some classes to html elements. it is a problem, if i use just controller action vi
[08:49:56] tribals: ews, it's a bigger problem if i start use partials because i must explicitly pass some parameters to them. things goes to be more complicated because i cannot use controller variables in layouts, in which partials usually included.
[08:50:16] sevenseacat: tribals: can you show some example code that is causing you problems?
[08:50:41] tribals: sevenseacat: i'm not sure about that
[08:51:02] sevenseacat: its hard to help you figure out your problems if you can't demonstrate what they are.
[08:53:09] ferr: has joined #RubyOnRails
[08:55:05] tribals: sevenseacat: i know. i'll try to quickly build some example project that reproduce a problem that i faced. i'll try to do that as quick as possible, but can do it tonight only, or yet tomorrow
[08:55:35] dgncn: has joined #RubyOnRails
[08:55:39] sevenseacat: ah right, i assumed you would have something ready to go, given you came in ranting :P
[09:01:21] tribals: sevenseacat: i have, but i can not just show you sources
[09:07:57] boontdustie: has joined #RubyOnRails
[09:10:43] arBmind: has joined #RubyOnRails
[09:11:49] fryguy: has joined #RubyOnRails
[09:13:37] futilegames: has joined #RubyOnRails
[09:17:59] Klumben: has joined #RubyOnRails
[09:18:44] workmad3: has joined #RubyOnRails
[09:24:58] hotpancakes: has joined #RubyOnRails
[09:25:09] moep: has joined #RubyOnRails
[09:26:30] lxsameer: has joined #RubyOnRails
[09:28:19] fexilal: has joined #RubyOnRails
[09:29:17] Spami: has joined #RubyOnRails
[09:29:58] arBmind: has joined #RubyOnRails
[09:34:00] PaulePanter: Hi. Some robots (Mozilla/5.0 (compatible; SEOkicks-Robot; +http://www.seokicks.de/robot.html)) do requests with HTTP accept for `text/plain`.KI see requests with a format
[09:34:11] PaulePanter: (Scratch the last part after the .)
[09:34:29] delgiudices: has joined #RubyOnRails
[09:34:38] PaulePanter: How do you deal with that. As far as I know, `text/html` is what Web applications normally do.
[09:35:04] srinidhi: has joined #RubyOnRails
[09:35:42] sevenseacat: unless you have a plain text version of your site, in which case, it should work fine
[09:37:56] TinkerTyper: has joined #RubyOnRails
[09:38:12] jyraff: has joined #RubyOnRails
[09:38:34] kies: has joined #RubyOnRails
[09:38:49] stannard: has joined #RubyOnRails
[09:39:41] M-shine: has joined #RubyOnRails
[09:41:36] rubyonrailed: has joined #RubyOnRails
[09:42:17] snowy: has joined #RubyOnRails
[09:44:33] Megamos: has joined #RubyOnRails
[09:46:13] delgiudices: has joined #RubyOnRails
[09:46:14] marr: has joined #RubyOnRails
[09:47:03] dtzuzu: has joined #RubyOnRails
[09:47:32] Irikos: has joined #RubyOnRails
[09:48:46] baweaver: has joined #RubyOnRails
[09:49:39] AimlessRAven: has joined #RubyOnRails
[09:50:00] AimlessRAven: how to trigger facebook share on my custom button
[09:50:30] sevenseacat: AimlessRaven: what have you tried?
[09:50:58] lxsameer: has joined #RubyOnRails
[09:50:58] lxsameer: has joined #RubyOnRails
[09:51:05] AimlessRAven: i create custom button, and onclick find .fb-like and use .click() but dont work
[09:51:41] sevenseacat: and what does 'dont work' mean?
[09:51:44] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[09:54:35] davidblko: has joined #RubyOnRails
[10:03:16] AimlessRAven: https://gist.github.com/anonymous/60b109ebd8fcf39f43e0
[10:03:42] AimlessRAven: i want when i click my a.facebook, to active fb share function
[10:03:52] pawnbox: has joined #RubyOnRails
[10:03:54] sevenseacat: thats not valid HTML
[10:04:00] sevenseacat: you have a div in the middle of a list
[10:04:18] sevenseacat: and the a.facebook is totally separate from the .fb-like div
[10:04:53] AimlessRAven: i connect them
[10:05:18] PaulePanter: sevenseacat: But how do you ignore them?
[10:05:21] sevenseacat: can you show the updated code then?
[10:05:38] sevenseacat: PaulePanter: by not handling them?
[10:05:40] AimlessRAven: https://gist.github.com/anonymous/5817707085dfd209dff8
[10:05:49] PaulePanter: sevenseacat: The exception is `An ActionView::MissingTemplate occurred in application#index:
[10:05:50] sevenseacat: PaulePanter: if they want to get 404 errors, best of luck to them
[10:06:02] sevenseacat: PaulePanter: !debug
[10:06:02] helpa: PaulePanter: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[10:06:19] hotpancakes: has joined #RubyOnRails
[10:06:37] PaulePanter: sevenseacat: Sorry. I’ll look into it again, and provide the code if I’m stuck.
[10:07:09] sevenseacat: AimlessRaven: ok, so you have a div somewhere on your page, then another list of social links elsewhere, and somehow clicking a link is supposed to do something with the div?
[10:07:33] sevenseacat: i suggest you read through the facebook docs on this
[10:08:47] AimlessRAven: sevenseacat: i do it ;)
[10:09:18] mfaeh: has joined #RubyOnRails
[10:09:18] chipotle: has joined #RubyOnRails
[10:18:37] roshanavand: has joined #RubyOnRails
[10:18:39] iuuso: has joined #RubyOnRails
[10:21:14] mikecmpbll: has joined #RubyOnRails
[10:23:31] delgiudices: has joined #RubyOnRails
[10:24:25] dtzuzu: has joined #RubyOnRails
[10:24:31] hotpancakes: has joined #RubyOnRails
[10:25:30] moep: I'm getting a "database configuration does not specify adapter" and suspect a typo, but not sure where to look at, I'm trying to start a dev server with "RAILS_ENV=development bin/rails s -p 66666" and my config/database.yml looks like this http://hastebin.com/hoyedoduji.yml
[10:25:39] moep: The sqlite3 gem is also present in the Gemfile
[10:26:23] htmldrum: has joined #RubyOnRails
[10:26:23] sevenseacat: moep: check line 16
[10:26:24] htmldrum_: has joined #RubyOnRails
[10:26:49] fox_mulder_cp: moep: -maximum port is 65535
[10:27:03] moep: I checked for a typo in development the whole time, ty sevenseacat
[10:27:14] moep: fox_mulder_cp huh, ty
[10:27:16] sevenseacat: sometimes all it needs is a second set of eyes
[10:27:34] fox_mulder_cp: and u try start app with non existent port
[10:27:59] fox_mulder_cp: moep: remove last digit.
[10:28:11] blackmesa: has joined #RubyOnRails
[10:28:16] moep: fox_mulder_cp I was actually going to start it at 6666 first but somehow I added the last digit
[10:28:57] vibe: has joined #RubyOnRails
[10:30:34] vibe: has left #RubyOnRails: ()
[10:30:35] wethu: has joined #RubyOnRails
[10:31:33] rubyforgood: has joined #RubyOnRails
[10:32:53] User458764: has joined #RubyOnRails
[10:35:07] uglybandersnatch: has joined #RubyOnRails
[10:35:53] delgiudices: has joined #RubyOnRails
[10:43:12] pawnbox: has joined #RubyOnRails
[10:44:01] FooMunki: has joined #RubyOnRails
[10:45:02] rubyforgood: I wonder if someone can help me with a somewhat simple database design question. I have a model which needs to be used twice, so I have a group of questions that the user must answer and then the user must answer the same questions months later and we want to look at the difference between the answers. I have come up with a way that works, and I am able to run all my queries, but I feel like its definitly a hack and is not the best way of going
[10:45:06] rubyforgood: about doing something like this. Please find my gist to show you what I mean. https://gist.github.com/soilforlifeforms/52e6f59d19ccf28bc2b3
[10:45:34] mmhan_: has joined #RubyOnRails
[10:45:57] dvinciguerra__: has joined #RubyOnRails
[10:49:09] andywww: has joined #RubyOnRails
[10:49:13] agit0: has joined #RubyOnRails
[10:50:20] tvw: has joined #RubyOnRails
[10:52:48] mdw: has joined #RubyOnRails
[10:53:48] n008f4g_: has joined #RubyOnRails
[10:54:43] big|bad|wolf: has joined #RubyOnRails
[10:55:07] tildes: rubyforgood: so you have a survey, with exactly the same questions, and each farmer will answer it first before training, and then after training?
[10:56:09] Sephyros: has joined #RubyOnRails
[10:56:11] tildes: it does look a bit of a hack :)
[10:56:14] Sephyrus: has joined #RubyOnRails
[10:56:32] tildes: I wouldn't use the before and after_trainings at all
[10:56:52] rubyforgood: no there are one ore two questions that are added in depending on if initial or final
[10:57:15] Sephyros: Hi everybody!
[10:57:59] rubyforgood: im not sold on the before or after part, but I also don;t want to just go has_many exeperiences
[10:58:26] tildes: for me it would make sense for a farmer to have many survey answers
[10:58:28] andywww: has joined #RubyOnRails
[10:58:44] tildes: (not sure if I have better suggestions, just thinking aloud here)
[10:59:14] tildes: and having several foreign keys on one table, which will not have values simultaneously feels odd
[10:59:27] adlerdias: has joined #RubyOnRails
[10:59:35] rubyforgood: thats what im thinking too
[10:59:41] tildes: you know if I come up with something I'll ping in a bit later
[11:00:21] castor: has joined #RubyOnRails
[11:01:02] andywww: i’ve generated a set of controllers for devise so that i can extend the new session action to set a cookie on login
[11:01:08] Hates_: rubyforgood: why not just have a single trainings model with a flag like :before and :after
[11:01:14] andywww: i cannot for the life of me work out how to test that controller
[11:01:23] andywww: with rspec
[11:03:51] trinaldi: has joined #RubyOnRails
[11:05:56] hotpancakes: has joined #RubyOnRails
[11:06:54] sandstrom: has joined #RubyOnRails
[11:09:24] weckl: has joined #RubyOnRails
[11:12:00] dtzuzu: has joined #RubyOnRails
[11:14:03] Sephyros: has joined #RubyOnRails
[11:14:30] arup_r: has joined #RubyOnRails
[11:16:21] bronson: has joined #RubyOnRails
[11:22:40] ghormoon: has left #RubyOnRails: ("Leaving")
[11:24:19] hahuang61: has joined #RubyOnRails
[11:24:39] hotpancakes: has joined #RubyOnRails
[11:25:38] DarkBushido: has joined #RubyOnRails
[11:25:38] DarkBushido: has joined #RubyOnRails
[11:26:53] uglybandersnatch: has joined #RubyOnRails
[11:26:55] tuelz1: has joined #RubyOnRails
[11:28:23] delgiudices: has joined #RubyOnRails
[11:34:26] artto: has joined #RubyOnRails
[11:35:52] FooMunki: has joined #RubyOnRails
[11:38:05] gingray: has joined #RubyOnRails
[11:39:51] andywww: has left #RubyOnRails: ()
[11:41:57] ferr: When I render a partial with locals in my views, I get undefined variable or method error. https://gist.github.com/Fercell/f03b712c327460924e1c
[11:45:20] sevenseacat: ferr: render partial: "stuff", locals: {stuff}
[11:45:30] sevenseacat: or just render "stuff", { foo: bar }
[11:49:46] baweaver: has joined #RubyOnRails
[11:51:37] johnflux: has joined #RubyOnRails
[11:51:37] johnflux: has joined #RubyOnRails
[11:52:20] ldnunes: has joined #RubyOnRails
[11:55:15] artto: has joined #RubyOnRails
[11:58:44] godzillaenlacasa: has joined #RubyOnRails
[12:00:36] th0m_: has joined #RubyOnRails
[12:00:40] Cork: anyone know of a way to define rails_env in unicorns config file?
[12:02:30] rickmasta: has joined #RubyOnRails
[12:06:11] Sephyros: has joined #RubyOnRails
[12:06:20] hotpancakes: has joined #RubyOnRails
[12:06:32] godzillaenlacasa: @Cork I'm using Rubber/Capistrano to create and deploy instances, but I do: `#{Rubber.env}` in my config/rubber/role/unicorn/unicorn.rb file
[12:07:41] Cork: godzillaenlacasa: ya, i'm looking for a way to set the env in unicorn.rb
[12:07:45] Cork: not checking it
[12:09:54] roshanavand1: has joined #RubyOnRails
[12:10:24] godzillaenlacasa: @Cork That would set it... for instance, I'm using it to set current path: `current_path = "/ebs/#{rubber_env.app_name}-#{Rubber.env}/current"`. Also use it to set a predefined app_user: `user, group = '<%=rubber_env.app_user %>', '<%=rubber_env.app_user %>'`
[12:11:22] Cork: godzillaenlacasa: what i'm trying to do is set RAILS_ENV = "productiction" / "test" and so on from inside the config file
[12:11:24] Cork: so it doesn'
[12:11:32] Cork: *'t have to be given on the command line
[12:11:44] Cork: (so the managing gues don't forget the argument)
[12:13:30] quazimodo: has joined #RubyOnRails
[12:13:34] moeabdol1: has joined #RubyOnRails
[12:14:17] roshanavand__: has joined #RubyOnRails
[12:15:22] htmldrum: has joined #RubyOnRails
[12:15:23] htmldrum_: has joined #RubyOnRails
[12:15:45] rubyonrails163: has joined #RubyOnRails
[12:17:59] allcentury: has joined #RubyOnRails
[12:18:05] rubyonrails163: hey guys, im generating a model called 'children' and rails makes my model called 'child', is this just rails' pluralization engine in action or am i going crazy?
[12:19:07] Bacta: has joined #RubyOnRails
[12:20:38] rubyonrails163: to rephrase, does rails know to turn plural named models ("children") into their singular ("child")?
[12:20:57] Bacta: I have an application currently serving secure sessions. I want to implement CSRF for a non-secure route but the session isn't present when handling non-https requests as per the setup just mentioned. What options are available to me if I really can't make the non-http portion of the app https enabled?
[12:21:13] universa1: rubyonrails163: it should singularize iirc
[12:21:25] universa1: rubyonrails163: but simply generate another pluralized model and see ;)
[12:22:31] Irikos: has joined #RubyOnRails
[12:23:07] jsrn: has joined #RubyOnRails
[12:25:00] rubyonrails163: wow im impressed
[12:25:03] rubyonrails163: rails generate model potatoes crunchiness:integer [WARNING] The model name 'potatoes' was recognized as a plural, using the singular 'potato' instead. Override with --force-plural or setup custom inflection rules for this noun before running the generator.
[12:25:27] hotpancakes: has joined #RubyOnRails
[12:25:30] arup_r: ^ +1 awesome
[12:27:39] tuelz1: has joined #RubyOnRails
[12:27:57] darkxploit: has joined #RubyOnRails
[12:33:45] Macaveli: has joined #RubyOnRails
[12:34:03] krz: has joined #RubyOnRails
[12:34:56] sudoubuntu: has joined #RubyOnRails
[12:36:02] rubyforgood: has joined #RubyOnRails
[12:37:59] beauby: has joined #RubyOnRails
[12:38:25] rickmasta: has joined #RubyOnRails
[12:38:55] flashpoint9: has joined #RubyOnRails
[12:39:18] htmldrum: has joined #RubyOnRails
[12:39:19] htmldrum_: has joined #RubyOnRails
[12:39:30] john: has joined #RubyOnRails
[12:39:41] _Tariq: has joined #RubyOnRails
[12:41:28] pawnbox: has joined #RubyOnRails
[12:41:58] expiredKnight: has joined #RubyOnRails
[12:42:15] pawnbox: has joined #RubyOnRails
[12:43:22] georgedrummond: has joined #RubyOnRails
[12:45:03] arup_r: has joined #RubyOnRails
[12:49:22] adlerdias: has joined #RubyOnRails
[12:49:25] User458764: has joined #RubyOnRails
[12:49:31] expiredKnight: has joined #RubyOnRails
[12:49:46] atzorvas: has joined #RubyOnRails
[12:49:51] atzorvas: has joined #RubyOnRails
[12:49:51] atzorvas: has joined #RubyOnRails
[12:50:50] myntcake: has joined #RubyOnRails
[12:51:13] Cervajz: has joined #RubyOnRails
[12:53:59] nickenchuggets: has joined #RubyOnRails
[12:55:38] rubyforgood_: has joined #RubyOnRails
[12:56:59] unl0ckd: has joined #RubyOnRails
[12:57:00] makerops: has joined #RubyOnRails
[12:58:35] GodFather: has joined #RubyOnRails
[13:02:03] dtzuzu: has joined #RubyOnRails
[13:03:13] artto: has joined #RubyOnRails
[13:06:43] Ergo: has joined #RubyOnRails
[13:06:55] hotpancakes: has joined #RubyOnRails
[13:07:10] AimlessRAven: has joined #RubyOnRails
[13:08:15] jottr: has joined #RubyOnRails
[13:08:35] AimlessRAven: https://gist.github.com/anonymous/1a3868852b4baf94d9ac how to change this value + 1 for evry click
[13:09:13] artto: has joined #RubyOnRails
[13:09:33] adlerdias: has joined #RubyOnRails
[13:09:47] rubyonrailed: has joined #RubyOnRails
[13:10:01] merida: has joined #RubyOnRails
[13:10:40] petor: has joined #RubyOnRails
[13:10:48] akshat: has joined #RubyOnRails
[13:11:35] context: aimlessraven: have you even tried ?!?!
[13:14:39] valetudo: has joined #RubyOnRails
[13:16:54] bronson: has joined #RubyOnRails
[13:16:56] DragonPunch: has joined #RubyOnRails
[13:17:15] allcentury: has joined #RubyOnRails
[13:17:19] adlerdias_: has joined #RubyOnRails
[13:17:46] drbayer: has joined #RubyOnRails
[13:17:46] _Tariq: has joined #RubyOnRails
[13:21:50] CodaBrink: has joined #RubyOnRails
[13:23:44] CodaBrink: has joined #RubyOnRails
[13:24:49] roelod: has joined #RubyOnRails
[13:25:38] hotpancakes: has joined #RubyOnRails
[13:27:35] Jasaka: has joined #RubyOnRails
[13:27:45] roelod: Is the odin project a good way to learn rails ?
[13:29:06] mrchris: has joined #RubyOnRails
[13:32:19] universa1: roelod: try ;) i quickly skimmed through a randomly selected section and it looked ok :-)
[13:33:38] roelod: thanks, I doubt between that one and Hartl book
[13:34:44] hxegon: has joined #RubyOnRails
[13:35:04] GodFodder: has joined #RubyOnRails
[13:35:24] roelod: sevenseacat: why sad ?
[13:35:34] adlerdias_: has joined #RubyOnRails
[13:35:49] GodFodder: has joined #RubyOnRails
[13:36:22] universa1: roelod: !r4ia
[13:36:22] helpa: roelod: 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
[13:37:01] Ropeney: has joined #RubyOnRails
[13:38:08] theblang: has joined #RubyOnRails
[13:38:29] dede: has joined #RubyOnRails
[13:39:44] rubyforgood: has joined #RubyOnRails
[13:40:36] uglybandersnatch: has joined #RubyOnRails
[13:41:03] Palsson: has joined #RubyOnRails
[13:41:12] yellow5: has joined #RubyOnRails
[13:43:34] RegulationD: has joined #RubyOnRails
[13:43:50] jschoolcraft: has joined #RubyOnRails
[13:46:34] arup_r: so we have only one book name mentioned in this channel as a resource?
[13:47:05] Balzrael: has joined #RubyOnRails
[13:47:14] universa1: arup_r: whaaat?
[13:47:19] Ropeney: arup_r, what kind of reference are you after?
[13:47:31] basldex: has joined #RubyOnRails
[13:47:43] universa1: arup_r: !learn
[13:47:43] helpa: arup_r: How to learn Ruby and Rails - http://astonj.com/tech/best-way-to-learn-ruby-rails/
[13:47:43] arup_r: well.. Rails book I meant Ropeney ..
[13:48:15] sevenseacat: we have a whole pile of books for different things
[13:48:16] universa1: arup_r: so many books in there, though the link might be outdated and need an update
[13:48:35] arup_r: universa1: humm, that is nice. I asked that only.. good we have long list..
[13:48:59] basldex: interesting problem: I have 8 puma workers (one per core) and need to share action controller live's request.stream objects. apparently you can transfer IOs only via unix sockets, is that true? so I'd need to write a socket server managing the IO distribution, or is there anything pre-made for it? cod maybe?
[13:49:03] sevenseacat: pick a topic, and I'll recommend a book on it :P
[13:50:00] epochwolf: sevenseacat: I'd like to learn some desert ecology so I can make proper maps for my D&D campaign.
[13:50:05] arup_r: all time I see r4ia, so though we have only 1.. but now I see we have other list also. so all izz well. :D
[13:50:42] sevenseacat: arup_r: well, two of us recommend it because we think its the best book for learning Rails, for obvious reasons
[13:50:45] baweaver: has joined #RubyOnRails
[13:51:03] arup_r: yeah.. not an issue. :)
[13:51:07] artto: has joined #RubyOnRails
[13:51:21] sevenseacat: epochwolf: http://www.amazon.com/Ecology-Desert-Systems-Walter-Whitford/dp/0127472614/
[13:51:48] epochwolf: sevenseacat: holy shit...
[13:52:09] hotpancakes: has joined #RubyOnRails
[13:53:42] Oka: has joined #RubyOnRails
[13:54:49] adlerdias: has joined #RubyOnRails
[13:55:43] rubyforgood: has joined #RubyOnRails
[13:55:48] Guest52396: has left #RubyOnRails: ()
[13:55:48] mag42c: has joined #RubyOnRails
[13:55:48] xenet: has joined #RubyOnRails
[13:56:58] workmad3: sevenseacat: I'd like an introductory book on tensors that doesn't assume a deep familiarity with set theory pls.
[13:57:16] sevenseacat: i was never much good at physics.
[13:57:34] workmad3: heh :) that's good... this is maths ;)
[13:58:12] workmad3: sevenseacat: I'm also failing to see a recommendation as promised :P
[13:58:13] bungoman: has joined #RubyOnRails
[13:58:31] sevenseacat: i was never much good at maths either <_<
[13:58:42] workmad3: sevenseacat: bah :)
[13:58:51] lxsameer: has joined #RubyOnRails
[13:59:46] deur-: maybe a good default recommendation for every topic would be "oh, the places you'll go!" by dr. seuss :p
[14:00:10] lxsameer: has joined #RubyOnRails
[14:00:25] workmad3: deur-: either that, or I should just knuckle down and get a good grasp on set theory :)
[14:09:00] blackmesa: has joined #RubyOnRails
[14:09:57] lyoshajapan: has joined #RubyOnRails
[14:11:30] n1lo: has joined #RubyOnRails
[14:21:09] renanoronfle: has joined #RubyOnRails
[14:26:01] Spami_: has joined #RubyOnRails
[14:27:02] Mattx: has joined #RubyOnRails
[14:28:49] tuelz1: has joined #RubyOnRails
[14:29:26] flashpoint9: has joined #RubyOnRails
[14:29:27] Mattx: Hey guys. Check this, is it a bug? http://i.imgur.com/JX5hA10.png
[14:29:44] Mattx: This is the route: match '/:controller(.:format)', controller: /[^\/]+\/[^\/]+/, action: "handle", via: [:get, :post]
[14:30:02] sevenseacat: that doesnt match
[14:30:46] sevenseacat: controller would be domains, and analyze... doesnt exist
[14:30:51] Mattx: sevenseacat, it doesn't match the url, but if I write /domains/analyze on the input it does
[14:31:05] sevenseacat: i have no idea what that is, so
[14:31:13] Mattx: the problem is not that it doesn't find the controller, it's not matching the url!
[14:31:34] Mattx: and actually the controller does exists, the file is app/controllers/domains/analyze_controlller.rb
[14:31:44] sevenseacat: how do you expect /:controller to match /domains/analyze ?
[14:31:56] Mattx: sevenseacat, http://guides.rubyonrails.org/routing.html#dynamic-segments
[14:32:03] Rubie: has joined #RubyOnRails
[14:32:24] Mattx: same idea as the example here there: get ':controller(/:action(/:id))', controller: /admin\/[^\/]+/
[14:32:26] sevenseacat: yes, i know what they are. you can't match things with / in them, / is for dividing segments
[14:33:22] Mattx: you can it seems, that's what the guide says
[14:33:49] sevenseacat: the guide does not say that.
[14:34:49] Mattx: sevenseacat, ?
[14:34:50] Mattx: "You can't use :namespace or :module with a :controller path segment. If you need to do this then use a constraint on :controller that matches the namespace you require. e.g:"
[14:34:55] Mattx: get ':controller(/:action(/:id))', controller: /admin\/[^\/]+/
[14:35:19] sevenseacat: that doesnt mean :controller can match "domains/analyze"
[14:35:46] Mattx: explain please, I really thought that's how it worked
[14:35:52] JakFrist: has joined #RubyOnRails
[14:36:19] sevenseacat: in that case :controller would match domains and :action would match analyze, because the () marks optional segments
[14:36:52] Mattx: then what's the purpose of controller: /admin\/[^\/]+/ ?
[14:37:30] sevenseacat: its a regex to match the controller
[14:37:33] atzorvas: is there any way to find out the minimum required gem updates prior to a rails upgrade from 3 to 4 etc?
[14:39:13] Mattx: sevenseacat, sure, but controller should match "admin/something/" in that case, am I wrong?
[14:40:45] sevenseacat: i dont think so
[14:41:16] oded: has joined #RubyOnRails
[14:41:31] axl_: has joined #RubyOnRails
[14:42:10] smathy: has joined #RubyOnRails
[14:42:17] merida: has joined #RubyOnRails
[14:42:25] User458764: has joined #RubyOnRails
[14:43:50] mDuff: has joined #RubyOnRails
[14:44:23] finnnnnnnnnnn: has joined #RubyOnRails
[14:45:34] finnnnnnnnnnn: hello, how do I convert 1st January 2016 to 2016-01-01
[14:47:37] finnnnnnnnnnn: got it, time.parse
[14:48:47] merida_: has joined #RubyOnRails
[14:49:27] akshat: has joined #RubyOnRails
[14:53:40] gabr13l: has joined #RubyOnRails
[14:55:34] mwcmitchell: has joined #RubyOnRails
[14:58:10] adavia: has joined #RubyOnRails
[14:58:39] qejk: has joined #RubyOnRails
[15:01:25] jottr: has joined #RubyOnRails
[15:01:39] blackmesa: has joined #RubyOnRails
[15:02:33] mrchris: has joined #RubyOnRails
[15:07:09] CodaBrink: has joined #RubyOnRails
[15:08:04] CodaBrink: has joined #RubyOnRails
[15:10:19] Megamos: has joined #RubyOnRails
[15:12:37] neohunter: has joined #RubyOnRails
[15:13:29] neohunter: Can someone please give me a hand with this one, is driving me crazy: http://stackoverflow.com/questions/36287926/rails-is-not-using-the-configuration-set-on-database-yaml/36288045#36288045
[15:13:56] neohunter: my rails is not using the database.yml settings to connect, but is showing the right params on the log,
[15:14:21] atzorvas: is there anything like https://github.com/rails/rails_upgrade for rails4, rails5?
[15:14:29] neohunter: it says, cant create database for... "username"=>"ubuntu", "host"=>"".... but error says Access denied for user ''@'localhost'
[15:15:18] zave: has joined #RubyOnRails
[15:15:58] drim: has joined #RubyOnRails
[15:16:07] fox_mulder_cp: neohunter: hm. how u create db in mysql|postgres?
[15:16:08] baweaver: has joined #RubyOnRails
[15:16:16] drbayer: has joined #RubyOnRails
[15:16:24] drim: is there a way to add a flash message from the view with link_to ?
[15:16:25] fox_mulder_cp: and how to create user and its access rights?
[15:16:42] petor: has joined #RubyOnRails
[15:17:52] fox_mulder_cp: drim: <a href="<% flash.message.here %>">blabla</a>?
[15:18:25] fox_mulder_cp: or u want pass object to flash and show it as flash.url + flash.text?
[15:18:46] bronson: has joined #RubyOnRails
[15:18:59] drim: I was thinking of something like <%= link_to 'My Link', root_path, flash: 'Hello' %>
[15:19:35] Aswebb_: has joined #RubyOnRails
[15:19:44] CodaBrink: has joined #RubyOnRails
[15:19:53] drim: but looks like I have to pass an url parameter and handle that on the controller side..
[15:20:01] context: drim: just pass it in params
[15:20:15] mauro1254: has joined #RubyOnRails
[15:20:17] context: root_path(flash: "Hello") -- (its something like that...)
[15:20:35] drim: and handle that in the controller context ?
[15:21:22] context: that seems like a logical place
[15:21:42] context: although it kind of sounds like you are possibly using the flash for the wrong reason
[15:22:34] context: the flash has NOTHING to do with the view layer, so no, you cant 'add' to the flash using link_to
[15:22:37] hotpancakes: has joined #RubyOnRails
[15:22:49] smathy: neohunter, !gist your full database.yml
[15:22:49] helpa: neohunter: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[15:23:05] chouhoulis: has joined #RubyOnRails
[15:23:09] mauro1254: Hy guys, I have a question about Polymorphism. I'm working on an application that manage documents of type A, B, C. These documents share a dozen of fields, but also have specific ones depending on type. I know that a solution is polimorphism, but... how many controllers would you create?
[15:23:27] drim: okay thank you
[15:23:29] jottr: has joined #RubyOnRails
[15:23:34] context: mauro1254: as many as you need
[15:23:53] smathy: I would create 17 controllers.
[15:23:58] Ropeney: has joined #RubyOnRails
[15:24:01] mauro1254: context: one controller to manage them all, or three controllers?
[15:24:05] context: 13.726 controllers.
[15:24:14] mrchris: has joined #RubyOnRails
[15:24:22] context: mauro1254: id personally probably make 4.
[15:24:27] epochwolf: mauro1254: as many as you need.
[15:24:46] context: but as i (+ everyone else) is saying, as many as you need
[15:24:48] smathy: It really depends on which day of the week you started your project, Tuesday.controller_number # => 17
[15:24:56] mauro1254: Well, but is DRY respected?
[15:25:07] context: mauro1254: it all depends on situation. but i will say: DONT be afraid to create new classes/controllers
[15:25:18] tubbo: mauro1254: DRY is a suggestion, not an architecture.
[15:25:40] mauro1254: Ok, but I don't want to repeat code... I now have 3 document types, but could increse in the future ...
[15:25:40] tubbo: people getting "too into DRY" is probably the reason why sandi metz wrote this: http://www.sandimetz.com/blog/2016/1/20/the-wrong-abstraction
[15:25:41] context: and sure be dry... use BaseController, and have A,B,C Controlers extrend from it
[15:25:48] epochwolf: tubbo: you should really see my DRY architecture. It is a momument to how things should not be done.
[15:26:19] context: or use 1 controller and set some var in your routes if you want....
[15:26:42] tubbo: mauro1254: assuming that your document types are represented on a per-model basis, perhaps reconsider *that* strategy?
[15:27:05] dgncn: has joined #RubyOnRails
[15:27:12] epochwolf: You can share code with modules instead of using inheritance.
[15:27:22] context: mauro1254: do these document types have different logic related to them
[15:27:30] context: or.. are they just... "different" document types
[15:27:32] barajasfab: has joined #RubyOnRails
[15:27:34] mauro1254: context: no
[15:27:37] mauro1254: same, logic
[15:27:45] mauro1254: CRUD operations
[15:27:47] context: oh then stop using polymporphism
[15:28:09] mauro1254: context: which approach do you suggest?
[15:28:21] context: if they have the same exact logic all you need is a column saying "hi im a human animal"
[15:28:32] context: and "rawr im a lion animal"
[15:28:33] finnnnnnnnnnn: has joined #RubyOnRails
[15:28:45] epochwolf: context: "meow im a confused wolf"
[15:28:47] mauro1254: Well, but there are different fields
[15:29:06] chouhoulis: has joined #RubyOnRails
[15:29:10] context: mauro1254: then use poly. just pick something
[15:29:13] context: go role with it
[15:29:16] mauro1254: They all share a dozen of field, but each type has its onw specific fields
[15:29:25] tubbo: mauro1254: consider this strategy.. https://gist.github.com/tubbo/cdc94a5f8f3663a7d822
[15:29:28] smathy: Go authorization with it.
[15:29:37] tubbo: put a bird on it?
[15:29:45] tuelz1: has joined #RubyOnRails
[15:29:45] context: mauro1254: your requirements are vague, so i can only give you at best vague answers on why i would do something
[15:29:47] mostlybadfly: has joined #RubyOnRails
[15:29:49] smathy: Go Go with it.
[15:29:51] apeiros: is there a reference for which http status codes to return in your json api for different kinds of errors? i.e. which one to return in case of validation error, vs. which one in case of an exception etc.?
[15:30:07] context: apeiros: google.com
[15:30:09] tubbo: apeiros: always return 404 #security
[15:30:18] apeiros: context: unhelpful.
[15:30:20] brendan-: has joined #RubyOnRails
[15:30:24] tubbo: apeiros: nah i'm kidding...i think there is a "List of HTTP Status Codes" on Wikipedia, which i typically refer to.
[15:30:37] tubbo: apeiros: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
[15:30:41] context: on the contrary, it is extremely rare google.com is of 0 help
[15:31:03] context: tubbo: how did you find that?
[15:31:08] smathy: ACTION always uses https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
[15:31:08] context: if you used google thats unhelpful.
[15:31:11] tubbo: at some point i googled it :D
[15:31:35] context: unhelpful. the lot of you. go home.
[15:32:14] tubbo: smathy: yo that one is bullshit it doesn't even have 418 I'm a Teapot
[15:32:21] apeiros: tubbo: the list of status codes is not the problem. but the codes IMO don't match well. I mean some yes - exception should IMO be 500, but validation? should be one of the 400 series, but none fits IMO.
[15:32:22] smathy: ...but that doesn't include 422, but I just know that one :)
[15:32:26] context: apeiros: otherwise, look at github, stripe, google? (oops)
[15:32:36] context: apeiros: look at ANY site that offers a public api and see how they do it
[15:32:50] context: the internet is vast of information. but since google is unhelpful, you will probably never know any of it.
[15:32:53] jottr: has joined #RubyOnRails
[15:33:03] epochwolf: Looking for a "standard json api" just leads to tears.
[15:33:28] tubbo: apeiros: agreed, yeah...it kinda depends on who your consumers are. like for example, returning 4xx status codes if your API is meant to integrate with a JS component is problematic because you'll see errors in console just for bad validation messages...and it's easier to integrate with jQuery if you just render 200 OK and the error message inside, thereby making the status code more reflective of server
[15:33:30] smathy: apeiros, the most important thing is that you document those responses in your API docs.
[15:33:30] tubbo: issues than application-level issues.
[15:33:36] smathy: ...whatever you choose.
[15:33:39] context: apeiros: why does 400 work for validation error ?
[15:34:02] disgrntld: has joined #RubyOnRails
[15:34:04] context: validation failure is in fact a BAD request.
[15:34:06] apeiros: context: "The 4xx class of status code is intended for situations in which the client seems to have erred"
[15:34:07] context: its BAD data.
[15:34:10] tubbo: context: that's not what 400 means.
[15:34:11] Devalo: has joined #RubyOnRails
[15:34:15] epochwolf: context: rails recommends 422 for validation failures.
[15:34:16] mrchris: has joined #RubyOnRails
[15:34:22] epochwolf: 400 means the client fucked up http.
[15:34:24] AzaToth: has joined #RubyOnRails
[15:34:26] tubbo: 400 means you sent an invalid HTTP request like instead of sending the verb POST you sent GO_FUCK_YOURSELF
[15:34:27] context: there, even better
[15:34:35] djgraham: And 418 means I'm a teapot
[15:34:43] tubbo: yep, 422 is what i use
[15:34:46] tubbo: :unprocessable_entity
[15:34:59] helpa: http://httpstat.us
[15:35:06] tubbo: !statustext
[15:35:17] mauro1254: tubbo: about the strategy, it seems you suggest to use only one table ... is it right?
[15:35:24] tubbo: apeiros: ^ i use that reference as well because i'd rather do render 'error', status: :server_error
[15:35:39] tubbo: mauro1254: that is correct. my gist assumes the use of postgresql, because that :data field is a JSONB hash.
[15:35:59] elaptics: I use Dash which has a couple of nice cheatsheets including this rails specific one
[15:36:02] elaptics: https://github.com/Kapeli/cheatsheets/blob/master/cheatsheets/HTTP_Status_Codes_Rails.rb
[15:36:29] mauro1254: tubbo: what if you need to search aginst specific fields?
[15:36:32] workmad3: I tend to use http://httpstatusdogs.com/ for reference of the codes :)
[15:36:33] tubbo: mauro1254: so you have a table of documents, and then an unstructured field inside. you can make that JSONB if you never need to dive in and query on elements in that hash, but if you do need to query on the keys you can use HSTORE.
[15:36:46] mauro1254: tubbo: ok, hehehe
[15:36:48] tubbo: mauro1254: HSTORE allows you to query inside the hash (iirc), and JSON/JSONB does not.
[15:37:03] elaptics: workmad3: oh that is awesome :)
[15:37:04] tubbo: that's the main diff from my perspective...of course it might be different if you're a DBA or something
[15:37:31] apeiros: it seems json-api prescribes 409
[15:37:45] apeiros: but I don't find the description quite clear :-/
[15:37:55] workmad3: tubbo: you can query into JSON last I checked
[15:38:04] context: apeiros: how so
[15:38:16] maokomioko: has joined #RubyOnRails
[15:38:17] tubbo: workmad3: well slap my bag and call me sally
[15:38:23] workmad3: :) http://www.postgresql.org/docs/9.3/static/functions-json.html
[15:38:32] mauro1254: tubbo: thanks for suggestions
[15:38:39] epochwolf: mauro1254: basically, there are a ton of ways to do it. Unless you can get very specific on what your requirements are, we can't pick the best one.
[15:38:42] tubbo: so mauro1254 ^ i feel like json is a bit faster
[15:38:43] mauro1254: thanks to everybody
[15:39:28] ensyde_: has joined #RubyOnRails
[15:39:35] apeiros: context: how so - by not listing 422 as any possible status code, and the description of 409 coming closest to what I'd consider a validation error
[15:39:40] apeiros: see http://jsonapi.org/format/#crud-updating
[15:39:54] apeiros: "A server MAY return 409 Conflict when processing a PATCH request to update a resource if that update would violate other server-enforced constraints"
[15:40:06] maokomioko: has joined #RubyOnRails
[15:40:20] mauro1254: epochwolf: yes, I know there are many ways to do that ... Sometimes it is useful to ask and see what people think
[15:40:22] epochwolf: apeiros: 422 is accepted as Validation Failure for rails applications.
[15:40:31] context: apeiros: 422 is in every list of http status codes
[15:40:38] drbayer: has joined #RubyOnRails
[15:41:19] context: http://guides.rubyonrails.org/layouts_and_rendering.html#using-render
[15:41:26] context: 2.2.13 shows symbols for all of them too
[15:41:38] tubbo: apeiros: if jsonapi is telling you to return a particular status code, i would say follow that spec :)
[15:41:41] tubbo: same is better than better
[15:41:47] valetudo: has joined #RubyOnRails
[15:41:48] smathy: apeiros, right, a 409 means that you're trying to update a document, but the update would create a conflict, just like when you try to git push code to github, but HEAD has moved so you need to pull before pushing.
[15:42:06] context: if you are adhearing to jsonapi, then do use the codes it suggests.
[15:42:07] workmad3: context: it's in every list apart from the RFC lists of status codes ;)
[15:42:10] mauro1254: I asked because it is a bit strange to use polymorphism here
[15:42:15] mauro1254: I read http://guides.rubyonrails.org/association_basics.html#polymorphic-associations
[15:42:44] context: haha. rfc stops at 417 did not know that
[15:42:54] mauro1254: In the example presented in the guide Picture, Employee and Product are three model that may exist alone
[15:43:00] apeiros: context: "it's in a list of status codes" != "it's the proper status code for a specific use case"
[15:43:09] context: apeiros: you arent going to have you hand chopped off for not doing what we or rails recommends
[15:43:16] apeiros: or do you suggest I use a random status code just because it's in a list of status codes?
[15:43:18] diegoaguilar: has joined #RubyOnRails
[15:43:28] mauro1254: But in my case ... Extra fields for document A, require document ...
[15:43:37] apeiros: context: and I think you're going to be ignored by me further on. thanks for your time so far, though.
[15:43:48] reckoner: has joined #RubyOnRails
[15:43:54] smathy: apeiros, the worst thing is that you'll surprise a consumer of your API.
[15:43:54] workmad3: context: rfc7631 gives you 426 'upgrade required' but otherwise yeah... 418 and beyond aren't rfc-standardised codes, but 418 and 422 are widespread enough in meaning that they're now able to be classed as community standards
[15:44:24] smathy: apeiros, 422 is definitely the right code for a validation error.
[15:44:29] context: apeiros| is there a reference for which http status codes to return in your json api for different kinds of
[15:44:32] context: errors? i.e. which one to return in case of validation error, vs. which one in case of an exception
[15:44:39] smathy: apeiros, the request is well formed but failed for semantic (ie. business logic) reasons.
[15:44:47] context: you ask for status codes, we say 422, you say jsonapi says 409, you dont like either...
[15:44:47] apeiros: epochwolf, smathy, tubbo, workmad3: thanks for your input. I'll scour more documents regarding that and see.
[15:44:50] context: so go... do whatever you want
[15:45:11] context: why the fuck did he even ask for help to say "i dont like any of those options"
[15:45:18] smathy: apeiros, the only reason 422 is missing from some lists of status codes is that it wasn't part of the original RFC, it's a later RFC.
[15:45:38] apeiros: yeah, 422 is from webdav
[15:45:47] arup_r1: has joined #RubyOnRails
[15:45:51] chipotle: has joined #RubyOnRails
[15:46:03] smathy: Not a reason to discount it.
[15:46:27] epochwolf: apeiros: why does the error code need to have some official blessing for you to use it?
[15:46:37] apeiros: I'm currently looking into openapi, jsonapi and what people with rails generally do.
[15:47:02] smathy: apeiros, good plan.
[15:47:03] apeiros: but in the documents of jsonapi, I come up largely empty handed, as stated above. which I find irritating.
[15:47:04] sarink: has joined #RubyOnRails
[15:47:08] smathy: Take the path of least surprise.
[15:47:15] smathy: ...and then document whatever you choose.
[15:47:16] SeductiveError: has joined #RubyOnRails
[15:47:16] tubbo: apeiros: we considered using jsonapi but frankly, it was too much maintenence work for us
[15:47:26] apeiros: epochwolf: because it's generally a good idea to follow standards?
[15:47:34] smathy: It doesn't matter anywhere near as much as the volume of discussion would suggest.
[15:47:40] hotpancakes: has joined #RubyOnRails
[15:47:44] tubbo: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[15:48:09] epochwolf: apeiros: standards are often ignored.
[15:48:13] tvw: has joined #RubyOnRails
[15:48:27] apeiros: epochwolf: that does not make it a good idea to follow that example and ignore standards yourself
[15:48:35] apeiros: in fact, I find it a rather stupid idea.
[15:48:45] epochwolf: It's better to follow convention. For example, github uses 422 for validation failures.
[15:49:15] smathy: apeiros, there are no standards for this stuff. You can even return a 200 with an { error: "validation error on xyz" } JSON packet if you want. Ok, enough discussion on this now, I think you have all the right ideas.
[15:49:23] ivanskie: has joined #RubyOnRails
[15:49:58] sevenseacat: smathy: i've seen APIs that do that :(
[15:50:00] workmad3: apeiros: from a quick read of the jsonapi spec, it seems to be that they're mandating 409 for certain specific cases that are definitely conflicts, but leave you free to use other codes in situations like general validation errors
[15:50:04] sevenseacat: everything is a 200. always.
[15:50:07] havenwood: So you can do it wrong. We don't like discussing right. Got it. :P
[15:50:50] workmad3: apeiros: but I agree that it's somewhat vague and badly specified, and I could be interpretting the text badly :)
[15:50:57] context: its like that question your mom always asks you, if everyone is jumping off a bridge are you going to do it?
[15:51:00] smathy: havenwood, you think three pages of discussion isn't enough?
[15:51:04] context: well... jumping off a bridge definitely isnt standard
[15:51:18] context: but... if EVERYONE is doing it... yes im going to do it too
[15:51:20] workmad3: context: depends on if I'm with my smart friends or my dumb friends
[15:51:25] mrchris: has joined #RubyOnRails
[15:51:34] context: because.. i imagine there is a really damn good reason for everyone to be jumping off a bridge.
[15:51:40] epochwolf: workmad3: am I a smart friend or dumb friend? :P
[15:51:43] workmad3: context: smart friends - I'm gonna do it, because they probably have a good reason... dumb friends, I'm definitely gonna check for a good reason first :)
[15:51:48] smathy: Jumping off bridges is fun.
[15:52:38] context: never jumped off a bridge, i can vouch that jumping out of helicopters and planes are in fact fun. a whole LOT of fun.
[15:53:05] Rubie: has joined #RubyOnRails
[15:53:06] workmad3: I tend to avoid jumping off things
[15:53:23] workmad3: epochwolf: on the advice of my lawyer, I decline to answer that question ;)
[15:53:37] context: epochwolf: depends on the situation im sure ;)
[15:53:45] context: and... how much alcohol is involved
[15:53:57] sandstrom: has joined #RubyOnRails
[15:54:33] apeiros: depends on what's below the bridge. friends of mine frequently jump into a river from a bridge and that's apparently fun.
[15:54:35] epochwolf: ACTION cuddles his bottle of peach schnapps and uses 422.
[15:54:45] siaW: has joined #RubyOnRails
[15:55:42] smathy: apeiros, and you're still looking for a standard before jumping ;)
[15:56:14] hotpancakes: has joined #RubyOnRails
[15:56:27] tubbo: sevenseacat: that's what it's like working with Yotpo and PayU :(
[15:56:31] tubbo: never. again.
[15:57:16] hotpanca_: has joined #RubyOnRails
[15:58:31] SteenJobs: has joined #RubyOnRails
[15:59:27] SteenJobs: hey guys - how can i use a custom image asset for a button using the rails button helpers? it’s NOT a submit or link (it’s a replacement button for the default browser radio buttons)…when i add the image, i end up with the image inside of the default browser button style.
[16:03:06] Dimik: has joined #RubyOnRails
[16:03:19] mrchris: has joined #RubyOnRails
[16:03:23] smathy: SteenJobs, background image in CSS (haven't I already told you this?)
[16:03:52] User458764: has joined #RubyOnRails
[16:03:55] SteenJobs: smathy: haha it could be…thanks. that was going to be my last option, but seems to make the most sense. but there’s one problem
[16:04:09] SteenJobs: smathy: i have different image assets for onmouseover, which i usually set within the image_tag itself
[16:04:30] SteenJobs: smathy: but if i’m setting the image using background-image, i guess i just need to swap it out using JS?
[16:05:43] smathy: SteenJobs, I'm sure I told you this before too, use the :hover pseudo-class to change the background image when the mouse is over it.
[16:06:10] SteenJobs: smathy: oh right right. i always forget to use &:hover/:focus, since i’m used to doing these things with JS rather than CSS
[16:06:36] SteenJobs: you know i always listen to you, i’m just always learning so much from you that it takes a few times to remember everything ;)
[16:07:09] smathy: Learn and then immediately make a mockup of it.
[16:08:54] d0nn1e: has joined #RubyOnRails
[16:08:55] SteenJobs: smathy: originally i was embedding the button in a link_to helper, which worked re the image asset, but the problem is the page would scroll whenever a custom radio button was clicked because of the “#” src, so this should work
[16:09:32] mrchris: has joined #RubyOnRails
[16:09:38] blackmesa: has joined #RubyOnRails
[16:12:12] smathy: SteenJobs, just use href="javascript:" instead of #
[16:12:25] GeorgesLeYeti: has joined #RubyOnRails
[16:12:31] SteenJobs: right - although using background-image feels less hacky anyway
[16:14:02] alex88: has joined #RubyOnRails
[16:14:32] GeorgesLeYeti: What is the best way to resize images in order to load less data to my browser ?
[16:15:07] benlieb: has joined #RubyOnRails
[16:15:07] GeorgesLeYeti: If I make in css height: 40px for example it still load the full image, isn't it ?
[16:16:04] SteenJobs: it’ll still be loading the full image, and then just changing the display size - use imagemagick to resize the file itself
[16:19:56] pawnbox: has joined #RubyOnRails
[16:22:02] tuelz1: has joined #RubyOnRails
[16:22:16] smathy: GeorgesLeYeti, yes, you need to resize the actual image that your server returns.
[16:22:24] mrchris: has joined #RubyOnRails
[16:22:39] bronson: has joined #RubyOnRails
[16:23:11] GeorgesLeYeti: smathy, ok ty. with RMagick or is there a better gem ?
[16:23:33] RegulationD: has joined #RubyOnRails
[16:24:06] tildes_: has joined #RubyOnRails
[16:24:58] Leifr: has joined #RubyOnRails
[16:25:52] unl0ckd: has left #RubyOnRails: ("Bye!")
[16:30:07] mrchris: has joined #RubyOnRails
[16:30:19] cschneid: has joined #RubyOnRails
[16:30:50] rickmasta: has joined #RubyOnRails
[16:30:59] petor: has joined #RubyOnRails
[16:31:09] hotpancakes: has joined #RubyOnRails
[16:31:35] terrorista: has joined #RubyOnRails
[16:31:39] rogue_koder: has joined #RubyOnRails
[16:31:55] tuelz1: has joined #RubyOnRails
[16:32:56] hotpancakes: has joined #RubyOnRails
[16:35:36] kailido: has joined #RubyOnRails
[16:37:39] kailido: how do I mix two arrays in a view ?
[16:38:20] mDuff: has joined #RubyOnRails
[16:39:00] fryguy: kailido: what do you meam by "mix"
[16:39:03] Cohedrin: has joined #RubyOnRails
[16:40:06] kailido: I have an array with "example 1 example 2" and other with "1 2 3 4" . and I want my view like. "1" on example 1, "2" on example 2
[16:40:18] Cohedrin: has joined #RubyOnRails
[16:40:38] fryguy: kailido: this might help you: http://apidock.com/ruby/Array/zip
[16:41:07] shinnya: has joined #RubyOnRails
[16:41:54] merida: has joined #RubyOnRails
[16:41:57] Spami_: has joined #RubyOnRails
[16:47:43] kailido: has joined #RubyOnRails
[16:48:24] arup_r: has joined #RubyOnRails
[16:50:42] tuelz1: has joined #RubyOnRails
[16:51:20] marr: has joined #RubyOnRails
[16:51:50] smathy: GeorgesLeYeti, I prefer minimagick, but either will work.
[16:57:04] mikecmpbll: has joined #RubyOnRails
[16:59:25] manfrin: has joined #RubyOnRails
[17:04:04] helpa-bot: has joined #RubyOnRails
[17:04:28] a1fa_: has joined #RubyOnRails
[17:04:57] boboc: has joined #RubyOnRails
[17:05:04] sleungcy: has joined #RubyOnRails
[17:05:16] AntiSpamMeta2: has joined #RubyOnRails
[17:05:17] johnflux_: has joined #RubyOnRails
[17:05:18] johnflux_: has joined #RubyOnRails
[17:05:21] jord_: has joined #RubyOnRails
[17:05:50] andatche_: has joined #RubyOnRails
[17:06:11] matt_d_: has joined #RubyOnRails
[17:06:16] hahuang61: has joined #RubyOnRails
[17:06:23] Depili_: has joined #RubyOnRails
[17:06:24] magically_: has joined #RubyOnRails
[17:06:25] bratchle1: has joined #RubyOnRails
[17:06:31] DarkBushido_: has joined #RubyOnRails
[17:06:52] hive-mind: has joined #RubyOnRails
[17:06:52] D9: has joined #RubyOnRails
[17:06:56] SanguineAnomaly: has joined #RubyOnRails
[17:07:10] webdestroyaz: has joined #RubyOnRails
[17:07:18] zmd: has joined #RubyOnRails
[17:07:36] DanKnox: has joined #RubyOnRails
[17:07:36] cschneid_: has joined #RubyOnRails
[17:07:37] ELCALOR_: has joined #RubyOnRails
[17:07:37] epochwolf|2: has joined #RubyOnRails
[17:07:37] Scriptonaut_: has joined #RubyOnRails
[17:07:38] leifcr: has joined #RubyOnRails
[17:07:38] epochwolf|2: has joined #RubyOnRails
[17:07:38] Ratler: has joined #RubyOnRails
[17:07:38] Scriptonaut_: has left #RubyOnRails: ()
[17:07:39] djgraham|calypso: has joined #RubyOnRails
[17:07:47] ddv: has joined #RubyOnRails
[17:07:57] coffeejunk: has joined #RubyOnRails
[17:07:59] djinni`: has joined #RubyOnRails
[17:08:04] ELCALOR_: has joined #RubyOnRails
[17:08:05] bga57: has joined #RubyOnRails
[17:08:05] Gkj8899: has joined #RubyOnRails
[17:08:06] patrick_star_2: has joined #RubyOnRails
[17:08:10] Gkj8899: has joined #RubyOnRails
[17:08:19] armyriad: has joined #RubyOnRails
[17:08:23] gaf_: has joined #RubyOnRails
[17:08:30] Seich: has joined #RubyOnRails
[17:09:10] mcr-credil: has joined #RubyOnRails
[17:09:19] ctrlrsf: has joined #RubyOnRails
[17:10:18] AntiSpamMeta: has joined #RubyOnRails
[17:10:21] rails677: has joined #RubyOnRails
[17:10:38] barajasfab: has joined #RubyOnRails
[17:12:29] moei: has joined #RubyOnRails
[17:12:52] rails677: Hello :) Can someone help me with Capistrano and Rails ? I'm loosing my mind right now..
[17:13:01] smathy: rails677, !ask2ask
[17:13:01] helpa: rails677: Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[17:13:16] drbayer: has joined #RubyOnRails
[17:13:44] rails677: Errr :) A command send by Capistrano can read environment variable ? like export BLBL="blbl"
[17:14:11] adlerdias: has joined #RubyOnRails
[17:14:26] baweaver: has joined #RubyOnRails
[17:14:34] Didac: has joined #RubyOnRails
[17:14:41] rickmasta: has joined #RubyOnRails
[17:14:57] alxndr: has joined #RubyOnRails
[17:15:11] smathy: rails677, yes, but cap uses a non-interactive, non-login shell, which doesn't read any startup files in, so probably that env var isn't set.
[17:15:17] sneakerhax: has joined #RubyOnRails
[17:15:49] SuppliedRelic: has joined #RubyOnRails
[17:15:54] rails677: smathy: So I can't reference my database password with a <
[17:16:05] rails677: smathy: So I can't reference my database password with a <%= ENV[''] %> ?
[17:16:40] benlieb: has joined #RubyOnRails
[17:17:07] CornishPasty: has joined #RubyOnRails
[17:17:28] upgrayeddd: has joined #RubyOnRails
[17:17:30] ebryn: has joined #RubyOnRails
[17:17:33] deeprave: has joined #RubyOnRails
[17:18:12] jxf: has joined #RubyOnRails
[17:18:20] nyandoge: has joined #RubyOnRails
[17:18:48] smathy: rails677, assuming you set that env var in a startup file on the server, like /etc/bashrc or /etc/profile or whatever then, as I said, no - those are not read by the non-interactive, non-login shell that cap uses.
[17:19:03] yellow5: has joined #RubyOnRails
[17:19:08] daxroc: has joined #RubyOnRails
[17:19:08] smathy: rails677, use the default_env setting in Cap to either set BASH_ENV or the specific vars you want.
[17:19:26] smathy: rails677, this page might help explain things: http://capistranorb.com/documentation/faq/why-does-something-work-in-my-ssh-session-but-not-in-capistrano/
[17:19:27] sdn90: has joined #RubyOnRails
[17:19:31] rails677: smathy: Thanks, I will look into it ;)
[17:21:27] daemonwrangler: has joined #RubyOnRails
[17:22:11] gheegh: has joined #RubyOnRails
[17:22:14] jcp: has joined #RubyOnRails
[17:22:50] roshanavand: has joined #RubyOnRails
[17:22:59] choke: has joined #RubyOnRails
[17:23:27] Sadin: has joined #RubyOnRails
[17:23:38] hjdivad: has joined #RubyOnRails
[17:23:51] amitchellbullard: has joined #RubyOnRails
[17:23:56] jcugno_: has joined #RubyOnRails
[17:23:58] siaW: has joined #RubyOnRails
[17:24:59] RegulationD: has joined #RubyOnRails
[17:26:54] User458764: has joined #RubyOnRails
[17:27:25] roshanavand1: has joined #RubyOnRails
[17:27:50] User458764: has joined #RubyOnRails
[17:29:36] finnnnnnnnnnn: has joined #RubyOnRails
[17:32:14] baweaver: has joined #RubyOnRails
[17:33:25] mcr-credil: I'm trying to make sprokets 3 work with cap3 and rails4. I think that I'm missing something: shouldn't the public/assets/.sprokets-manifest-FOO.js get deployed to my application servers... as maybe config/manifest.js?
[17:34:22] jottr: has joined #RubyOnRails
[17:34:42] mcr-credil: once I do that, things work great.
[17:34:49] mcr-credil: so I think that I'm missing something.
[17:35:21] Scient: whats you actual error message
[17:36:00] SteenJobs: smathy: having problem with sizing when setting background image for the label - i need the custom button positioned next to the label’s text…i guess i could include the text in the custom image asset instead of having custom image + text in the html, and this way i’d be dealing with a single element
[17:36:35] RegulationD: has joined #RubyOnRails
[17:36:53] smathy: SteenJobs, positioning is part of the background image CSS features.
[17:37:13] cnk: has joined #RubyOnRails
[17:37:28] bronson: has joined #RubyOnRails
[17:37:30] SteenJobs: smathy: yes, but the html is <label><input>some text</label>, so if background-image on <label> is set, it has no way of being aware of the “some text"
[17:38:01] Ergo: has joined #RubyOnRails
[17:38:52] smathy: SteenJobs, no, you'd need to position the background on label and then add an appropriate padding to label, or margin to input so the text didn't overlap the image.
[17:39:55] eyeamaye: has joined #RubyOnRails
[17:40:48] SteenJobs: well input’s visiblity is hidden, but regardless, if some text is contained within <label>, then setting the background-image on <label> and getting it to position nicely with child, rather than sibling, elements is suuuuper hacky. I think what i might do is add an additionl <label> as a sibling of input and “some text”, and set the background image to that element.
[17:40:57] DoctorMonocular: has joined #RubyOnRails
[17:42:25] uglybandersnatch: has joined #RubyOnRails
[17:43:21] SteenJobs: smathy: and on top of that, safari is cutting off the right edge of the background image for some unknown reason
[17:45:05] tildes_: has joined #RubyOnRails
[17:45:52] smathy: SteenJobs, yep, welcome to web front-end.
[17:46:01] smathy: We're way off topic now though.
[17:46:05] SteenJobs: and the weirdest changes make it cooperate
[17:46:34] camilasan: has joined #RubyOnRails
[17:48:22] DragonPunch: has joined #RubyOnRails
[17:49:53] ivanskie: has joined #RubyOnRails
[17:52:56] DragonPunch: has joined #RubyOnRails
[17:52:57] adre: has joined #RubyOnRails
[17:53:22] gingray: has joined #RubyOnRails
[17:54:10] kirillzh: has joined #RubyOnRails
[17:54:35] jsrn: has joined #RubyOnRails
[18:00:02] meoblast001: has joined #RubyOnRails
[18:02:25] a1fa: has joined #RubyOnRails
[18:02:40] a1fa: ughh.. coffeescript... grr ;( how do you pass datatype via ajax coffeescript?
[18:03:36] a1fa: i'm using coffeescript + $.ajax to call Controller#export that does format.csv, i thought datatype: "csv" would do the trick
[18:03:41] tubbo: a1fa: !code
[18:03:41] helpa: a1fa: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[18:04:01] blackmesa: has joined #RubyOnRails
[18:04:34] a1fa: tubbo: working on it ;)
[18:04:39] rubyonrails771: has joined #RubyOnRails
[18:04:46] krainboltgreene: has joined #RubyOnRails
[18:05:20] krainboltgreene: I have a weird situation. Adding `default_scope { order(created_at: :desc) }` creates a really weird `WHERE` query.
[18:05:21] a1fa: https://gist.github.com/anonymous/c0b87d88029523e2940b9075cf6c54fc
[18:05:36] krainboltgreene: `... WHERE "v2_activities"."id" IN (SELECT "v2_activities"."id" FROM "v2_activities" ORDER BY "v2_activities"."created_at" DESC)`
[18:05:42] krainboltgreene: I'm not sure why it's doing that.
[18:06:25] sdwrage: has joined #RubyOnRails
[18:08:12] herpless: has joined #RubyOnRails
[18:09:05] tubbo: krainboltgreene: you mean you don't know why it's adding the WHERE
[18:09:16] petor: has joined #RubyOnRails
[18:09:19] smathy: a1fa, "csv" is not a mime type.
[18:09:34] krainboltgreene: tubbo: That's what I said, yes.
[18:09:38] dpg1: has joined #RubyOnRails
[18:10:03] a1fa: smathy: so i guess it needs to be added into config/initializers/mime_types.rb
[18:10:40] smathy: a1fa, also, there's a much more reliable way of requesting a certain format, you've seen your `rake routes` right? Remember the (.:format) on the end of every path?
[18:10:43] B1n4r10: has joined #RubyOnRails
[18:10:47] tubbo: krainboltgreene: i see
[18:10:54] IrishGringo: has joined #RubyOnRails
[18:11:01] a1fa: smathy: i see
[18:11:06] dpg1: has left #RubyOnRails: ()
[18:12:00] a1fa: doh. now i see even better, thanks smathy
[18:12:03] tubbo: krainboltgreene: i can't think of a good reason why rails would do that, other than to isolate default_scope from being overridden by another part of the query..
[18:12:16] davee_: has joined #RubyOnRails
[18:12:21] krainboltgreene: Right? Like, as soon as I remove the default scope it goes back to normal.
[18:12:39] krainboltgreene: Plus, now I'm noticing all the queries relating to this model have a huge space between the order and the query.
[18:12:48] a1fa: smathy: that did it
[18:13:29] tubbo: krainboltgreene: yeah that's pretty weird. though i would argue that it's probably not a good idea to use default_scope in order to enforce ordering.
[18:13:33] smathy: a1fa, cool.
[18:14:11] baweaver: has joined #RubyOnRails
[18:14:43] tubbo: you can either create a scope to always order by e.g. V2::Activity.latest, or configure your DB to return results by date created (i *think* this is possible with postgres)
[18:14:46] n008f4g_: has joined #RubyOnRails
[18:16:42] a1fa: smathy: now i just need to figure out how to build an array to submit out of the selection
[18:16:57] krainboltgreene: tubbo: I mean, what's the alternative? `id` isn't a good sort for me.
[18:17:19] krainboltgreene: Adding a scope is annoying, I'll look into the postgres thing.
[18:18:53] tubbo: krainboltgreene: that might return all results ordered by date created, fwiw
[18:19:07] tubbo: i know we had that enabled at a past job i worked at, which was really useful *most of the time* :)
[18:19:15] tubbo: for other times, you can just order(created_at: :asc) for example
[18:19:32] krainboltgreene: Well yeah, I know how to manually order haha.
[18:19:39] smathy: krainboltgreene, !gist your model, and the `rails console` session showing the command you're running and showing the SQL.
[18:19:39] helpa: krainboltgreene: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[18:20:10] baweaver: has joined #RubyOnRails
[18:20:11] krainboltgreene: Sure, here you go smathy: https://github.com/rails/rails/issues/24360
[18:20:18] smathy: I'm surprised that what you're showing actually orders the results properly.
[18:20:23] a1fa: issues.push $('input[id="issues_"]').value
[18:20:31] a1fa: something along those lines
[18:20:38] krainboltgreene: To be fair, I could care less about ordering in an update_all.
[18:20:46] krainboltgreene: I guess it can't figure that out without being More Smart.
[18:20:49] smathy: krainboltgreene, that issue showed nothing like what you're talking about.
[18:20:56] krainboltgreene: smathy: It absolutely does.
[18:21:20] smathy: Oh sorry, it's on update.
[18:21:24] smathy: Why would you care?
[18:21:32] a1fa: issues = (x.value for x in $('input[id="issues_"]'))
[18:21:35] a1fa: ^ even better
[18:21:36] krainboltgreene: smathy: It adds 8s to the query?
[18:21:37] tubbo: yeah this looks weird but...i'm a little confused as to whether this is actually a problem you need to solve right now
[18:21:47] tubbo: vs. just a weird bug that should *probably* be fixed.
[18:21:51] krainboltgreene: This is a pretty big table.
[18:22:09] smathy: 8 seconds!?!?!
[18:22:10] krainboltgreene: I've opted to just remove the default scope.
[18:22:23] tubbo: that's probably a better choice overall anyway
[18:22:25] smathy: krainboltgreene, is your created_at not indexed?
[18:22:27] tubbo: krainboltgreene: !default_scope
[18:22:27] helpa: krainboltgreene: http://www.innovationontherun.com/activerecord-default_scope-is-an-anti-pattern/
[18:22:43] krainboltgreene: Can yall stop sending me links? :P
[18:23:01] tubbo: krainboltgreene: sure, more rails jobs for me :)
[18:23:04] krainboltgreene: smathy: Definitely indexed.
[18:23:10] smathy: Wow, terrible.
[18:23:16] smathy: (must be a huge table)
[18:23:22] krainboltgreene: It's a very large table.
[18:23:31] krainboltgreene: We went overboard on tracking activities, haha.
[18:23:34] cnk: I guess the question is, is it harder to add lots of order by clauses - or to figure out how to remove them in the minority of cases where they are not only not needed but actually harmful
[18:23:46] tubbo: krainboltgreene: hehe if i stop sending you links, you'll get fired and won't be a rails dev anymore? ;-)
[18:24:09] cnk: Hi Kurtis
[18:24:20] tubbo: krainboltgreene: yeah you did...it might be possible to store this info in a lighter document-oriented DB of some kind.
[18:24:38] dionysus69: has joined #RubyOnRails
[18:24:49] krainboltgreene: tubbo: I doubt my job is dependant on the links I receive D:
[18:24:58] smathy: krainboltgreene, so yeah, either take out the default scope and add a named scope for your reads, or change your writes to use: V2::Activity.unscoped.update_all ...
[18:25:01] krainboltgreene: I'll have to re-read my contract!
[18:25:03] smathy: krainboltgreene, not sure which would be easier.
[18:25:22] krainboltgreene: Wait, is this because update all can't take an order?
[18:25:31] krainboltgreene: So like, arel is doing it's best to include an order?
[18:25:42] krainboltgreene: Haha, wonderful.
[18:25:52] sypheren: has joined #RubyOnRails
[18:25:57] cnk: we work hard so you don't have tooooooo
[18:26:00] smathy: Rails is stupid, you can't have your default scope only for reads - which is actually the most useful default scope.
[18:26:06] Macaveli: has joined #RubyOnRails
[18:26:27] krainboltgreene: Honestly, I've been neck deep in node ORMs and I miss all the thinks AR is smart about.
[18:26:35] krainboltgreene: But this is kinda funny, anyways thanks all!
[18:26:49] smathy: krainboltgreene, you can imagine that if the default scope was actually something like: { confirmed: true } that the update_all with the sub-select would make sense.
[18:26:56] smathy: ...to restrict which records were being updated.
[18:27:02] sandstrom: has joined #RubyOnRails
[18:27:26] cnk: I have been missing AR too. I need to get around to trying some of the things I have been struggling with Django's ORM about just to see if it is really easier in AR
[18:28:22] King_Rex: has joined #RubyOnRails
[18:28:51] smathy: I actually wish there was a `default_order` method, rather than `default_scope`, ordering is the only thing I ever want on by default, and if Rails knew it was just ordering then it could know to ignore it for writes.
[18:29:06] matthewd: IMO putting an order on an association will often give a similar level of "just works", with less of the .. complications of a default_scope
[18:29:12] smathy: ...there's probably a gem.
[18:29:56] smathy: ...assuming you're only ever accessing the records through that association.
[18:30:12] matthewd: Right. Thus "often".
[18:30:30] smathy: Often can be worse than never.
[18:30:40] smathy: ...but yeah, could be a good fit for a lot of use cases.
[18:31:10] krainboltgreene: In this case the activities have a primary key that isn't orderable.
[18:31:18] krainboltgreene: So the real default order, by `id`, is useless.
[18:31:36] matthewd: e.g., in the case of an activity feed, barring weird superuser magic, you're probably ~always doing user.activities or thing.activities
[18:32:28] matthewd: The `id` "default" only applies if you call #first on an unordered relation, though, right?
[18:35:09] jottr: has joined #RubyOnRails
[18:35:58] krainboltgreene: If I added a scope that only hurts just because of first, that's hilarious.
[18:38:17] a1fa: smathy: uhhh. now i am getting uninitialized constant Issue::CSV. i added require 'csv' into config/application.rb following this guide: http://railscasts.com/episodes/362-exporting-csv-and-excel
[18:38:30] a1fa: i can also log into console and do CSV.methods, and that works
[18:38:44] iuuso: has joined #RubyOnRails
[18:39:16] srinidhi: has joined #RubyOnRails
[18:39:26] smathy: a1fa, restart your app, restart spring.
[18:40:14] a1fa: genius, +++1 that worked
[18:40:23] a1fa: i thought i restarted it
[18:40:26] tubbo: if i were you, i'd also `require 'csv'` from in your model file.
[18:40:26] a1fa: thank you
[18:40:31] edwinvdgraaf: has joined #RubyOnRails
[18:42:19] finnnnnnnnnnn: has joined #RubyOnRails
[18:44:16] edwinvdgraaf: has joined #RubyOnRails
[18:48:58] netzfisch: has joined #RubyOnRails
[18:49:37] b|ackwolf: has joined #RubyOnRails
[18:51:23] mDuff: has joined #RubyOnRails
[18:52:14] b|ackwolf: I read ruby on rails get started guide. Is it a good idea to read Michael Hartl's book (Ruby on Rails Tutorial: ...)?
[18:52:16] Devalo: has joined #RubyOnRails
[18:52:43] fryguy: b|ackwolf: seems fine
[18:52:57] Irikos: has joined #RubyOnRails
[18:53:09] a1fa: well, this thing is working, but i dont like it .. lines 13,14 are so ugly
[18:53:11] a1fa: https://gist.github.com/anonymous/d763ca350eb0b7605a9272feadb76d34
[18:53:36] b|ackwolf: fryguy, how about just reading other guides?
[18:54:13] fryguy: b|ackwolf: i'd probably just start writing code and look up things as necessary
[18:54:26] hxegon: has joined #RubyOnRails
[18:54:31] b|ackwolf: fryguy, thanks for your mention :D
[18:55:24] Cohedrin_: has joined #RubyOnRails
[18:56:57] Macaveli: has joined #RubyOnRails
[18:58:23] context: 13. 14 looks fine, except maybe the hardcoded filename
[18:58:31] TheGreatGudsby: has joined #RubyOnRails
[18:58:56] adlerdias: has joined #RubyOnRails
[18:59:11] mdw: has joined #RubyOnRails
[18:59:12] smathy: b|ackwolf, FWIW, I disagree. I don't like Hartl's tutorial, and I definitely think you should do a tutorial rather than just starting to write code and looking things up as necessary. I'd recommend either Agile Web Development with Rails or Rails 4 in Action.
[19:00:48] smathy: a1fa, so make both lines into: open_csv( data ) and put that logic in a function elsewhere.
[19:02:41] moeabdol2: has joined #RubyOnRails
[19:03:56] hotpancakes: has joined #RubyOnRails
[19:06:43] MuffinPimp: has joined #RubyOnRails
[19:12:19] Terens: hello. how can I send view into json?
[19:12:30] context: add .json to the url ?
[19:12:59] siaW: has joined #RubyOnRails
[19:13:01] a1fa: smathy: window.open is something i didnt like
[19:13:12] a1fa: smathy: someone suggested using jquery download attribute
[19:13:22] a1fa: $(this).attr 'download': 'export.csv', 'href': csvData, 'target': '_blank'
[19:13:26] a1fa: but i cant get this one to work
[19:13:36] eichenwald: has joined #RubyOnRails
[19:13:49] a1fa: it compiles correctly
[19:14:18] a1fa: reference: https://jsfiddle.net/terryyounghk/kpegu/
[19:14:39] MuffinPimp: has joined #RubyOnRails
[19:15:32] baweaver: has joined #RubyOnRails
[19:16:32] yfeldblum: has joined #RubyOnRails
[19:17:05] a1fa: my guess is $(this) could be a null reference
[19:17:13] smathy: Dunno, check it.
[19:17:15] a1fa: but, i even tried with $(document)
[19:17:30] a1fa: checking on coffeescript.org, much faster ;)
[19:17:54] pawnbox: has joined #RubyOnRails
[19:18:22] djgraham|calypso: has left #RubyOnRails: ()
[19:18:34] djgraham: has joined #RubyOnRails
[19:18:52] manfrin: has joined #RubyOnRails
[19:19:13] eregi: has joined #RubyOnRails
[19:19:22] a1fa: going to stop by coffeescript channel to see if anyone is around there
[19:19:35] a1fa: i think this is a jquery problem thing
[19:19:35] ravster: has joined #RubyOnRails
[19:20:30] SteenJobs: has joined #RubyOnRails
[19:20:39] robbyoconnor: has joined #RubyOnRails
[19:21:31] pramsky: has joined #RubyOnRails
[19:21:36] eregi: Hi guys! Any ideas how to preserve trailing slashes in the URLs? I'm using the following route " get 'abc/:path' => 'abc#func', as: :my_func, :constraints => {:path => /.*/ }", however when accessing abc/BB/ the :path will be set to BB not BB/
[19:21:55] epochwolf: eregi: that's how rails works.
[19:23:23] eregi: epochwolf, is there no reasonable way to change the behaviour? I'm building a directory tree browser and it would be great to avoid params and I need the slash at the end to determine whether a file or a folder has been requested.
[19:23:28] benlieb: has joined #RubyOnRails
[19:23:52] context: well something that be a file AND a folder
[19:24:13] epochwolf: eregi: iirc file systems don't allow files and directories to have the same name
[19:24:14] blackmesa: has joined #RubyOnRails
[19:24:17] context: you should be able to tell whether they are requesting a file or folder based off what they are infact requesting
[19:24:39] stannard: has joined #RubyOnRails
[19:24:45] context: s/that/cant/
[19:25:22] dionysus69: has joined #RubyOnRails
[19:25:51] epochwolf: eregi: you might be able to make it work but you'll be fighting the framework at every step.
[19:26:21] eregi: context, agree.
[19:27:26] eregi: epcohwolf, yeah, that's what I'm afraid of..
[19:27:46] epochwolf: eregi: http://www.jumph4x.net/post/16395866916/ensuring-a-trailing-slash-in-rails-wout
[19:27:55] jayp: has joined #RubyOnRails
[19:28:20] epochwolf: It doesn't look like the router will handle trailing slashes for you but you can check the request headers directly.
[19:28:48] context: eregi: im saying, if someone requests /abc/home (for /home) you KNOW that /home is a dir because well.... it IS a dir.
[19:29:29] mdw7: has joined #RubyOnRails
[19:29:53] eregi_: has joined #RubyOnRails
[19:30:16] context: it cant also be a file. and you KNOW this by using methods such as File.directory? and File.file?
[19:30:17] finnnnnnnnnnn: has joined #RubyOnRails
[19:33:54] mostlybadfly: has joined #RubyOnRails
[19:34:16] choke: has joined #RubyOnRails
[19:34:22] mustmodify_: has joined #RubyOnRails
[19:35:11] robbyoconnor: has joined #RubyOnRails
[19:37:12] jottr: has joined #RubyOnRails
[19:37:48] Devalo: has joined #RubyOnRails
[19:37:57] bronson: has joined #RubyOnRails
[19:38:20] eregi: has joined #RubyOnRails
[19:38:40] sdwrage: has joined #RubyOnRails
[19:41:16] baweaver: has joined #RubyOnRails
[19:46:05] helpa: has joined #RubyOnRails
[19:48:58] DoctorMonocular: has joined #RubyOnRails
[19:49:42] eregi: has joined #RubyOnRails
[19:49:58] context: https://ghostbin.com/paste/9fhuc - can i avoid the scope call some how seeing as children is embedded? :-/
[19:51:07] context: i guess i can do controller: 'parents/children'
[19:51:09] context: still seems wierd
[19:54:06] zave: has joined #RubyOnRails
[19:54:11] rickmasta: has joined #RubyOnRails
[19:54:40] blackmesa: has joined #RubyOnRails
[19:55:10] n008f4g_: has joined #RubyOnRails
[19:56:46] jenrzzz: has joined #RubyOnRails
[19:56:46] jenrzzz: has joined #RubyOnRails
[19:57:52] baweaver: has joined #RubyOnRails
[19:59:33] lyoshajapan: has joined #RubyOnRails
[20:00:28] diegoaguilar: has joined #RubyOnRails
[20:00:57] SeductiveError: has joined #RubyOnRails
[20:01:45] epochwolf: context: not really.
[20:01:49] TheGreatGudsby: has joined #RubyOnRails
[20:02:47] hahuang61: has joined #RubyOnRails
[20:03:11] jstransky: has joined #RubyOnRails
[20:03:50] rickmasta: has joined #RubyOnRails
[20:03:56] arup_r: has joined #RubyOnRails
[20:04:31] jtong: has joined #RubyOnRails
[20:09:08] mustmodify_: has left #RubyOnRails: ()
[20:10:13] ur5us: has joined #RubyOnRails
[20:10:16] lyoshajapan: has joined #RubyOnRails
[20:11:21] CodaBrink: has joined #RubyOnRails
[20:12:35] TheGreatGudsby: has joined #RubyOnRails
[20:13:41] tubbo: has joined #RubyOnRails
[20:13:54] DoctorMonocular: has joined #RubyOnRails
[20:15:07] rickmasta: has joined #RubyOnRails
[20:15:56] jtong_: has joined #RubyOnRails
[20:16:01] hxegon: has joined #RubyOnRails
[20:16:08] dopie: has joined #RubyOnRails
[20:19:46] siaW: has joined #RubyOnRails
[20:19:54] polyidus: has joined #RubyOnRails
[20:20:12] eregi: has joined #RubyOnRails
[20:20:44] Frem: has joined #RubyOnRails
[20:21:05] chipotle: has joined #RubyOnRails
[20:21:20] SeductiveError: anyway to DRY up controllers in a dashboard and api engine that utilize same models, with different data presentation? Currently there are two sets of logic and I'd like there to be one.
[20:21:54] TheGreatGudsby: has joined #RubyOnRails
[20:23:15] tubbo: SeductiveError: !vague
[20:23:15] helpa: SeductiveError: Your question has just been deemed vague; please consider rewording it. It may also help to give us any relevant code or errors so that we may better assist you.
[20:23:42] arBmind: has joined #RubyOnRails
[20:26:35] SeductiveError: tubbo sure. I have a dashboard engine that will be used as a front end for admins to create events for the users of main site to sign up to. I have the events in its own API engine because I'd like to add to other applications as needed. Currently, I have a controller for both JSON (API) and the HTML (dashboard), one in each engine. They essentially do the same thing, so I'd like to DRY them up.
[20:27:34] tubbo: SeductiveError: why not make a single controller called EventsController that both the admin and the API use?
[20:27:46] SeductiveError: tubbo they are in separate engines
[20:28:46] tubbo: SeductiveError: without a single library inherited by both engines, i'm not sure how you'd do that.
[20:29:13] SteenJobs: https://gist.github.com/jesiegel1/fbe58adc93af8deec4ea8f6237717619#file-controller-rb-L15 => if my create action fails, and i want to (re)render the current view using the controller’s new action, but my view template is NOT called “new.html.erb” (the current view is rendered dynamically by the controller), how can i do this? in theory i can just render params[:current_stage_num] from within the create action, but i’d ra
[20:29:14] SteenJobs: keep that logic in the new action and call the new action from create should create fail
[20:29:26] SeductiveError: tubbo only way would be to write a client side application to consume the api, but I hate that it would stray away from rails
[20:30:14] SteenJobs: *also ignore the stage_num assignment, i fixed it. wasn’t paying attention ha
[20:31:31] sdwrage: has joined #RubyOnRails
[20:32:07] arup_r: has joined #RubyOnRails
[20:32:19] jenrzzz: has joined #RubyOnRails
[20:32:20] jenrzzz: has joined #RubyOnRails
[20:32:56] qhp_: has joined #RubyOnRails
[20:33:19] Aswebb_: has joined #RubyOnRails
[20:33:54] eregi: context, theoretically something with a slash at the end could be a file since we are using s3 and there's no general difference between files and directories, S3 doesn't have a real concept of dirs.
[20:35:01] smathy: SteenJobs, def stage_num; params[:current_stage_num] || "stage_1"; end
[20:35:20] sypheren: has joined #RubyOnRails
[20:36:01] SteenJobs: smathy: right, missed that - but it’s not the error - i’m getting a no template error, since the template is called #{stage_num}, but in #create, when i call render :new, it looks for MyController/new.html.erb
[20:37:32] patrick-sartent: has joined #RubyOnRails
[20:37:41] SteenJobs: smathy: so while i can just call stage_num, from your well made point, within #create, i’d rather render #new and call stage_num from there…but rendering #new automatically looks for new.html.erb
[20:38:02] jottr: has joined #RubyOnRails
[20:38:41] smathy: [13:27:46] epochwolf: eregi: http://www.jumph4x.net/post/16395866916/ensuring-a-trailing-slash-in-rails-wout
[20:40:01] smathy: SteenJobs, my point was to move that code into the stage_num method and then in both new and create you can call: render stage_num
[20:40:20] SteenJobs: ok yea that’s clean enough
[20:40:39] defsdoor: has joined #RubyOnRails
[20:41:30] SteenJobs: smathy: although out of curiosity, is there a way to render a controller action without it looking for a template with the same name as the action?
[20:42:47] kirillzh: has joined #RubyOnRails
[20:42:51] smathy: SteenJobs, you're not rendering a controller action, you're rendering a view.
[20:43:17] SteenJobs: right - but if one wants to call a controller action, you’d use render as well, no? (render action: :some_action)
[20:43:22] Sdwrage_: has joined #RubyOnRails
[20:43:25] SteenJobs: but yea, i guess it really is totally limited to the view
[20:43:39] SteenJobs: which is why your method makes it really tight
[20:47:30] sudoubuntu: has joined #RubyOnRails
[20:47:58] drbayer: has joined #RubyOnRails
[20:48:12] jkahn: has joined #RubyOnRails
[20:56:00] FooMunki: has joined #RubyOnRails
[20:56:27] jottr: has joined #RubyOnRails
[20:57:22] choke: has joined #RubyOnRails
[21:00:07] polyidus: has joined #RubyOnRails
[21:00:23] hahuang61: has joined #RubyOnRails
[21:06:00] sonOfRa: has joined #RubyOnRails
[21:07:11] David_H_Smith: has joined #RubyOnRails
[21:09:00] DragonPunch: token ? next : head status: forbidden does this line make sense?
[21:12:39] tubbo: DragonPunch: no
[21:12:54] tubbo: i guess it does
[21:12:57] tubbo: but use more parens :)
[21:13:26] tubbo: DragonPunch: if that's in a loop, which i assume it is because of `next`, then that's probably gonna work
[21:16:40] russt: has joined #RubyOnRails
[21:19:10] baweaver: has joined #RubyOnRails
[21:20:29] Trynemjoel: has joined #RubyOnRails
[21:20:39] Hates_: It makes some sense but it's not very readable IMO
[21:20:59] uglybandersnatch: has joined #RubyOnRails
[21:21:02] sypheren: has joined #RubyOnRails
[21:21:23] TheGreatGudsby: has joined #RubyOnRails
[21:21:57] Dimik: is there a way to run shell commands from ror ?
[21:22:01] Radar: GOOD MORNING.
[21:22:24] adaedra: That was a nice hat.
[21:22:35] Radar: It was, but if I wear it too much it stretches.
[21:22:46] DragonPunch: Hubbo & Hates_: http://puu.sh/nYFk0/7140ee7702.png
[21:22:56] DragonPunch: It's not in a loop, will that work?
[21:23:02] Radar: Dimik: `shell command goes here`
[21:23:25] Dimik: i'm not following
[21:23:37] Radar: Dimik: back-tick, shell command goes here, another back-tick.
[21:23:44] Radar: Dimik: alternatively: system("command goes here")
[21:23:49] Dimik: are you serious or are you pulling my leg right now
[21:23:52] Radar: Dimik: !try
[21:23:52] helpa: Dimik: Why don't you try it and find out for yourself?
[21:26:56] DragonPunch: tubbo & Hates_: http://puu.sh/nYFk0/7140ee7702.png
[21:27:05] Trynemjoel: has joined #RubyOnRails
[21:27:51] tubbo: DragonPunch: that's not gonna work, any time you run a method that renders a response (render/respond_to/respond_with/head/etc.), you need to return out so the rest of the method won't execute, otherwise you'll get an error.
[21:28:10] tubbo: DragonPunch: also, the `next` keyword...what is that referring to?
[21:28:18] DragonPunch: I think i'd better use if statements
[21:28:31] ivanskie: has joined #RubyOnRails
[21:29:29] stannard: has joined #RubyOnRails
[21:31:06] baweaver: or actually read a book on ruby/rails
[21:32:07] mrchris: has joined #RubyOnRails
[21:33:18] Irikos: has joined #RubyOnRails
[21:34:31] Spami_: has joined #RubyOnRails
[21:34:47] b|ackwolf: smathy, I'll go for rails 4 in action. (I've read the David Black's book too)
[21:34:58] wldcordeiro: has joined #RubyOnRails
[21:35:24] tubbo: DragonPunch: yeah you might want to read some actual books or tutorials because it will give you example code.
[21:35:41] tubbo: DragonPunch: `next` isn't valid here
[21:36:40] agit0: has joined #RubyOnRails
[21:37:23] b|ackwolf: DragonPunch, there's no generator there.
[21:37:32] Radar: b|ackwolf: Rails 4 in Action is a good book.
[21:38:04] b|ackwolf: Radar, thanks. I really love Manning books :D
[21:38:15] Radar: b|ackwolf: Books are great, shame about the company itself.
[21:38:17] tubbo: DragonPunch: sorry...if this wasn't clear, `next` is only valid in a loop.
[21:38:21] gheegh: has joined #RubyOnRails
[21:38:25] Radar: b|ackwolf: http://ryanbigg.com/2015/08/my-self-publishing-success-story/
[21:39:13] Devalo: has joined #RubyOnRails
[21:39:53] Radar: b|ackwolf: My favourite part are the two graphs and two pie charts in this section http://ryanbigg.com/2015/08/my-self-publishing-success-story/#royalties
[21:39:54] bronson: has joined #RubyOnRails
[21:39:58] b|ackwolf: Radar, oh, I don't know much about publishing problems but as you mentioned books are still good.
[21:40:35] Trynemjoel: has joined #RubyOnRails
[21:41:06] yfeldblum: has joined #RubyOnRails
[21:43:20] __foobar__: has joined #RubyOnRails
[21:44:27] rubyonrails163: has joined #RubyOnRails
[21:45:01] tubbo: __foobar__: hai
[21:45:08] tubbo: why do people do this
[21:45:10] __foobar__: Hey, I had a question.
[21:45:18] tubbo: has anyone ever had an issue with irc in which they just typed stuff and nothing happened?
[21:45:39] Radar: __foobar__: lets have a meeting to decide when to have the meeting to discuss the kickoff for the setup meeting
[21:46:01] __foobar__: So I ran into this bug today, it involved the precompile assets. I think this is more javascript oriented, but I received no answer in the #javascript room.
[21:46:04] Radar: tubbo: Yes. If you type stuff in here as an unregistered user it doesn't show up. It's why we don't get the KKK spammers like #ruby does.
[21:46:13] tubbo: never mind
[21:46:37] myntcake: has joined #RubyOnRails
[21:46:52] __foobar__: Anyways, the main thing is that Uglifier does not like this snippet: var a = "foo"; var b = {a}; // b -> {a: "foo"}
[21:47:27] __foobar__: I've tried it in a few browsers and it seems to be valid javascript.
[21:47:50] __foobar__: I was wondering if this kind of object instantiation had a name, or if there was a reason that Uglifier doesn't account for it
[21:48:01] hotpancakes: has joined #RubyOnRails
[21:48:11] tubbo: __foobar__: define "does not like"
[21:48:18] rubyonrails163: hey guys, can anyone tell me what I should google for how to make youtube-like routing in the form https://www.youtube.com/watch?v=<string>
[21:48:33] __foobar__: It fails, gives a specific message. It expects a ":" because a key needs to point to a value
[21:48:49] rubyonrails163: i want any user to be able to create a publicly viewable page and its sort of similar to how youtube videos work
[21:48:58] __foobar__: ExecJS::ProgramError: Unexpected token punc «}», expected punc «:» (line: 588, col: 93, pos: 19159)
[21:49:35] __foobar__: uglifier (2.7.2)
[21:49:42] Radar: __foobar__: what ve... too quick.
[21:49:50] Radar: Try 3.0.0?
[21:50:46] rubyonrails163: obviously every user will have a url:string which is a randomly generated 10-char long string but idk how to effectively route incoming requests to that users page
[21:50:52] tubbo: __foobar__: oh yeah, because {a} is not valid JS afaik
[21:51:11] tubbo: __foobar__: like what sense does that make, right? is "foo" the key or value?
[21:51:30] __foobar__: I mean, it works in the browsers that I tested
[21:51:36] __foobar__: I'm not sure how to read the ECMA standard
[21:51:45] __foobar__: like, where I can find this specific rule
[21:51:52] Radar: __foobar__: Try uglifier 3.0?
[21:51:53] tubbo: __foobar__: that doesn't mean it's right...browsers can also parse html like this: <p><fuck-shit-up>yo yo yo</fuck-shit-up></p>
[21:51:58] tubbo: that doesn't mean the <fuck-shit-up> tag is valid HTMl
[21:52:09] tubbo: browsers are really good at covering for web developers' mistakes
[21:52:14] Radar: rubyonrails163: What have you tried?
[21:52:41] tubbo: also, reading the ECMA standards is a fool's errand unless you plan to write a JS interpreter, it's not really meant for implementing developer documentation..
[21:52:58] __foobar__: tubbo, well I just need to know if it's valid JS or not
[21:53:25] __foobar__: tubbo, *want
[21:53:30] tubbo: __foobar__: i wouldn't imagine it to be, no. what happens when you output b?
[21:53:38] tubbo: you're not specifying a key htere
[21:53:50] __foobar__: Same error on 3.0
[21:53:53] owenjones: has joined #RubyOnRails
[21:53:59] tubbo: __foobar__: is there an issue with you just doing { a: a }?
[21:54:00] finnnnnnnnnnn: has joined #RubyOnRails
[21:54:07] tubbo: because what you're doing here is not smart
[21:54:21] __foobar__: tubbo, No, there is no issue. This is more curiousity than anything.
[21:54:28] rubyonrails163: Radar: Well thats the thing, what im stuck at is finding a way to find what token id maps to a user
[21:54:36] __foobar__: tubbo, I found this while debugging a assets:precompile bug
[21:54:44] Radar: rubyonrails163: How are the tokens assigned?
[21:54:48] tubbo: __foobar__: ahh ok, yeah i'm not sure. just looks like shitty javascript to me.
[21:54:56] __foobar__: tubbo, the JSX precompiler was happy to let that through, but Uglifier doesn't like it
[21:55:00] Radar: tubbo: You could've left the "shitty" off. It's implied ;)
[21:55:14] __foobar__: But then I tried using it in browsers, and it works
[21:55:21] __foobar__: so I was wondering if Uglifier bug
[21:55:28] Radar: __foobar__: Maybe. File an issue about it and see?
[21:55:31] rubyonrails163: upon user creation, every user gets a SecureRandom.base64
[21:55:33] tubbo: __foobar__: nope. it's just preventing you from writing shitty javascript.
[21:55:34] matthewd: That is super-recent ecmascript syntax
[21:56:17] rubyonrails163: Radar: called url_suffix
[21:56:22] Radar: rubyonrails163: So User.find_by(url_suffix: params[:id])?
[21:56:24] __foobar__: Okay, I'll file a ticket
[21:56:39] rubyonrails163: Radar: will that work in routes.rb?
[21:56:47] Radar: rubyonrails163: That is controller code.
[21:58:27] workmad3_: __foobar__: it's an ecmascript6 style for object instantiation
[21:58:48] rubyonrails163: what about the routes? as the routing should redirect the token request to the users 'public' view
[21:59:32] ayonkhan: has joined #RubyOnRails
[21:59:41] workmad3_: __foobar__: so chances are, the JSX precompiler is leaving it because the JSX compiler only touches JSX pieces... but uglifier is generating parse-trees for JS, and is running on a JS VM that doesn't understand ES6 and so barfs
[21:59:52] georgedrummond: has joined #RubyOnRails
[22:00:14] workmad3_: __foobar__: i.e. it's not an uglifier problem, it's that you're using ES6 and trying to run it through older VMs without transpiling with something like babel first :)
[22:00:28] baweaver: has joined #RubyOnRails
[22:00:31] __foobar__: workmad3, I assumed this to be the case but then I ran the "invalid javascript" and it worked natively just fine leading me down this rabbithole.
[22:00:37] __foobar__: workmad3, thanks
[22:00:43] workmad3_: __foobar__: a lot of es6 is already supported in browsers
[22:01:01] workmad3_: __foobar__: but I don't think node.js (or libv6 in general) has gotten very far yet :)
[22:01:25] Radar: rubyonrails163: What action is that?
[22:01:36] workmad3_: __foobar__: and that means you're gonna have issues if you're using node.js or therubyracer for the asset pipeline
[22:02:38] creature: has joined #RubyOnRails
[22:02:38] creature: has joined #RubyOnRails
[22:03:04] __foobar__: workmad3, nah there's no issue. This was a syntax error that just happened to work and pass through the JSX unharmed.
[22:04:10] DragonPunch: What command do I run after updating a migration for the changes to take effect ?
[22:04:35] workmad3_: __foobar__: fair enough :) btw just checked... node 4.0+ supports that style of object literal, but node 0.12 and belowe doesn't
[22:04:44] Vircung: has joined #RubyOnRails
[22:05:34] __foobar__: workmad3, Yeap, I'm seeing the light now https://github.com/lukehoban/es6features#enhanced-object-literals
[22:05:41] Vircung: has joined #RubyOnRails
[22:05:43] __foobar__: Curiousity soothed
[22:05:53] workmad3_: I like http://kangax.github.io/compat-table/es6/ personally
[22:06:02] rubyonrails163: sorry for the confusion, by 'public' view i didnt mean the user had a view called public i just wanted to emphasize that im literally talking about a publically visible view, ie, /:token should map to /:id/read
[22:06:13] workmad3_: interestingly, chrome currently supports more of the es6 standard than babel + polyfills...
[22:06:42] workmad3_: s/polyfills/core-js/ (it's late, I didn't pay attention to what I was typing)
[22:06:44] alevy: has joined #RubyOnRails
[22:06:45] __foobar__: Those google boys are go-getters I tell you
[22:06:51] quazimodo: has joined #RubyOnRails
[22:09:44] workmad3_: I really hadn't realised es6 had gotten that good in browsers already tbh... if you only care about the cutting edge browsers, you can pretty much use es6 natively now (cutting edge == latest chrome, firefox, opera and MS Edge... safari appears to be lagging badly)
[22:10:05] ecksit: has joined #RubyOnRails
[22:10:33] apotry: has joined #RubyOnRails
[22:10:44] __foobar__: What is apple doing that's so important as to ignore es6?
[22:11:45] rubyonrails163: ohhhhhhhh i think i figured it out
[22:12:07] Vircung: has joined #RubyOnRails
[22:12:50] rubyonrails163: sorry Radar I'm new, thanks for making me think about it :)
[22:13:22] hahuang61: has joined #RubyOnRails
[22:14:18] ecksit: hey, what are some methods that a rails application can be catching all uncaught exceptions? i have looked for `rescue_from` but it doesn't appear anywhere in the codebase.
[22:14:49] Radar: ecksit: !explain
[22:14:49] helpa: ecksit: Please explain your problem better as we are having trouble understanding what you mean. A Gist (http://gist.github.com) is always helpful!
[22:16:18] ecksit: sure Radar. i'm using a third party exception tracker which uses middleware to capture all uncaught exceptions. however somewhere in the legacy code we are double sending it but i can't seem to find where/what is causing it.
[22:16:35] Radar: ecksit: !consultant
[22:16:35] helpa: ecksit: Your question, problem, and/or attitude requires more than free internet advice from an irc channel. May I suggest hiring a consultant or life coach?
[22:16:44] Radar: Impossible to help you without seeing the code.
[22:17:15] polyidus: has joined #RubyOnRails
[22:17:29] ecksit: i don't want you to solve it, just explain some of the ways that rails can catch uncaught exceptions.
[22:17:57] ecksit: then i can take a look through what i have and see if anything matches up
[22:18:24] ecksit: does that make sense?
[22:18:47] Radar: There are no ways that Rails catches uncaught exceptions.
[22:18:50] Radar: rescue_from is it.
[22:19:03] Radar: When Rails encounters an exception, it goes to the ... whatever that piece of middleware is called
[22:19:18] Radar: ActionDispatch::ExceptionWrapper.
[22:19:21] Radar: Look there?
[22:19:28] ecksit: ok, thanks. is there anything in ruby that could be doing something more?
[22:19:35] Kamuela: has left #RubyOnRails: ()
[22:19:40] chipotle: has joined #RubyOnRails
[22:19:59] ecksit: thanks - will check it out.
[22:21:45] wethu: has joined #RubyOnRails
[22:24:11] mikeiniowa: has joined #RubyOnRails
[22:25:38] matthewd: ecksit: I'd be looking for any app code that mentions the alleged 3rd party tracker -- e.g., inserting an extra middleware
[22:26:19] matthewd: ecksit: That is, don't try to track forward by guessing where it gets invoked... start with the thing you know is happening, and track backwards from there
[22:27:18] hnanon: has joined #RubyOnRails
[22:27:29] rubyonrailed: has joined #RubyOnRails
[22:28:26] blackmesa: has joined #RubyOnRails
[22:31:35] htmldrum: has joined #RubyOnRails
[22:31:36] htmldrum_: has joined #RubyOnRails
[22:33:29] SeductiveError: Is it okay for non-CRUD controllers to have methods such as home, about, contact, etc or should each page use its own controller?
[22:34:03] Aswebb_: has joined #RubyOnRails
[22:34:44] hnanon: I have this seed file:
[22:34:47] matthewd: SeductiveError: If they're just ~static pages, I wouldn't feel bad about throwing them all onto one controller
[22:35:01] hnanon: https://gist.github.com/anonymous/ad8e3b969187a0701d69668f6588318b
[22:35:49] SeductiveError: matthewd awesome, that is exactly what they are. I may use the presenter pattern however because I do need several different getter resources on one route
[22:35:51] matthewd: SeductiveError: Most other "non-CRUD" actions, OTOH, at least deserve a second look at whether there's actually a CRUD resource hiding inside
[22:36:01] hnanon: How can I loop through each file that is of the form cities_*.rb?
[22:38:04] hnanon: The files are in a data folder referenced on line 3.
[22:38:25] SteenJobs: has joined #RubyOnRails
[22:40:46] Devalo: has joined #RubyOnRails
[22:41:59] Irikos: has joined #RubyOnRails
[22:45:23] Radar: hnanon: Dir["cities*.rb"]
[22:45:34] Radar: Or Dir.entries. Same thing.
[22:46:18] sypheren: has joined #RubyOnRails
[22:46:20] y2mq37: has joined #RubyOnRails
[22:46:23] uglybandersnatch: has joined #RubyOnRails
[22:49:49] trinaldi: has joined #RubyOnRails
[22:51:31] hightower2: has joined #RubyOnRails
[22:53:44] quazimodo: has joined #RubyOnRails
[22:56:50] polyidus: has joined #RubyOnRails
[23:00:58] BrisketBronson: has joined #RubyOnRails
[23:01:29] _Tariq: has joined #RubyOnRails
[23:02:45] siaW: hello, i want to know if my way of using rails params is right. i have a sidekiq worker class that i want to perform a method for user’s and their posts. the first example is hard coding user and posts. in my second example i try to use params. can i do it like that? https://gist.github.com/siaw23/ff63ecda14cbf05c7263f13007317f9d
[23:03:00] one_zero: has joined #RubyOnRails
[23:03:23] siaW: or maybe my HardWorker class should inherit from ActionController in order to have access to params?
[23:03:59] Radar: holy indentation batman
[23:04:07] Radar: https://gist.github.com/siaw23/ff63ecda14cbf05c7263f13007317f9d#file-poster-rb-L5
[23:04:41] Radar: No, there are no params available in workers.
[23:04:45] Radar: You will need to pass the arguments to the workers.
[23:04:47] siaW: i don’t know how to fix the indentation sorry. before i save it’s fine after saving it’s messed up
[23:04:49] Radar: current_user = User.find_by(:id => "#{current_user_id}".to_i)
[23:04:52] Radar: This is just weird code.
[23:04:56] Radar: siaw: Stop using tabs, start using space.s
[23:05:06] Radar: why not just current_user = User.find(current_user_id)
[23:05:21] Radar: I really don't understand why it needs to be string interpolated and then converted into an integer.
[23:05:24] dalbusch1t: has joined #RubyOnRails
[23:05:50] siaW: i know. please scratch that
[23:06:02] Radar: ACTION carves a line through ti
[23:06:05] wldcordeiro: has joined #RubyOnRails
[23:06:10] akshat: has joined #RubyOnRails
[23:06:44] siaW: so if params are not available to workers, how do i make them available?
[23:06:54] siaW: should i make them inherit from ActionController?
[23:06:58] Radar: [10:04:45] <Radar> You will need to pass the arguments to the workers.
[23:07:15] siaW: Radar: i read that. but how?
[23:07:20] siaW: if not params?
[23:07:43] Radar: siaw: Please read the Sidekiq documentation. It shows how.
[23:08:10] matthewd: You're already doing it
[23:08:16] Radar: https://github.com/mperham/sidekiq/wiki/Getting-Started
[23:08:17] Radar: literally.
[23:08:21] Radar: It's teps 2 and 3.
[23:08:33] DoctorMonocular: has joined #RubyOnRails
[23:08:42] matti: has joined #RubyOnRails
[23:08:43] matthewd: https://gist.github.com/siaw23/ff63ecda14cbf05c7263f13007317f9d#file-poster-rb-L16
[23:09:25] Radar: matthewd: but that won't trigger the sidekiq job because it's setup wrong
[23:09:41] Radar: def self.perform instead of def.perform
[23:09:53] Radar: perform called on the class instead of perform_asycn.
[23:10:10] Radar: I am so shocked by this blatant misreading of the docs that I can't even type well :(
[23:10:40] siaW: i use async before
[23:11:01] siaW: but then i realised that it was making posts at RANDOM times instead of going by my sleep time that i set
[23:11:09] matthewd: I made the mistake of assuming "the first example is hard coding user and posts" meant it was working code, not a fantasy composition :(
[23:11:59] siaW: actually it’s working
[23:12:05] Radar: siaw: Sidekiq is great for jobs that run once and you don't care too much about when they run...
[23:12:10] Radar: siaw: I don't think this is a good use of Sidekiq.
[23:12:22] Radar: You should probably use a cron job that runs every minute, and that cron job calls a Rake task which does the same thing as your worker.
[23:12:25] xlegoman: has joined #RubyOnRails
[23:12:50] Radar: that mgiht work
[23:12:57] siaW: i seeeeee
[23:13:17] matthewd: There's also sidetiq, if you already have other uses for sidekiq. But I'm guessing you don't.
[23:13:20] siaW: so there’s no way for me to tell sidekiq to do something at specific times
[23:13:32] Arcaire: There is, but only relative to now.
[23:13:39] Arcaire: Not "at 3am", but "in three minutes".
[23:13:55] djbkd: has joined #RubyOnRails
[23:14:09] Radar: siaw: WorkerClass.perform_at(<time>, <args>)
[23:14:30] Radar: siaw: i.e WorkerClass.perform_at(1.minute.from_now, 1)
[23:14:35] Radar: Where 1 is the user ID, in your case.
[23:14:38] Arcaire: As you said, though, that's one-time.
[23:14:48] Radar: Arcaire: queue up the job again once it's finished running.
[23:14:50] siaW: and this is once
[23:15:00] Arcaire: Radar: What have you done with the real Radar?
[23:15:02] Arcaire: That's HARAM
[23:15:04] Radar: As the last thing in the perform method, call that method again
[23:15:16] siaW: so means i can still use sidekiq for this
[23:15:23] Radar: Arcaire: what
[23:15:33] Radar: siaw: If you want to. Something will need to queue up the initial job though.
[23:15:39] Radar: I still think Cron is better suited.
[23:15:43] matthewd: Use sidetiq over a self re-schedule... sidekiq is not 100% reliable
[23:15:52] siaW: ok i’ll look up cron jobs now in the guides
[23:15:59] Arcaire: Seriously just cron, or seriously just https://github.com/javan/whenever, which uses cron but is Ruby
[23:16:07] Arcaire: seriously /JUST/
[23:16:17] DragonPunch: is sidekiq not good?
[23:16:23] Arcaire: Not for this, not really.
[23:16:25] Radar: DragonPunch: Sidekiq is the bestest. It's just not suited for this.
[23:17:07] mostlybadfly: has joined #RubyOnRails
[23:17:08] Radar: I have some code here that's using Sidekiq. It processes a CSV file which has links to external images. I want to process those images, but I don't want to wait for ALL the images to be pulled down. So I've moved that code out to a Sidekiq worker and that'll pull down all the images in its own time.
[23:17:12] polyidus: has joined #RubyOnRails
[23:17:35] Radar: In another case, we send out email blasts to hundreds of thousands of people. Sending the actual emails takes several minutes, so each email gets its own Sidekiq job.
[23:17:59] Arcaire: You don't bulk them into a single job?
[23:18:19] Radar: I think it's batched into 1k per job because Sendgrid allows that.
[23:18:23] baweaver: has joined #RubyOnRails
[23:18:25] Arcaire: Ah okay, that makes sense.
[23:18:28] rubyonrails163: Radar: YES I did it
[23:18:35] Radar: rubyonrails163: my hero
[23:18:45] Radar: rubyonrails163: glad you were able to figure it out
[23:18:54] Radar: Arcaire: I would look at the code and use FACTS but its scary HERE BE DRAGONS code
[23:19:14] rubyonrails163: but is this the right way of going about it? in routes.rb: get '/:token' => 'users#read', :as => 'token'
[23:19:46] rubyonrails163: like is that insecure or anything?
[23:19:55] Arcaire: What's "token"?
[23:20:01] siaW: Radar: i need some advice. my users will have the ability to set at which time interval to have posts made. they can have 1000s of posts which eacn it have different time intervals. you still recommend cron job in this case?
[23:20:13] Radar: rubyonrails163: not insecure unless another user guesses the user's token.
[23:20:19] rubyonrails163: a SecureRandom.urlsafe_base64
[23:20:32] Radar: siaw: !consultant
[23:20:32] helpa: siaw: Your question, problem, and/or attitude requires more than free internet advice from an irc channel. May I suggest hiring a consultant or life coach?
[23:20:49] Radar: my rate is $250/hr. What's your best email to send that through to, siaw?
[23:21:25] manfrin: has joined #RubyOnRails
[23:21:28] Radar: that is not a valid email address
[23:21:36] siaW: i’m using this app to learn stuff, not to sell any service :p
[23:22:57] tuelz1: has joined #RubyOnRails
[23:24:26] agit0: has joined #RubyOnRails
[23:25:37] zave: has joined #RubyOnRails
[23:26:29] njero: has joined #RubyOnRails
[23:26:58] choke: has joined #RubyOnRails
[23:28:19] rikkipitt: has joined #RubyOnRails
[23:29:06] hxegon: Any ideas why (with a basic heroku docker setup) I might be getting a 'could not translate host name "db" PG error when doing an assets:precompile?
[23:29:52] baweaver: has joined #RubyOnRails
[23:30:53] djbkd: has joined #RubyOnRails
[23:31:40] hotpancakes: has joined #RubyOnRails
[23:31:56] djbkd: has joined #RubyOnRails
[23:32:04] jkahn: has joined #RubyOnRails
[23:32:24] Radar: hxegon: no
[23:32:44] Radar: How did you tell it to use "db" as the host name?
[23:33:47] hxegon: Radar kind of rubber ducky'd it here. config/database.yml has db as it's hostname, but that is left over from an old docker setup. I'm using the heroku docker setup now, and looking for where the right hostname is defined.
[23:34:05] Radar: hxegon: heroku config
[23:36:43] tuelz1: has joined #RubyOnRails
[23:38:30] DLSteve: has joined #RubyOnRails
[23:39:54] uglybandersnatch: has joined #RubyOnRails
[23:40:12] RegulationD: has joined #RubyOnRails
[23:40:18] hxegon: doesn't work because I haven't deployed at all :/
[23:41:43] tuelz1: any/close
[23:41:47] bronson: has joined #RubyOnRails
[23:41:49] hxegon: I just tried looking in the docker-compose.yml file (supplied by the heroku docker init) and none of the *postgres* names in their work when put into the host field in database.yml
[23:41:52] tuelz1: has left #RubyOnRails: ("WeeChat 1.3")
[23:42:42] keegnotrub: has joined #RubyOnRails
[23:43:37] hxegon: Is there a way to index available hostnames?
[23:43:55] hotpancakes: has joined #RubyOnRails
[23:47:04] choke: has joined #RubyOnRails
[23:49:59] ivanskie: has joined #RubyOnRails
[23:51:41] chipotle: has joined #RubyOnRails
[23:51:56] hxegon: well, I'm using the DATABASE_URL env variable defined in docker-compose, but now it seems it can't connect. not sure if this is progress :P
[23:53:28] manfrin: has joined #RubyOnRails
[23:55:56] workmad3: has joined #RubyOnRails
[23:57:58] hxegon: ... all because I'm using 'docker-compose up' instead of 'docker-compose up web'..........
[23:58:20] hahuang61: has joined #RubyOnRails