« Back to channel list

#RubyOnRails - 17 October 2015

« Back 1 day Forward 1 day »
[00:01:22] etrae: has joined #RubyOnRails
[00:01:25] northfurr: has joined #RubyOnRails
[00:02:39] karam: has joined #RubyOnRails
[00:02:39] Kara: has joined #RubyOnRails
[00:04:59] tenderlove: has joined #RubyOnRails
[00:06:36] brancher: has joined #RubyOnRails
[00:10:32] hephaestus_rg: has joined #RubyOnRails
[00:11:16] tenderlove: has joined #RubyOnRails
[00:11:23] DoubleMalt: has joined #RubyOnRails
[00:11:39] rickmasta: has joined #RubyOnRails
[00:14:24] sankaber: has joined #RubyOnRails
[00:22:20] wldcordeiro: has joined #RubyOnRails
[00:26:08] bendangelo: has joined #RubyOnRails
[00:27:29] GriffinHeart: has joined #RubyOnRails
[00:29:06] htmldrum: has joined #RubyOnRails
[00:30:40] duderonomy: has joined #RubyOnRails
[00:39:09] Jon30: has joined #RubyOnRails
[00:50:08] nyaa: has joined #RubyOnRails
[00:50:48] ellisTAA: has joined #RubyOnRails
[00:51:10] ellisTAA: i???ve been stuck on this for an hour. for some reason the checkbox isn???t appearing ???. https://gist.github.com/ellismarte/6ed5473132518f3d126a#file-settings-rb-L36-L48
[00:52:22] jenrzzz: has joined #RubyOnRails
[00:54:19] duderonomy: has joined #RubyOnRails
[00:54:29] baweaver: has joined #RubyOnRails
[00:55:02] Maletor: has joined #RubyOnRails
[00:55:33] rhizome: put the id: thing in braces
[00:55:52] ellisTAA: rhizome: thanks :)
[00:56:32] ddv: has joined #RubyOnRails
[00:56:35] sunya7a: has joined #RubyOnRails
[00:56:36] sunya7a_: has joined #RubyOnRails
[00:56:39] ellisTAA: rhizome: just like this right: https://gist.github.com/ellismarte/6ed5473132518f3d126a
[00:58:07] rhizome: try it out
[00:58:14] ellisTAA: rhizome: damn didn???t work
[00:59:23] rhizome: add the method symbols to the labels
[00:59:35] USvER: Hey, i have a problem with ENUM. When i do model.read_attribute('status') it properly returns the index in the status enum array... but model.status returns empty string =\
[00:59:40] duderonomy: has joined #RubyOnRails
[01:00:07] ellisTAA: oh shit it says type=???hidden??? wtf ???
[01:00:28] jhass: USvER: well, what's your _exact_ call to enum in the model?
[01:01:13] USvER: jhass, model.status , it should return string, isn't it?
[01:01:28] jhass: USvER: you're evading my question
[01:01:56] USvER: jhass: Here is how it's defined: "enum status: [:scheduled, :executed, :generated, :failed]"
[01:02:03] jhass: and what's the index?
[01:02:31] USvER: So the model.status should return "generated"
[01:02:44] USvER: but it's ""
[01:02:51] stardiviner: has joined #RubyOnRails
[01:03:00] jhass: well, that looks okay. I'd guess either the code you look at is not the code running in your process or you overwrite status somewhere
[01:03:01] greengriminal: has joined #RubyOnRails
[01:03:17] fschuindt: Hey folks, there's a way to apply the same example for each method without repeating it? https://gist.github.com/fschuindt/fc2535a8d6380175ee09 In this spec, the two contexts "when is logged as staff" and "when is not logged in" will be needed in every method. But I don't think that repeat it is the right way. Any help?
[01:03:31] jhass: USvER: let's start with method(:status).source_location
[01:03:40] jhass: model.method of course
[01:04:27] USvER: ["/usr/local/rvm/gems/ruby-2.2.3/gems/activerecord-4.2.4/lib/active_record/enum.rb", 111]
[01:05:02] nyaa: has joined #RubyOnRails
[01:06:01] dopamean_: has joined #RubyOnRails
[01:06:12] jhass: USvER: what does model[:status] return?
[01:07:05] EminenceHC: has joined #RubyOnRails
[01:07:26] jhass: well, that seems unlikely
[01:07:44] jhass: I stick to my code running != code you're looking at theory then
[01:08:01] gaboesquivel: has left #RubyOnRails: ()
[01:08:02] USvER: jhass, i'm testing at the same code
[01:08:20] USvER: jhass, there is no other code
[01:08:39] jhass: that's the crux, of course you think you are
[01:09:26] ionte: has joined #RubyOnRails
[01:09:38] USvER: jhass, but it's saying me that enum code is there? right?
[01:09:50] jhass: USvER: how about model.generated?, what does that return?
[01:10:27] USvER: jhass, that's the point it's false
[01:10:51] USvER: jhass, my logic didn't worked like i expected...
[01:10:55] workmad3: has joined #RubyOnRails
[01:11:06] jhass: are you in pry?
[01:11:18] USvER: jhass, no
[01:11:35] USvER: jhass, in a haml template
[01:12:12] htmldrum: has joined #RubyOnRails
[01:13:38] cards: has joined #RubyOnRails
[01:13:41] USvER: ijhass, i'm geting model like this "@list_item.media_file.media_file_versions.where(preset: preset).take"
[01:14:19] jenrzzz: has joined #RubyOnRails
[01:14:21] quazimodo: has joined #RubyOnRails
[01:14:33] USvER: So it goes through many relations, including "has_many :through"
[01:15:25] USvER: But i don't think it can be the problem =\
[01:15:36] jhass: I doubt it's relevant, so there's probably something you've been hiding or that I'm not seeing
[01:15:46] ngscheurich: has joined #RubyOnRails
[01:15:52] USvER: jhass, like bug in core?
[01:16:05] jhass: no, rather in your testing methodology
[01:16:38] jhass: since I can't see your real code & screen it's hard to tell, what you describe so far is quite impossible
[01:16:58] USvER: i can share my screen on skype...
[01:17:22] FailBit: fschuindt, the only way I care for is eval and that makes me sad
[01:17:43] awrfas2: has joined #RubyOnRails
[01:17:50] FailBit: you can use shared_examples but those are ass
[01:18:05] jhass: USvER: !rule12
[01:18:05] helpa: USvER: Do not PM members of the channel without first asking if that is OK.
[01:18:07] FailBit: using Binding might work but it's ugly as hell
[01:18:31] jhass: USvER: it's 3am here, I'd rather not
[01:18:34] fschuindt: FailBit: I am hard codding the thing
[01:18:49] USvER: jhass, it's 4AM here
[01:18:58] unreal: has joined #RubyOnRails
[01:19:09] jhass: so get some sleep and look with fresh eyes tomorrow
[01:19:31] USvER: jhass, 9am deadline =\
[01:20:01] jhass: well, got yourself into some trouble there I guess
[01:20:04] USvER: jhass, will hardcode status indexes for now
[01:20:53] USvER: jhass, yep spent too much time with girlfriend... happens
[01:20:58] skweek: has joined #RubyOnRails
[01:21:34] northfurr: has joined #RubyOnRails
[01:21:36] spellbook: has joined #RubyOnRails
[01:26:19] spellbook: hi all. i'm new to web development and have a question if anyone is willing to answer
[01:27:59] towski_: has joined #RubyOnRails
[01:29:17] jenrzzz: has joined #RubyOnRails
[01:30:27] VeryBewitching: spellbook: Ask away.
[01:31:27] spellbook: in terms of design, if you're relying on the api of another web application to populate your application's site, would it be better to just copy over the data into your database or make a request to that other site every time your site requires data?
[01:31:40] s2013: has joined #RubyOnRails
[01:32:07] noodle: has joined #RubyOnRails
[01:32:24] VeryBewitching: spellbook: That depends on quite a few things.
[01:32:56] craysiii: has joined #RubyOnRails
[01:34:15] joshkovach: has joined #RubyOnRails
[01:34:35] VeryBewitching: spellbook: Can you be a bit more specific?
[01:35:25] spellbook: Yes. Sorry, I type a bit slow. I want to make a web app that graphs the market value of trading cards. The cards themselves don't change, but from day to day, their value will fluctuate.
[01:35:59] gaboesqu_: has joined #RubyOnRails
[01:38:03] stamina: has joined #RubyOnRails
[01:38:41] spellbook: The api provides access to all the card data and their stats etc. via get requests. So I'm unsure of the best way to structure my app. Is it that expensive to fetch the data from another site as opposed to my own database?
[01:40:26] VeryBewitching: spellbook: You could cache the data in your application database, sure.
[01:40:27] spellbook: Should I seed my database with all their current info and update it as need be?
[01:41:35] rakm: has joined #RubyOnRails
[01:41:59] FailBit: it's very expensive to make external requests
[01:42:08] FailBit: and not quite so much to hit internal endpoints
[01:42:13] etrae: has joined #RubyOnRails
[01:42:22] VeryBewitching: spellbook: I would suggest looking at sidekiq or something.
[01:43:03] ngscheurich: has joined #RubyOnRails
[01:43:07] VeryBewitching: A one-off per 15 minute process to process updates; it depends on how up to date you want to be; and how many requests they'll allow to their API server.
[01:44:00] VeryBewitching: spellbook: Kind of a loaded question, that one. :D
[01:44:22] VeryBewitching: spellbook: Do you have programming experience?
[01:45:00] GriffinHeart: has joined #RubyOnRails
[01:45:13] chipotle: has joined #RubyOnRails
[01:45:32] spellbook: Haha. Yes. I haven't made an app that gathers data from another api before, so I wanted some input before I ran off and did some convoluted coding.
[01:46:04] Radar: spellbook: Look at using HTTParty for the API requests.
[01:46:04] diego1: has joined #RubyOnRails
[01:46:05] spellbook: I haven't been programming too long, only a few months.
[01:46:32] diego1: has joined #RubyOnRails
[01:46:54] one_zero: has joined #RubyOnRails
[01:47:26] spellbook: Thank you for the help :)
[01:47:39] VeryBewitching: spellbook: !guides
[01:47:39] helpa: spellbook: http://guides.rubyonrails.org/ - Ruby on Rails guides. Recommended reading.
[01:47:45] VeryBewitching: If you haven't yet.
[01:51:04] spellbook: Yup. I've been referencing them as necessary
[01:51:28] Radar: spellbook: Have you been reading any Ruby/Rails books so far?
[01:52:01] wldcordeiro: has joined #RubyOnRails
[01:52:06] spellbook: Yes, I went through the Hartl book.
[01:52:29] Radar: I wrote one too called Rails 4 in Action
[01:52:30] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[01:52:41] Lightsword: has joined #RubyOnRails
[01:52:50] Radar: It takes a similar approach to Hartl's book, but goes a little further and covers things like file uploading and sending email
[01:53:10] tweeeaks: ^ thats the one to read fo sho
[01:53:38] spellbook: I see. I'll definitely check it out
[01:55:22] hnanon: has joined #RubyOnRails
[01:55:28] spellbook: How important would you say TDD/BDD is if you're just working on your own one-person projects. I know the practice with writing tests would be useful, but it's very time consuming.
[01:55:43] corioliss: has joined #RubyOnRails
[01:55:53] Radar: I think it's very important because it allows you to create a safety net of tests that you can improve when there is a bug in your system
[01:56:00] Radar: For instance, imagine that you have a login feature that stops working one day
[01:56:05] Radar: How do you know that it's stopped working? Someone tells you.
[01:56:12] Radar: If you had tests for it in the first place, then the tests would tell you.
[01:56:18] Radar: You'd catch the bug BEFORE it got to production.
[01:57:19] hnanon: Radar: If you had to pick between launching an app with no tests or delaying the launch 6 months with tests, which would you choose?
[01:57:27] VeryBewitching: spellbook: You should describe your software before you build it. Tests, abstracted, are your blueprints.
[01:57:31] Radar: hnanon: 6 months is a bit long ;)
[01:57:49] hnanon: 3 months?
[01:58:03] Radar: hnanon: Would you rather spend 6 months after the app has been deployed fixing the many, many bugs that would've been caught with proper testing?
[01:58:04] hnanon: You get my point.
[01:58:06] VeryBewitching: spellbook: Write a test, it fails, write the feature, it passes.
[01:58:11] Radar: Also: without tests, how do you know that a bug has really been fixed?
[01:58:28] Radar: You verify it today that it's working, but someone else next week might make the same mistake again and break that feature again
[01:58:34] Radar: Regression tests ensure that it doesn't happen
[01:58:52] hnanon: What are regression tests?
[01:59:11] Radar: hnanon: tests you write to reproduce a bug in your system. You write the test, then it fails. Then you fix the bug, and the test passes.
[01:59:23] Radar: Then if that bug gets re-introduced, you'll have a test that'll complain about it.
[01:59:55] hnanon: Would you suggest to a novice to write tests while learning Rails?
[02:00:00] Radar: absolutely
[02:00:10] Radar: I do so in my book ;)
[02:00:18] VeryBewitching: You have to write a test to write a feature, imo.
[02:00:22] hnanon: How do you feel about Hartl minimizing testing in his latest version?
[02:00:42] Radar: hnanon: I haven't read it. How has he minimized it?
[02:01:08] hnanon: I guess many of his readers complained that the book had too much info about testing for a beginner book.
[02:01:31] Radar: And nobody complains that the apps that those juniors write are riddled with bugs and mistakes that could've been caught by tests?
[02:01:45] Radar: fwiw, we will hire juniors at Marketplacer... but ONLY juniors who write tests.
[02:01:59] Radar: Because we have production code which we'd like to make sure really does work before every deployment.
[02:02:11] Radar: And I can't think of a company here who doesn't have the same opinion.
[02:02:35] hnanon: I think I better learn how to write tests.
[02:03:26] hnanon: I'm quite indecisive sometimes, though. Rspec or Minitest? I think scales are tipping towards minitest these days but most resources for learning use Rspec.
[02:03:44] VeryBewitching: I personally would not go back to Minitest
[02:03:59] Radar: A lot of people prefer minitest due to its simplicity. I've used RSpec since I was a beginner and so that's what I continue to use now
[02:04:15] Radar: VeryBewitching: Really? Why?
[02:04:27] hnanon: I like simplicity.
[02:04:35] VeryBewitching: Radar: I like that RSpec is more descriptive.
[02:05:01] VeryBewitching: I prefer the way it feels to type? Does that make sense?
[02:05:34] unholycrab: has joined #RubyOnRails
[02:05:58] smathy: has joined #RubyOnRails
[02:06:09] hnanon: Radar: What should a junior dev know?
[02:06:11] FailBit: I don't prefer the way it feels to use, but that's just me
[02:06:13] renews: has joined #RubyOnRails
[02:06:33] hnanon: In other words, what would you look for in a junior that was applying?
[02:06:44] VeryBewitching: I don't setup RSpec with a lot of initialization; bare bone setup but involved individual tests.
[02:06:49] hnanon: Besides the ability to write tests, of course.
[02:06:51] Radar: hnanon: https://gist.github.com/radar/3037d4c5f8d3240afd43
[02:06:55] FailBit: ruby DSLs are nice until you stop and think "how was this implemented" and then you go cry
[02:07:02] Radar: hnanon: With the lessons from Rails 4 in Action applied in the context of that app.
[02:07:27] Radar: And the app should have tests.
[02:08:44] hnanon: Can you point to any good minitest resources?
[02:08:58] hnanon: I realize you use rspec.
[02:09:02] spellbook: How long would you expect a junior to take to finish building such an app plus tests?
[02:09:11] Radar: spellbook: I'd give them a week.
[02:09:46] FailBit: what about an experienced dev
[02:09:59] hnanon: Radar: No user authentication or payment processing?
[02:10:17] Radar: hnanon: There is user authorization if you look closely :)
[02:10:32] hnanon: Authorization, yes.
[02:10:44] Radar: Authentication, nope
[02:10:51] Radar: But you might implement the authorization by using authentication
[02:10:52] hnanon: Right, ok.
[02:10:55] Radar: Up to you!
[02:11:35] hnanon: Do you guys/gals hire remote devs :P
[02:13:37] hnanon: Radar: Do you expect devs, juniors or otherwise, to write the app "blindly?" I mean without looking up syntax, or SO, or maybe re-used code?
[02:14:05] Radar: It is not an exam.
[02:14:10] spellbook: How many apps do you think a junior should have written before considering applying to jobs and working on 'real' projects?
[02:14:14] Radar: You will write it using all the tools that are available to you in the real world.
[02:14:19] VeryBewitching: It's a matter of how well you build it within your time limit :D
[02:14:30] hnanon: Hmm. I see.
[02:14:46] VeryBewitching: I use Google about 389403890438902483032 times a week.
[02:14:56] VeryBewitching: That cord can't be cut or I'll go nuts
[02:15:54] spellbook: Google went down for like 20 minutes the other day. It was very surprising.
[02:16:05] VeryBewitching: spellbook: Ya, I remember that.
[02:16:39] hnanon: Radar: Do you expect tests to be written before or is after ok too, in your opinion?
[02:16:50] Radar: hnanon: Before, preferrably.
[02:16:58] Radar: hnanon: otherwise the tests are testing the bugs are there :)
[02:17:11] prereflect: has joined #RubyOnRails
[02:17:11] Radar: The temptation in that case is to modify the test to suit the code
[02:17:16] Radar: which should ALWAYS be a last resort
[02:17:42] hnanon: So that's another point of difference between you and DHH.
[02:18:16] Radar: We both have peaked hair, and we're white men and that's about where the similarities end :P
[02:21:05] hnanon: Are callbacks generally a bad idea?
[02:21:28] Radar: Depends :)
[02:22:20] VeryBewitching: hnanon: Don't look at anything as right or wrong, it depends on why you needed the tool at the time.
[02:22:55] VeryBewitching: Keep things simple unless they can't be.
[02:23:23] hnanon: I have this code in my update action:
[02:23:30] hnanon: if @training_record.attributes = (training_record_attributes_params)
[02:23:55] rhizome: that's definitely something
[02:24:05] hnanon: @training_record.update_instructor(current_user, params)
[02:24:27] hnanon: rhizome, you may have helped me with this...I don't remember.
[02:24:36] hnanon: Then in my model I fo what I need to do.
[02:25:13] hnanon: I suppose I could just use the default "update" and do a before_update in the model.
[02:26:39] hnanon: So, hence my question: callback or just call a method in the model from the controller?
[02:27:44] Radar: https://twitter.com/ryanbigg
[02:27:50] Radar: twitter rant
[02:27:51] Radar: feels good
[02:27:57] Radar: haven't done that in a while
[02:29:51] hnanon: Nice rant.
[02:29:57] hnanon: I concur.
[02:30:23] hnanon: Is a JS framework really required for a junior?
[02:31:12] TheRokh: has joined #RubyOnRails
[02:31:37] FailBit: jquery comes with rails so
[02:31:51] FailBit: you're already using one
[02:31:54] gambl0re: has joined #RubyOnRails
[02:32:22] TheRokh: has joined #RubyOnRails
[02:32:31] iateadonut: has joined #RubyOnRails
[02:33:59] spellbook_: has joined #RubyOnRails
[02:35:06] Radar: Enough apps these days use one of them, so yeah you'll need to be competent with JS.
[02:36:34] ruby-lang663: has joined #RubyOnRails
[02:37:58] rubyonrails440: has joined #RubyOnRails
[02:38:16] tweaks: TWEETS 50.2K - daaaaaamn Radar
[02:38:22] sevenseacat: has joined #RubyOnRails
[02:38:30] Radar: I have been using Twitter since... 2007?
[02:38:39] Radar: 2008, actually.
[02:39:05] tweaks: thats a lot of tweaks
[02:39:06] Radar: About 19 tweets a day on average :P
[02:39:11] tweaks: s/teaks/tweets
[02:39:13] spellbook: has joined #RubyOnRails
[02:39:44] root____6: has joined #RubyOnRails
[02:39:44] VeryBewitching: Radar: Followed.
[02:40:16] tweaks: heh cat in a box
[02:41:02] lagweezle: Radar: Thank you for your support of junior devs. :/
[02:41:14] gambl0re: has joined #RubyOnRails
[02:41:41] lagweezle: Me being in QA and trying to escape it to full dev land finds it nice to see some support for lowering the bar to entry.
[02:42:34] IFrank00: has joined #RubyOnRails
[02:44:42] sunya7a: has joined #RubyOnRails
[02:44:46] sunya7a_: has joined #RubyOnRails
[02:45:09] gambl0re: has joined #RubyOnRails
[02:45:21] lagweezle: Radar: If I can find time to breath this weekend, I think I'll use your gist as some practice. Ruby makes me not hate the world after slogging through horrible Python all week.
[02:50:32] darrencauthon: has joined #RubyOnRails
[02:51:33] sunya7a: has joined #RubyOnRails
[02:51:34] sunya7a__: has joined #RubyOnRails
[02:53:02] Contigi: has joined #RubyOnRails
[02:53:05] VeryBewitching: I just hope to never encounter PHP again in my travels.
[02:56:51] The_Phoenix: has joined #RubyOnRails
[02:58:10] stardiviner: has joined #RubyOnRails
[02:58:19] rushed: has joined #RubyOnRails
[02:59:01] workmad3: has joined #RubyOnRails
[03:00:33] brainslug: has joined #RubyOnRails
[03:00:34] renews: has joined #RubyOnRails
[03:01:50] mrtomme: has joined #RubyOnRails
[03:02:26] nyanz: has joined #RubyOnRails
[03:04:16] gambl0re: has joined #RubyOnRails
[03:05:17] jun: has joined #RubyOnRails
[03:05:22] jameswork: has joined #RubyOnRails
[03:06:59] HAL2328: has joined #RubyOnRails
[03:09:35] braincrash: has joined #RubyOnRails
[03:12:32] cswelin: has joined #RubyOnRails
[03:15:06] lagweezle: VeryBewitching: A noble goal.
[03:18:46] northfurr: has joined #RubyOnRails
[03:19:46] yfeldblum: has joined #RubyOnRails
[03:24:00] stardiviner: has joined #RubyOnRails
[03:26:59] baweaver: has joined #RubyOnRails
[03:33:58] Joufflu: has joined #RubyOnRails
[03:36:51] acti0nman: has joined #RubyOnRails
[03:38:01] rushed: has joined #RubyOnRails
[03:42:19] awrfas2: has joined #RubyOnRails
[03:42:51] chouhoulis: has joined #RubyOnRails
[03:43:33] chouhoulis: has joined #RubyOnRails
[03:51:17] stardiviner: has joined #RubyOnRails
[03:53:33] jenrzzz: has joined #RubyOnRails
[03:54:16] mkp: has joined #RubyOnRails
[03:54:43] michael_mbp: has joined #RubyOnRails
[03:54:47] mkp: Probably asked daily, but anyone have a firm date on Rails 5 release?
[03:54:50] renews: has joined #RubyOnRails
[03:55:46] chipotle: has joined #RubyOnRails
[03:55:59] sevenseacat: mkp: we don't, unfortunately. it's not even out in beta yet.
[03:56:25] mkp: gotcha, thanks for responding!
[03:57:38] IFrank00: I got a question what a valid way of doing this. I got a Model Task and I like to have a link to a custom action(cancel task and recreate another one with the new date of ) that display a form different from the edit form. On that form I got 2 field one is a new_date another its a note. when the form its summit it I need to redirect it to the new task show
[03:58:54] rbrancher: has joined #RubyOnRails
[03:59:09] arup_r: has joined #RubyOnRails
[03:59:12] IFrank00: Do I need to create a different Update action or do I have to do some if else end in the update action
[04:00:02] northfurr: has joined #RubyOnRails
[04:00:57] darrencauthon: has joined #RubyOnRails
[04:06:09] IFrank00: this the logic http://postimg.org/image/h0tm9fa8b/
[04:07:22] chipotle: has joined #RubyOnRails
[04:08:54] mkp: IFrank00 you should be able to render whatever partial needed or redirect the user to a defined path if the form is successfully submitted within the current update. Depending of you generated your model via the command line, rails should do most of the heavy lifting for you on defining the update method, you just need to add in what to render or r
[04:08:55] mkp: edirect to on a successful update.
[04:09:13] mkp: Check out this SO - http://stackoverflow.com/questions/8944175/conditional-redirect-after-update
[04:09:42] cmoneylulz: has joined #RubyOnRails
[04:10:00] IFrank00: mkp, thank you as im looking all over the place
[04:10:14] IFrank00: mkp, over looking
[04:11:35] cmoneylulz: has joined #RubyOnRails
[04:12:01] IFrank00: mkp, so I have 2 action Im have the completed and the cancel each one has a different form as they have different fields the both do a update on the Model
[04:12:12] sunya7a: has joined #RubyOnRails
[04:12:54] IFrank00: mop, for the completed im using the normal edit action and update has a render to what I want
[04:13:25] IFrank00: mkp, auto correct change it to mop
[04:13:33] weihan: has joined #RubyOnRails
[04:14:45] hahuang61: has joined #RubyOnRails
[04:14:46] deception1: has joined #RubyOnRails
[04:15:10] IFrank00: mkp, your link is a good path thank you
[04:17:41] mkp: IFrank00, no problem. Hope it steers you in the right direction.
[04:18:58] duderonomy: has joined #RubyOnRails
[04:20:06] dopie: has joined #RubyOnRails
[04:21:20] melonstorm: has joined #RubyOnRails
[04:21:44] IFrank00: mkp, another quick question if I need to run a Model Method on update but with condition on with action it use can this be done ?? example on the cancel action after update only do something if the action is cancel
[04:25:01] stardiviner: has joined #RubyOnRails
[04:25:02] mkp: You can determine which of your two forms is being submitted by inspecting the params passed with the form. Check out the rails docs on it - http://guides.rubyonrails.org/form_helpers.html#helpers-for-generating-form-elements.
[04:26:16] JusticeFries: has left #RubyOnRails: ()
[04:26:58] dikaio: has joined #RubyOnRails
[04:28:03] hephaestus_rg: has joined #RubyOnRails
[04:29:44] renews: has joined #RubyOnRails
[04:30:54] GriffinHeart: has joined #RubyOnRails
[04:31:31] HammerShark: has joined #RubyOnRails
[04:37:48] mkp: has joined #RubyOnRails
[04:40:20] deception1: has joined #RubyOnRails
[04:42:21] robbyoconnor: has joined #RubyOnRails
[04:42:26] chipotle: has joined #RubyOnRails
[04:43:35] IFrank00: mkp, your the best great doc
[04:45:01] mkp: IFrank00, Glad it helped!
[04:45:13] jun: has joined #RubyOnRails
[04:45:43] IFrank00: mkp, ill do more search with this topic
[04:47:12] workmad3: has joined #RubyOnRails
[04:51:54] sivsushruth: has joined #RubyOnRails
[04:52:19] IFrank00: mkp, Yess Yess I did it thakyou 3 days of looking and looking
[04:52:47] mkp: IFrank00, Nice! Good luck with the app!
[04:53:03] joshkovach: has joined #RubyOnRails
[04:53:46] IFrank00: mkp, Thankyou it was my last part to finish now I can apply some validation and wala!!!
[04:54:19] octophore2: has joined #RubyOnRails
[04:54:53] Davey: has joined #RubyOnRails
[04:57:15] Davey: has joined #RubyOnRails
[04:57:15] Davey: has joined #RubyOnRails
[04:57:26] bbrowning: has joined #RubyOnRails
[05:02:18] nya: has joined #RubyOnRails
[05:05:19] greenride: has joined #RubyOnRails
[05:05:34] rickmasta: has joined #RubyOnRails
[05:11:25] rushed: has joined #RubyOnRails
[05:12:28] stardiviner: has joined #RubyOnRails
[05:17:36] nemo_: has joined #RubyOnRails
[05:19:24] joshkovach: has joined #RubyOnRails
[05:19:32] craysiii: has joined #RubyOnRails
[05:21:28] Radar: ^ Rails 5 release date
[05:24:41] mkp: haha, that was the whole reason i came to this channel.
[05:25:04] Radar: release party location ^
[05:27:55] circ-user-Gkv32: has joined #RubyOnRails
[05:28:35] wethu: has joined #RubyOnRails
[05:29:37] sevenseacat: party in the ex-Soviet bloc!
[05:31:29] raunicolae: has joined #RubyOnRails
[05:31:35] bePolite: has joined #RubyOnRails
[05:31:40] raunicolae: has left #RubyOnRails: ()
[05:32:05] VeryBewitching: In the middle of a body of water too, should be a blast.
[05:33:47] lxsameer: has joined #RubyOnRails
[05:33:47] lxsameer: has joined #RubyOnRails
[05:33:50] Radar: Yeah it's on a boat.
[05:37:52] yfeldblum: has joined #RubyOnRails
[05:42:10] _lazarevsky_: has joined #RubyOnRails
[05:43:00] _lazarevsky_: how can I handle the initial request to a Rails app
[05:43:10] IFrank00: Is there any way for validations based on custom action
[05:43:11] _lazarevsky_: something along the lines of Request.IsPostback in .NET ?
[05:43:17] etrae: has joined #RubyOnRails
[05:43:42] Dopagod: has joined #RubyOnRails
[05:44:54] Radar: _lazarevsky_: What is Request.IsPostback in .NET?
[05:45:10] _lazarevsky_: Radar: it allows you to differentiate between the initial request to the app vs subsequent requests
[05:45:17] _lazarevsky_: Radar: I wanna measure the total load time of the app
[05:45:18] Radar: But what use is it?
[05:45:22] _lazarevsky_: so in the initial request I wanna set a timer
[05:45:38] Radar: Most sensible people use New Relic / Skylight for this ;)
[05:45:40] _lazarevsky_: and then when the last ajax is sent from the Ember app I wanna send another ajax to an endpoint in my app and get the end_time
[05:45:44] beauby: has joined #RubyOnRails
[05:45:56] sevenseacat: how can you define the 'last request' ?
[05:46:07] _lazarevsky_: sevenseacat: there's an event in the ember app isLoaded
[05:46:16] _lazarevsky_: which is trigger when the whole app is loaded and all promises have been resolved
[05:46:24] darrencauthon: has joined #RubyOnRails
[05:46:35] sevenseacat: oh so its not the last request, its just the final request in the loading process
[05:46:50] _lazarevsky_: sevenseacat: ya, you're correct
[05:46:58] _lazarevsky_: sevenseacat: is that a good way of going about it would you say?
[05:47:20] _lazarevsky_: and also, is my paranoia getting completely out of hands or is active record not meant to be used for even semi complex queries
[05:47:24] mkp: IFrank00: It may not be the best option but you can add a conditional to validations and base it off an attr set on the model instance - http://stackoverflow.com/questions/6471343/validations-for-certain-actions-in-model
[05:47:28] GriffinHeart: has joined #RubyOnRails
[05:47:44] demonlove: has joined #RubyOnRails
[05:48:01] _lazarevsky_: sevenseacat: ok so how would you suggest I go about it
[05:48:04] IFrank00: mop, ur on fire :)
[05:48:17] sevenseacat: _lazarevsky_: use one of the tools Radar suggested
[05:48:36] Radar: Your server logs also tell you how long a request takes
[05:48:40] _lazarevsky_: ok, thanks guys
[05:49:15] lessless: has joined #RubyOnRails
[05:50:33] awrfas2: has joined #RubyOnRails
[05:55:44] krz: has joined #RubyOnRails
[05:57:22] _lazarevsky_: Radar: just to confirm, New Relic is completely free and always will be, ayE?
[05:57:30] _lazarevsky_: this tool looks awesome btw!
[05:57:33] Radar: _lazarevsky_: !rule1
[05:57:33] helpa: _lazarevsky_: Do your research before hand. Your question may be answerable with a quick Google search or by simply experimenting. If you're using a method in Rails, look it up in the API Docs or in the Official Guides.
[06:02:35] _lazarevsky_: Radar: crap.. our app is behind a VPN
[06:03:03] _lazarevsky_: and it seems that one can't monitor the stats locally, but needs to log onto an account because they're posted there?
[06:03:43] nickenchuggets: has joined #RubyOnRails
[06:03:43] nickenchuggets: has joined #RubyOnRails
[06:05:19] _lazarevsky_: ok, on to Skylight
[06:05:32] _lazarevsky_: or does Skylight work the same way?
[06:05:36] helpa: Do your research before hand. Your question may be answerable with a quick Google search or by simply experimenting. If you're using a method in Rails, look it up in the API Docs or in the Official Guides.
[06:05:40] nya: has joined #RubyOnRails
[06:05:44] wethu: has joined #RubyOnRails
[06:06:09] _lazarevsky_: c'mon have mercy on my soul, it's my b'day today :)
[06:06:24] _lazarevsky_: just kidding.. it is my b'day though
[06:06:46] sevenseacat: has joined #RubyOnRails
[06:07:01] _lazarevsky_: Once you have the Skylight agent installed into your application, you have to register your application with us. To do this, run the following command:
[06:07:07] Radar: Rules are rules :)
[06:07:25] rhizome: sounds skylighty
[06:07:34] _lazarevsky_: ok so back to square one. How do I detect the initial request to the app?
[06:07:50] rhizome: they probably address that in the application registration process
[06:08:45] _lazarevsky_: https://msdn.microsoft.com/en-us/library/system.web.ui.page.ispostback(v=vs.110).aspx <- something like this
[06:08:55] _lazarevsky_: I know is M$, I hope your eyes don't bleed
[06:12:43] nemo_: has joined #RubyOnRails
[06:12:44] Radar: Oh I just remembered I need to go water my pet llama
[06:14:10] _lazarevsky_: sevenseacat: umm, maybe you know?
[06:14:18] sevenseacat: I gave my advice already.
[06:14:26] _lazarevsky_: sevenseacat: well neither of them work for me..
[06:14:51] _lazarevsky_: kiwis are usually way more friendly than this. you're an anomaly
[06:15:14] sevenseacat: who said I was a kiwi?
[06:15:25] _lazarevsky_: I hope the french teach you a lesson this weekend in the quarter finals
[06:15:36] _lazarevsky_: I thought you told me once that you were
[06:15:46] sevenseacat: you thought wrong.
[06:16:21] _lazarevsky_: thanks all for yer help
[06:21:00] jenrzzz: has joined #RubyOnRails
[06:21:38] Macaveli: has joined #RubyOnRails
[06:22:13] GnuYawk: has joined #RubyOnRails
[06:22:13] GnuYawk: has joined #RubyOnRails
[06:30:52] MartinElvar: has joined #RubyOnRails
[06:31:20] arathald: I'm *considering* trying RoR again for a side project that's come up
[06:31:20] Radar: hi arathald
[06:31:34] Radar: that's good :)
[06:31:51] arathald: to be completely honest, coming from java web dev (that's my day job), the amount of magic in RoR makes me uneasy sometimes
[06:32:24] arathald: at least for me, it makes it harder to see how everything fits together
[06:33:05] bendangelo: has joined #RubyOnRails
[06:33:26] Radar: arathald: What have you been reading to learn how it all fits together?
[06:33:33] rushed: arathald: nice vacant negativity~
[06:33:42] Radar: rushed: ?
[06:33:47] arathald: I've gone through different tutorials several tims
[06:33:54] arathald: I learn best by doing
[06:34:59] arathald: every time, I get to a point where I'm sitting there scratching my head trying to figure out how the hell everything was connected together
[06:35:13] ss_much: has joined #RubyOnRails
[06:35:15] Radar: arathald: do you have a more concrete example of this?
[06:35:23] sevenseacat: anything specific, or just want to ramble?
[06:35:24] workmad3: has joined #RubyOnRails
[06:35:32] Radar: hackles raised today
[06:35:36] Ropeney: has joined #RubyOnRails
[06:35:37] Radar: It's the weekend people, c'mon :)
[06:35:38] Kara: has joined #RubyOnRails
[06:35:39] arathald: I want to discuss
[06:35:39] karam: has joined #RubyOnRails
[06:35:54] arathald: Radar: I'm trying to think of an example... it's been a while :)
[06:36:31] sevenseacat: I'm tired and don't really see a point in non-constructive "discussion"
[06:36:45] arathald: you don't have to participate, that's okay
[06:37:25] helpa: http://i.imgur.com/m9m3wr9.gif
[06:37:55] Radar: arathald: When you come up with a concrete example I'll be happy to discuss it with you. I am not sure I can do anything right now without one.
[06:38:00] Radar: I'd like to help though.,
[06:38:12] Radar: You don't need to know how every single little thing pieces together in Rails in order to build Rails apps.
[06:38:20] arathald: I was sort of hoping someone would have seen the same thing and know what I mean ;)
[06:38:41] Radar: You don't need to know that requests come in through Rack and then get routed via Journey/ActionDispatch, which ends up in ActionPack-land and eventually in your own controllers which then somehow magically know to render views.
[06:38:50] arathald: well, it's not a matter of seeing how *everything* fits together. I can't see enough to let me understand what I'm doing
[06:38:53] Radar: It's all a combination of sensible defaults.
[06:39:14] sevenseacat: to me it sounds like 'I don't know rails. does anyone else not know rails too?'
[06:39:26] yfeldblum: has joined #RubyOnRails
[06:39:29] arathald: sevenseacat: I thought you didn't want to participate?
[06:39:37] sevenseacat: arathald: you said that, not me
[06:40:14] arathald: I've talked to other java developers who've faced the same hurdles learning RoR, so at least in some places, it's a shared feeling
[06:40:23] rushed: arathald: there are quite a few streamlined frameworks (sinatra is an example) if you want something you can look at all in one go
[06:41:14] Radar: How do I get the port that Capybara is using for the JS driver? I seem to recall there's a method for that.
[06:41:32] Radar: I'm thinking someone knows off the top of their heads so that I don't have to do the research myself ;)
[06:41:43] gremax: has joined #RubyOnRails
[06:41:54] sevenseacat: Radar: !rule1
[06:41:54] helpa: Radar: Do your research before hand. Your question may be answerable with a quick Google search or by simply experimenting. If you're using a method in Rails, look it up in the API Docs or in the Official Guides.
[06:42:10] Aeyrix: wow roasted
[06:42:17] arathald: interesting. I'll look through that. if nothing else, it might jog my memory as to what part of RoR bothered me
[06:42:32] Radar: arathald: Have you read Rails 4 in Action yet? :)
[06:42:43] rushed: arathald: noone cares why RoR bothered you~
[06:43:04] Radar: +q rushed!*@*
[06:43:05] Aeyrix: Do you? Why?
[06:43:14] Radar: Stop with the atagonistic attitudes, thanks.
[06:43:23] Aeyrix: Radar: Seriously. Since when was this channel "#whingeaboutror"?
[06:43:25] Radar: It's clear that arathald is trying to learn and you're driving him away.
[06:43:28] Aeyrix: rushed has a point tbh
[06:43:35] Aeyrix: He's going to drive people wanting to help him away
[06:43:40] Aeyrix: by spending time complaining about rails
[06:43:54] demonlove: religious war...
[06:43:56] Aeyrix: it's a well known meme that the best way to get linux help is to go into #linux and claim that Windows does it first try
[06:43:58] Aeyrix: but that doesn't apply here
[06:44:00] arathald: I'm not complaining about it. I'm telling you what I had a hard time with
[06:44:04] Radar: Aeyrix: uh, I don't see any complaints about Rails yet, other than he doesn't understand how the "magic" (read: code he doesn't yet understand) hangs together.
[06:44:05] arathald: there's a huge difference
[06:44:06] sevenseacat: no you're not
[06:44:17] Radar: (sorry, assumed "he" in there)
[06:44:19] Aeyrix: arathald: You used the phrase "bothered me"
[06:44:36] arathald: Aeyrix: yes, what I had a hard time with
[06:44:47] Aeyrix: Those two phrases mean very different things.
[06:44:58] Aeyrix: I have a hard time with Erlang.
[06:45:00] arathald: only if you infer something I didn't say
[06:45:01] Aeyrix: Erlang programmers bother me.
[06:45:13] Aeyrix: Apologies to any Erlang programmers in here, fwiw.
[06:45:57] arathald: I didn't say that any person bothered me. that's very different from saying that the magic/syntactic sugar was hard for me to wrap my mind around
[06:46:18] baweaver: has joined #RubyOnRails
[06:46:24] Radar: arathald: I think what's getting people's hackles up is that you don't have a concrete example yet.
[06:46:40] arathald: it very well could be that I wasn't reading the right tutorials, and the ones I did go through glossed over way too much of the internal workings
[06:46:42] Radar: arathald: Do you mind spending 5-10min reading/skimming http://guides.rubyonrails.org/getting_started.html and finding something in there that is something you don't understand the workings of?
[06:46:48] Aeyrix: We get a lot of trolls in here that literally just fucking shitpost about why RoR is bad.
[06:46:54] Aeyrix: It's not any religious war or anything, it's just boring.
[06:47:10] arathald: I'm not a troll. I'll thank you not to assume I am while I'm trying to learn
[06:47:16] _lazarevsky_: Radar: the assets pipeline has always been a mystery to me
[06:47:19] Aeyrix: Consequently, people coming in here and complain without specifics are generally treated with caution.
[06:47:27] Radar: _lazarevsky_: There's a guide AND a lotion for that.
[06:47:28] arathald: this isn't caution, it's hostility
[06:47:35] Aeyrix: Kind of both.
[06:47:40] Aeyrix: If you have a concrete example about it, feel free to share it and we'll help you work through it.
[06:47:51] Aeyrix: But 99% of the time, statistically, it's just someone probably from #django who wants to irritate some people.
[06:47:58] arathald: caution is understandable, hostility is uncalled for
[06:48:07] Radar: Aeyrix: arathald isn't one of those people
[06:48:13] arathald: Radar: sure, I'll read through it
[06:48:13] Radar: They've been here before and we've had productive discussions.
[06:48:16] Radar: arathald: thank you.
[06:48:27] _lazarevsky_: Aeyrix: ok here's one for instance. Is there a way to detect the initial request in a session to a rails app vs subsequent requests, a la .Net's isPostBack()
[06:48:38] arathald: yeah... I've actually been in this channel for over a year, I occasionally pop in and converse. I've never trolled in here
[06:48:48] Aeyrix: _lazarevsky_: Um, I'm going to say "yes", but I honestly wouldn't be able to tell you how.
[06:48:56] Aeyrix: It sounds like something that there'd absolutely be a way to do.
[06:49:18] siddart: has joined #RubyOnRails
[06:49:53] Aeyrix: _lazarevsky_: I *believe* that ASP.NET uses a simple session token for things like isPostBack().
[06:49:57] jun: has joined #RubyOnRails
[06:50:06] _lazarevsky_: Aeyrix: as soon as I find the answer I'll get back to you guys. Glad I could contribute to the Knowledge base of the Rails Community
[06:50:14] _lazarevsky_: consider that a payback for all the problems you've helped me with
[06:50:16] Aeyrix: _lazarevsky_: So if you take the same route, it shouldn't be too difficult. A cursory glance at this - http://stackoverflow.com/questions/4988300/rails-detect-if-users-very-first-visit - seems to indicate that it's not inbuilt.
[06:50:29] Aeyrix: I could be wrong though, but it'd only be three or four lines to implement.
[06:50:37] Radar: Aeyrix: I am thinking the same thing.
[06:51:03] Aeyrix: Oh man I pentest an ASP.NET app once and got remote code execution from that session token.
[06:51:07] Aeyrix: I don't even remember how I did it, it was hilarious though.
[06:51:15] Aeyrix: pentested, even.
[06:51:19] Aeyrix: I cannot type well today.
[06:51:34] mission712_: has joined #RubyOnRails
[06:52:09] ruurd: has joined #RubyOnRails
[06:52:25] p8m: has joined #RubyOnRails
[06:53:23] _lazarevsky_: Aeyrix: thanks for the link
[06:54:16] _lazarevsky_: Aeyrix: seems like I should be using session instead of cookie
[06:54:27] _lazarevsky_: because session is basically a cookie which last until you close your browser
[06:54:31] _lazarevsky_: which is exactly what I need
[06:54:32] Aeyrix: Yeah it's better to go with session.
[06:54:37] Aeyrix: Does that link say cookie?
[06:54:40] Aeyrix: Oh, it does, yeah.
[06:54:44] Aeyrix: Use session.
[06:54:52] Aeyrix: I'd edit it or something if I had the rep.
[06:55:02] _lazarevsky_: Aeyrix: I wanna time how long it takes between the initial request to the app to the last ajax request during the loading phase
[06:55:13] Aeyrix: There's better ways to do that.
[06:55:16] Aeyrix: Look into NewRelic
[06:55:20] _lazarevsky_: can't use newrelic or skylight
[06:55:24] Aeyrix: Ouch, why?
[06:55:25] _lazarevsky_: sevenseacat: :P
[06:55:33] _lazarevsky_: Aeyrix: behind VPN
[06:55:34] sevenseacat: Aeyrix: thats exactly what Radar and I already said
[06:55:39] Aeyrix: ... Wait why does that matter?
[06:55:52] _lazarevsky_: does NewRelic require access to my app?
[06:55:55] Radar: arathald: It's been almost 10 minutes. Do you see anything in the guide that seems magical to you yet?
[06:56:00] Aeyrix: You build NewRelic *into* your app.
[06:56:01] Radar: _lazarevsky_: No, you post data from your app to NewRelic.
[06:56:12] _lazarevsky_: one of the steps during registration is "Access to you app"
[06:56:15] Aeyrix: So as long as your app can access whateverthedickens.newrelic.com
[06:56:19] _lazarevsky_: that's why I assumed NewRelic needs access
[06:57:32] weihan_: has joined #RubyOnRails
[06:58:03] arathald: Radar: so far, I'm understanding it well enough I'm right up to creating the articles controller
[06:58:16] Radar: arathald: great :) keep going and let me know if anything is confusing.
[06:58:28] rushed: has joined #RubyOnRails
[06:58:29] arathald: I don't remember this part seeming too weird so far
[06:58:35] Radar: Damn timing issues in RSpec getting me down 2 days in a row :(
[06:58:57] Radar: Elements not being visible on pages when Capybara tests for them because the AJAX requests that add those elements don't complete quick enough.
[06:59:05] Radar: sleep(2) the rescue.
[07:02:57] arathald: Radar: alright, found the first bit that made me look twice
[07:03:01] arathald: articles_path
[07:03:24] Radar: arathald: Right. That's generated from the `config/routes.rb` code
[07:03:38] arathald: is that a helper generated when the controller was created, or is the framework magicking that into the path to articles some other way?
[07:04:23] arathald: in other words, would I find an actual articles_path helper somewhere in my code, or is that opaque to me at this level?
[07:04:26] Radar: Specifically, the resources :articles line added at the beginning of Chapter 5.
[07:04:39] Radar: arathald: It's not going to be defined in your code because it is defined dynamically by Rails.
[07:04:43] Radar: There's articles_path and articles_url
[07:04:59] Radar: Those are both methods defined dynamically by Rails, deep within... lemme find it
[07:05:42] IFrank00: "validations based on custom action" if I use Virtual Attributes on the form of each custom action, then I can do a if condition method like cancel_process. sound good ? any one
[07:05:44] Radar: arathald: https://github.com/rails/rails/blob/v4.2.4/actionpack/lib/action_dispatch/routing/route_set.rb#L134-L149
[07:05:59] Radar: arathald: resources :articles *eventually* calls that `add` method, which defines those methods.
[07:06:04] arathald: to be honest, it seems strange to me to have that kind of method generated in that way instead of just having a method like path_of :article
[07:06:10] arathald: if that makes some sense?
[07:06:12] Radar: arathald: Those methods are then defined on a module, which can be referenced at Rails.application.routes.url_helpers
[07:06:26] Radar: That module is then included into your controllers and views automatically by Rails.
[07:06:52] Radar: arathald: Right. You *can* have something like that, but the syntax is... quite verbose compared to article_path
[07:07:05] Radar: arathald: link_to @article.name, { controller: "articles", action: "show", id: @article.id }
[07:07:14] Radar: vs link_to @article.name, article_path(@article)
[07:07:21] Radar: Or even now, link_to @article.name, @article
[07:07:50] Pupeno: has joined #RubyOnRails
[07:07:55] Radar: I explain those kinds of routes in this blog post: http://ryanbigg.com/2012/03/polymorphic-routes/
[07:08:47] arathald: right. having rails, at least seemlingly, dynamically adding methods or even variables to a scope I'm working in is a little strange. in java land, you don't see somehting like that until you're *really* deep into reflectino and bytecode manipulation, and then you're doing something strange anyway
[07:08:58] lessless: has joined #RubyOnRails
[07:09:07] bmalum: has joined #RubyOnRails
[07:09:17] Radar: Yeah, I know enough Java to know that much, at least :) Ruby makes it easy to generate dynamic code through metaprogramming... although its use in day-to-day development is highly discouraged.
[07:09:22] arathald: so, at first blush, it makes my head spin just a bit. this isn't the only example, but it's the first one I ran across
[07:09:24] Radar: Rails does it because it makes your development life easier.
[07:09:36] IFrank00: so in my cancel_form I can have a hide_field with the Virtual Attribute to cancelling and then on my model have a method call cancel_process self.va == cancelling and use it for validation if cancel_process?
[07:09:38] arathald: yeah, seems like it's super convenient once you get used to it
[07:09:48] Radar: call "resources :articles" in `config/routes.rb` and get a whole bunch of routes configured along with their helpers.
[07:09:51] arathald: Radar: and seeing the code that generates that *significantly* unmagicks it for me
[07:10:03] Radar: IFrank00: Please gist the form and the model so we can understand better
[07:10:11] arathald: it's not magic, it's just... doing it
[07:10:12] Radar: arathald: excellent :)
[07:10:12] jun: has joined #RubyOnRails
[07:10:15] Ropeney: not just easier but alot faster too
[07:10:20] jenrzzz: has joined #RubyOnRails
[07:10:26] Radar: There is no magic in Rails. Just code you don't understand yet.
[07:10:34] nya: has joined #RubyOnRails
[07:10:34] nemo_: has joined #RubyOnRails
[07:10:37] IFrank00: radar, read my mind
[07:10:40] arathald: but a lot of rails docs treat it like magic
[07:10:45] arathald: and I don't like magic
[07:10:53] Macaveli: Since when is this bad code? https://gist.github.com/YOUConsulting/38e2711427a63267aa0a
[07:10:56] Macaveli: Locally runs fine
[07:10:56] Radar: arathald: because we're all used to the "magic" now and take a lot of it for granted.
[07:11:01] IFrank00: Radar, I was building one right now
[07:11:10] sevenseacat: Macaveli: no it doesnt
[07:11:14] sevenseacat: its a syntax error
[07:11:14] Radar: Macaveli: https://gist.github.com/YOUConsulting/38e2711427a63267aa0a#file-code-rb-L3
[07:11:20] Radar: Macaveli: You have a syntax error on that line.
[07:11:34] Macaveli: not when i run locally :(
[07:11:36] pawnbox: has joined #RubyOnRails
[07:11:38] Radar: Macaveli: Open irb
[07:11:40] Radar: Macaveli: enter f = find_or_create_by(:name: name("PRIVACY_URL"))
[07:11:43] arathald: Radar: do you know of any resources that go a little deeper into these kinds of explanations? I imagine that some books for RoR for Java developers may do that
[07:11:43] Radar: Macaveli: see it syntax error
[07:11:52] Macaveli: alright thanks
[07:12:14] Radar: arathald: No, sorry I don't. I wrote Rails 4 in Action along with sevenseacat and we do our best to "explain away the magic"
[07:12:22] Radar: imo it's the best book to learn Rails :)
[07:12:59] jun: has joined #RubyOnRails
[07:13:28] User458764: has joined #RubyOnRails
[07:14:37] arathald: Radar: do you remember offhand what part of the book would explain the _path and _url functions? I'd be interested to see if it's sufficient to satisfy my need for a magic-free world, or if I'll have to do some extra digging as part of my learning process
[07:14:53] Radar: lemme skim, one moment
[07:15:28] arathald: book title suggestion for what I'm looking for: "Rails for Skeptics"
[07:15:32] Ropeney: arathald, https://rebuilding-rails.com/ is a good book if you want the intricate details of rails.
[07:16:14] arathald: that first quote grabs me
[07:16:26] Aeyrix: Deep Dive Rails, anyone?
[07:16:51] rushed: has joined #RubyOnRails
[07:17:30] krz: has joined #RubyOnRails
[07:17:36] Radar: arathald: Section 3.4.3 of Rails 4 in Action explains the "resource" helper
[07:17:39] Ropeney: is DDR finished yet?
[07:17:45] Radar: Ropeney: Not even close :)
[07:17:50] arathald: I suppose that my realtively low familiarity with Ruby, especially the metaprogramming bits, doesn't help me
[07:18:25] Radar: arathald: http://i.imgur.com/GWHpkWM.png
[07:18:28] arathald: Radar: I figured it would be in one of the 3 free chapters :) taking a look
[07:21:40] Kara: has joined #RubyOnRails
[07:21:44] arathald: hmm... with a little bit more awareness of metaprogramming, the explanation there *might* be enough. at least it clearly defines what helpers are available, which is very useful
[07:22:04] arathald: much better than "oh, and you can just use article_routes here" wait what?
[07:22:35] karam: has joined #RubyOnRails
[07:22:52] Radar: yeah, assumed knowledge is bad
[07:23:20] Radar: so many people fail realising when they're explaining things that they're using assumed knowledge. Including myself. I'm glad that sevenseacat is better at not doing that than I am :)
[07:23:44] sevenseacat: arathald: you've caught me on a bad day, I'm not normally so irritable.
[07:24:04] arathald: so a resources entry in routes is basically just synctactic sugar for all of the REST routes and actions... plus a bit of extra sugar on top for _routes and _url (and presumably a few other things)?
[07:24:22] arathald: sevenseacat: I've chatted with you in here before, so I'm aware of that :)
[07:24:39] arathald: in fact, I recall you being one of the more reasonable people
[07:25:28] Radar: arathald: It's just the syntactic sugar for the routes, which map to actions in the controller. It'll generate _path and _url helpers that you can use in your app.
[07:25:38] Radar: The _path ones are like /articles/1 and _url are like http://yoursite.com/articles/1
[07:26:12] arathald: right, that's what I mean. syntactic sugar for the routes file. you still have to make the controllers and actions
[07:26:19] IFrank00: Radar, https://gist.github.com/Frank004/d59ac7d4402e827e3898
[07:26:38] Radar: arathald: correct :O)
[07:26:45] Radar: Dunno where the O came from. Have it for free.
[07:26:49] mission712_: has joined #RubyOnRails
[07:26:55] Radar: https://gist.github.com/Frank004/d59ac7d4402e827e3898#file-task_trans-rb-L3 IFrank00 this is invalid syntax.
[07:27:22] arathald: so that's why resource :article has rails looking for article#new, because as far as it's concerned, that's what's in the routes file
[07:27:34] arathald: for /article/new
[07:27:38] Radar: arathald: careful there. resource :article and resources :articles are different :)
[07:28:09] Radar: IFrank00: You're missing an attr_accessor in TaskTran for cancelling too.
[07:28:14] youngbaks: has joined #RubyOnRails
[07:28:17] Radar: arathald: !routing
[07:28:17] helpa: arathald: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[07:28:32] Radar: Section 2.5 explains singular resources
[07:28:44] arathald: dammit, something else really useful to bookmark
[07:29:01] IFrank00: radar, update it
[07:29:26] arathald: ah, the singular resource bit actually makes a lot of sense
[07:29:32] Radar: IFrank00: This is still invalid https://gist.github.com/Frank004/d59ac7d4402e827e3898#file-task_trans-rb-L3
[07:29:44] Radar: IFrank00: You will need to make cancelling_process? there a symbol, otherwise it will try to call a class method of the same name.
[07:29:52] arathald: a singleton of sorts
[07:30:27] Radar: arathald: yup
[07:30:54] arathald: okay, you've convinced me rails can be sufficiently unmagicked to give it another try
[07:31:08] arathald: ACTION sets numerous bookmarks
[07:31:40] dionysus69: has joined #RubyOnRails
[07:32:34] honzahov1: has joined #RubyOnRails
[07:33:21] GriffinHeart: has joined #RubyOnRails
[07:35:54] arathald: also, you've sold a book
[07:37:32] Radar: more yay :)
[07:38:16] arathald: now to learn ruby metaprogramming and confuse the hell out of my coworkers with elaborate ruby scripts :)
[07:38:22] Radar: One day I'll see royalties from that book ;)
[07:39:38] sevenseacat: *takes advance and runs off
[07:40:08] IFrank00: Radar, https://gist.github.com/Frank004/d59ac7d4402e827e3898 how about now??
[07:40:40] arathald: I do still want to learn scala at some point. it looks nice
[07:40:42] sevenseacat: IFrank00: do you have a specific problem?
[07:40:50] sevenseacat: like, why are you showing us this code
[07:40:50] Radar: IFrank00: You're missing cancelling from TaskTransController#task_tran_params
[07:41:07] Radar: arathald: Learn Elixir instead :)
[07:41:13] sevenseacat: mmmm elixir <3
[07:41:13] Radar: arathald: That's what I'm doing, at least.
[07:41:20] IFrank00: Radar, yes just add it updating it on the gist now
[07:42:16] arathald: Radar: I'm a professional java-stack web dev. I think scala could be very useful. I actually think it's very possible I could get away with writing and/or rewriting some of our codebase in scala
[07:42:31] arathald: especially since we have a complete stack migration coming up next year
[07:43:36] arathald: I tested the waters by throwing some java 8 "functional" code into my latest CR. we'll see what happens with that :)
[07:43:58] etrae: has joined #RubyOnRails
[07:44:16] Radar: Alright, I need to get ready for tonight. It's been fun chatting.
[07:44:17] IFrank00: Radar, updated
[07:44:32] Radar: IFrank00: Does it work?
[07:44:35] Radar: IFrank00: Looks good to me.
[07:44:36] arathald: I should probably go to bed soon myself. thanks for the help!
[07:45:03] IFrank00: trying it out now
[07:45:18] krz: has joined #RubyOnRails
[07:45:23] Mia: has joined #RubyOnRails
[07:45:23] Mia: has joined #RubyOnRails
[07:46:00] trosborn: has joined #RubyOnRails
[07:46:21] IFrank00: getting this undefined method `cancelling_process?'
[07:47:19] ruurd: has joined #RubyOnRails
[07:47:23] IFrank00: is for the ?
[07:52:45] Or1on: has joined #RubyOnRails
[07:53:58] Kara: has joined #RubyOnRails
[07:55:12] karam: has joined #RubyOnRails
[07:59:44] darutoko: has joined #RubyOnRails
[08:00:46] IFrank00: radar, simple jaja yeah . I was doing this cancelling == true like a bolean when im doing a string on the hidden_field dah!
[08:01:48] IFrank00: Radar, thanks for your help got this baby lock and ready for deployment. yes new update great progress on my learning curve
[08:03:30] _3by8: has joined #RubyOnRails
[08:09:55] hephaestus_rg: has joined #RubyOnRails
[08:19:24] voker57: has joined #RubyOnRails
[08:19:53] _3by8: So how should I go about this: creating a website for a company who has a number of customers. I've got a users model with an admin flag and I want the admin type users to have a special landing page. I don't need another model so would it be okay to just create a... not sure what it's called... method? within the users controller called admin that I could redirect them to on login?
[08:21:51] Scoutlink: has joined #RubyOnRails
[08:21:55] _3by8: I guess my problem is that it seems like it goes against the principles of REST architecture, right?
[08:23:30] workmad3: has joined #RubyOnRails
[08:25:36] Kara: has joined #RubyOnRails
[08:25:47] Scoutlink: has left #RubyOnRails: ()
[08:31:49] Macaveli: has joined #RubyOnRails
[08:34:33] arup_r: has joined #RubyOnRails
[08:34:46] p8m: has joined #RubyOnRails
[08:35:07] trosborn: You could create a new controller called AdminController and redirect to a method in it
[08:35:29] _3by8: Oh, true. So a controller doesn't necessarily have to be attached to a model then, right?
[08:35:39] _3by8: I'm trying to stick to conventions.
[08:35:49] _3by8: So I learn how to do things properly, I guess.
[08:36:40] arup_r: _3by8: kind of right.
[08:37:46] _3by8: arup_r: well I don't necessarily need an admin model. Just a boolean flag, really. Unless you think I should create another table, I forget what it's called now. Second form or something?
[08:37:47] trosborn: A controller does not need a model. I sometimes use a controller called ???WelcomeController??? or ???StaticController??? to hold methods for things like landing pages.
[08:38:00] _3by8: trosborn: okay.
[08:38:25] arup_r: yep trosborn is true
[08:43:15] ruurd: has joined #RubyOnRails
[08:44:06] marr: has joined #RubyOnRails
[08:45:30] stardiviner: has joined #RubyOnRails
[08:50:45] siddart: has joined #RubyOnRails
[08:54:22] neanderslob: has joined #RubyOnRails
[08:55:06] ruurd: has joined #RubyOnRails
[08:55:59] iamjarvo_: has joined #RubyOnRails
[08:56:02] herbst: has joined #RubyOnRails
[08:58:52] neanderslob: hi everyone, I'm following this tutorial (http://www.opendrops.com/rails/2015/01/30/rails-globalid-polymorhphic-select-form/) on using global variables with polymorphic relationships
[08:59:13] neanderslob: (I'm sorry, that's global ids)
[09:00:56] neanderslob: however I'm running into trouble with their add_foreign_key line when I migrate; saying that the relation "owners" doesn't exist
[09:03:56] raj___: has joined #RubyOnRails
[09:04:10] cleopatra: has joined #RubyOnRails
[09:04:27] cleopatra: ACTION back :)
[09:05:37] htmldrum: has joined #RubyOnRails
[09:05:52] pawnbox: has joined #RubyOnRails
[09:07:22] Cervajz: has joined #RubyOnRails
[09:07:23] ahmgeek: has joined #RubyOnRails
[09:09:10] Cervajz_: has joined #RubyOnRails
[09:14:35] meoblast001: has joined #RubyOnRails
[09:15:07] ahmgeek: folks, can I move a dragonfly process to sidekiq
[09:17:32] moei: has joined #RubyOnRails
[09:18:17] neanderslob: ahmgeek: yea, it's been sort of quiet in here
[09:18:38] ahmgeek: what's the time at your side of the planet ?
[09:18:49] neanderslob: ahmgeek: I'd answer but I honestly have no idea :-)
[09:18:59] neanderslob: ahmgeek: 3:18AM
[09:19:00] trosborn: are you sure the migration you are running is exactly the same as the one in the tutorial?
[09:19:09] honzahovorka: has joined #RubyOnRails
[09:19:57] ahmgeek: well, I wish you have a nice evening Sam.
[09:20:04] neanderslob: trosborn: just about sure; if there's nothing obviously wrong with the tutorial I can send you my migration
[09:21:10] neanderslob: ahmgeek: and you too
[09:22:11] trosborn: go ahead and send me your migration :)
[09:22:15] glennt: has joined #RubyOnRails
[09:23:20] neanderslob: trosborn: will do, one moment
[09:23:28] bruno-: has joined #RubyOnRails
[09:24:47] neanderslob: trosborn: here you go:https://gist.github.com/BigMcLargeHuge/cf579fc1525bc5f99049
[09:24:58] neanderslob: trosborn: thanks for having a look
[09:25:14] ahmgeek: has left #RubyOnRails: ("Leaving")
[09:26:39] alexhartley: has joined #RubyOnRails
[09:26:44] nyaa: has joined #RubyOnRails
[09:28:11] yfeldblum: has joined #RubyOnRails
[09:29:04] trosborn: have you tried pluralizing owner in line 18? add_foreign_key :stockholders, :owners
[09:30:00] neanderslob: trosborn: actually that's the way I have it; I just updated the gist
[09:30:32] neanderslob: trosborn: (but I've tried lots of different combinations of plural and singular)
[09:32:30] neanderslob: trosborn: sevenseacat had a blog post on this very error: http://sevenseacat.net/2015/02/24/add_foreign_key_gotchas.html but her solution didn't alleviate it either
[09:34:44] Spami: has joined #RubyOnRails
[09:35:04] nemo_: has joined #RubyOnRails
[09:35:55] sevenseacat: someone rang?
[09:36:37] trosborn: I would try running bundle exec rake db:migrate
[09:37:00] trosborn: if you haven't
[09:37:05] sevenseacat: if you dont have an owners table, that code wont work
[09:38:42] neanderslob: trosborn: hah, yea saw that post too... it didn't
[09:39:19] neanderslob: sevenseacat: ah, I was wondering if that was necessary but they didn't say anything about it in the tutorial I was following
[09:39:38] pawnbox: has joined #RubyOnRails
[09:39:48] sevenseacat: if your tutorial uses sqlite, it wont matter because the rails sqlite adapter doesnt support foreign keys
[09:41:03] neanderslob: sevenseacat: doesn't specify; here's what I'd been following: http://www.opendrops.com/rails/2015/01/30/rails-globalid-polymorhphic-select-form/
[09:41:46] sevenseacat: ok, so you have a users table, not an owners table. so my blog post does apply - you want the owner_id field to be used as the fk between the posts and users table
[09:42:11] sevenseacat: eg. add_foreign_key :posts, :users, column: :owner_id
[09:42:33] Peteykun: has joined #RubyOnRails
[09:43:51] dici: has joined #RubyOnRails
[09:43:58] awrfas2: has joined #RubyOnRails
[09:44:06] neanderslob: sevenseacat: ah, I actually misread your post and put in owners, column: owner_id
[09:44:23] neanderslob: fixing it worked
[09:45:19] sevenseacat: good to know the ramblings I put on my blog do get read and can be useful
[09:45:21] neanderslob: sevenseacat: ah, wait, not sure that's what I wanted to do
[09:45:46] Juanchito: has joined #RubyOnRails
[09:45:47] neanderslob: sevenseacat: I've actually read a couple of them; they're much appreciated
[09:47:24] neanderslob: sevenseacat: the reason for the addition of a foreign key is to add a polymorphic association, so I don't think that I want to just bind it to :users
[09:47:27] jenrzzz: has joined #RubyOnRails
[09:48:08] sevenseacat: then adding a foreign key there makes no sense
[09:48:13] yashinbasement: has joined #RubyOnRails
[09:48:16] sevenseacat: so I don't know what the tutorial was trying to do
[09:48:43] neanderslob: sevenseacat: well that's good to know\
[09:49:38] neanderslob: sevenseacat: the trick was that it was taking advantage of global ids
[09:49:51] neanderslob: sevenseacat: ....if that makes any difference
[09:49:59] sevenseacat: I don't know what that is, so
[09:50:27] sameerynho: has joined #RubyOnRails
[09:51:25] neanderslob: sevenseacat: uncharted territory for sevenseacat; yikes here be dragons
[09:51:48] trosborn: neaderslob: Have you watched the Railscast on polymorphic associations?
[09:52:19] trosborn: http://railscasts.com/episodes/154-polymorphic-association-revised
[09:53:24] iateadonut: has joined #RubyOnRails
[09:57:03] neanderslob: sevenseacat: I have and doing it that way helped me pull it off once before; I'm trying to use global ids (baked into rails as of 4.2) to avoid needing to add two fields to my database....also because it was new and kind of cool
[09:57:26] neanderslob: sevenseacat: sorry, that was ment for trosborn
[09:57:34] vigintas: has joined #RubyOnRails
[09:58:30] neanderslob: trosborn: but yea, it's a solid method, this new global id addition seemed really cool though
[09:59:27] neanderslob: anyway, thank you both but I think I'll call it quits and give it a shot tomorrow
[10:00:11] trosborn: no problem :)
[10:01:54] EminenceHC: has joined #RubyOnRails
[10:05:43] jgt: has joined #RubyOnRails
[10:07:20] karam: has joined #RubyOnRails
[10:07:21] Kara: has joined #RubyOnRails
[10:10:05] yogeshrt: has joined #RubyOnRails
[10:11:28] workmad3: has joined #RubyOnRails
[10:14:41] blackhuey: has joined #RubyOnRails
[10:14:58] Pupeno: has joined #RubyOnRails
[10:18:35] htmldrum: has joined #RubyOnRails
[10:19:12] User458764: has joined #RubyOnRails
[10:19:26] Octophore: has joined #RubyOnRails
[10:19:43] quazimodo: has joined #RubyOnRails
[10:25:07] workmad3: has joined #RubyOnRails
[10:25:17] big|bad|wolf: has joined #RubyOnRails
[10:27:24] MaDErroR123: has joined #RubyOnRails
[10:29:02] octophore2: has joined #RubyOnRails
[10:32:17] maokomioko: has joined #RubyOnRails
[10:33:49] p8m: has joined #RubyOnRails
[10:40:19] siaW: has joined #RubyOnRails
[10:45:50] lucha: has joined #RubyOnRails
[10:53:40] lucha: has left #RubyOnRails: ()
[10:55:59] DaniG2k: has joined #RubyOnRails
[10:56:32] rikkipitt: has joined #RubyOnRails
[11:00:42] lxsameer_: has joined #RubyOnRails
[11:05:46] stardiviner: has joined #RubyOnRails
[11:05:59] mrbubbles: has joined #RubyOnRails
[11:12:35] weihan: has joined #RubyOnRails
[11:12:53] Kara: has joined #RubyOnRails
[11:13:53] big|bad|wolf: has joined #RubyOnRails
[11:19:21] htmldrum: has joined #RubyOnRails
[11:25:54] workmad3: has joined #RubyOnRails
[11:26:21] stamina: has joined #RubyOnRails
[11:26:21] unreal_: has joined #RubyOnRails
[11:26:27] netzfisch: has joined #RubyOnRails
[11:27:57] darrencauthon: has joined #RubyOnRails
[11:31:12] unreal: has joined #RubyOnRails
[11:33:14] michael_mbp: has joined #RubyOnRails
[11:36:21] DEA7TH: has joined #RubyOnRails
[11:38:19] chipotle: has joined #RubyOnRails
[11:40:48] Kara: has joined #RubyOnRails
[11:42:27] karam: has joined #RubyOnRails
[11:42:45] jenrzzz: has joined #RubyOnRails
[11:44:01] Caius: has joined #RubyOnRails
[11:44:08] etrae: has joined #RubyOnRails
[11:44:31] karam: has joined #RubyOnRails
[11:44:32] MaDErroR123: has joined #RubyOnRails
[11:46:58] shinnya: has joined #RubyOnRails
[11:51:01] bufferino: has joined #RubyOnRails
[11:51:02] wethu: has joined #RubyOnRails
[11:58:14] workmad3: has joined #RubyOnRails
[12:05:55] GriffinHeart: has joined #RubyOnRails
[12:08:49] big|bad|wolf: has joined #RubyOnRails
[12:10:51] taxen: has joined #RubyOnRails
[12:11:59] siaW: has joined #RubyOnRails
[12:12:32] taxen: What's wrong with the following line: Tournament.where("end < ?", Date.today)
[12:12:35] taxen: (end is a datetime field)
[12:12:40] taxen: I'm getting erros in IRB
[12:14:58] Pupeno: has joined #RubyOnRails
[12:15:50] sameerynho: has joined #RubyOnRails
[12:16:02] tbuehlmann: taxen, what errors?
[12:16:36] taxen: PG::SyntaxError: ERROR: syntax error at or near "end"
[12:16:36] taxen: LINE 1: SELECT "tournaments".* FROM "tournaments" WHERE (end > '2015...
[12:16:55] taxen: tbuehlmann: ^^
[12:17:33] arup_r: end is a keyword.
[12:17:41] arup_r: may be that is causing the issue
[12:17:59] taxen: arup_r: ok. is start a keyword as well?
[12:18:33] arup_r: "end < ?" you have inside a query.. But why the error is saying? " WHERE (end > '2015
[12:18:42] taxen: arup_r: hm, yeah, that seems to be the problem. "start < ?", ... works
[12:19:04] taxen: arup_r: yeah, I just tried changing the < around
[12:19:09] taxen: same error
[12:19:27] arup_r: yes, but why the query is doing `>` while you have `>`.
[12:19:43] Octophore: has joined #RubyOnRails
[12:19:52] arup_r: you have `<` **
[12:20:08] jgt: has joined #RubyOnRails
[12:20:12] arup_r: taxen: show the IRB code with error as a gist
[12:20:56] tbuehlmann: taxen, just wrote an app with a model having an "end" date column, works for me
[12:21:20] tbuehlmann: do you have any default_scopes hanging around?
[12:21:50] octophore2: has joined #RubyOnRails
[12:21:57] htmldrum: has joined #RubyOnRails
[12:22:33] arup_r: tbuehlmann: Ha, you wrote a full app within few minutes.. Your internet seems super fast
[12:22:52] tbuehlmann: but! I tested with sqlite3, not pg. using pg, same error
[12:23:09] taxen: tbuehlmann: ok, that must be why. I'm using pg.
[12:23:09] taxen: https://gist.github.com/anonymous/20906614b6c1f54e1b42
[12:23:27] chipotle: has joined #RubyOnRails
[12:23:31] taxen: tbuehlmann: no scopes that I know of :)
[12:23:42] tbuehlmann: I rather think it's postgres not allowing "end" instead of rails
[12:23:58] taxen: it's a bit vauge
[12:24:07] tbuehlmann: yup, looks like it: http://www.postgresql.org/docs/9.4/static/sql-keywords-appendix.html
[12:24:09] taxen: I should probably change it
[12:24:10] arup_r: yes, because postgres also has a reserve keyword `end`
[12:24:11] CaseyOnHex: has joined #RubyOnRails
[12:24:25] arup_r: taxen: yes, please rename the column
[12:24:37] taxen: thanks guys
[12:24:56] tbuehlmann: or quote the column name in the query
[12:25:24] tbuehlmann: the problem is not really postgres, but you writing sql strings
[12:25:30] arup_r: But it is really better to rename
[12:25:32] tbuehlmann: there's no column quoting
[12:25:50] taxen: I agree it should be a bit more specific
[12:26:03] taxen: have any of you used simple_token_authentication gem? I'm having issues getting the token to update when creating or signing in users.
[12:26:18] tbuehlmann: this should work: Tournament.where(Tournament.arel_table[:end].lt(Date.today))
[12:26:39] taxen: tbuehlmann: yep, works.
[12:26:42] execute: has left #RubyOnRails: ("Leaving...")
[12:27:05] SanguineAnomaly: has joined #RubyOnRails
[12:27:21] wethu: has joined #RubyOnRails
[12:27:57] tbuehlmann: (still wishing Tournament[:end] would be a thing)
[12:28:42] taxen: tbuehlmann: simple_token_authentication? ^^
[12:29:06] ahmgeek: has joined #RubyOnRails
[12:29:32] ahmgeek: get dragonfly image path to use with imageoptim ? the documentation seems to lack it
[12:37:27] AzaToth: has joined #RubyOnRails
[12:37:43] wethu: has joined #RubyOnRails
[12:38:10] Spami: has joined #RubyOnRails
[12:38:19] ahmgeek: has left #RubyOnRails: ("Leaving")
[12:39:53] GriffinHeart: has joined #RubyOnRails
[12:41:45] sankaber: has joined #RubyOnRails
[12:42:27] sankaber: has joined #RubyOnRails
[12:44:44] big|bad|wolf: has joined #RubyOnRails
[12:45:08] Oog: has joined #RubyOnRails
[12:46:30] stardiviner: has joined #RubyOnRails
[12:47:21] hd1: has joined #RubyOnRails
[12:47:46] hd1: https://gist.github.com/hdiwan/26eff5d5034ea1dbf0dd there's an error somewhere in here, i can't find it, help?
[12:48:03] MaDErroR123: has joined #RubyOnRails
[12:48:37] rubyonrails498: has joined #RubyOnRails
[12:48:56] arup_r: show the error please
[12:53:50] youngbaks: has joined #RubyOnRails
[12:54:16] arup_r: hd1: ^^ :D
[12:54:59] yogeshrt: has joined #RubyOnRails
[12:56:04] DoubleMalt: has joined #RubyOnRails
[12:58:08] sevenseacat: I can see where it is, but you need to provide more useful information.
[12:58:10] superlou: has joined #RubyOnRails
[12:58:37] stardiviner: has joined #RubyOnRails
[13:01:52] pwnd_nsfw: has joined #RubyOnRails
[13:02:56] SanguineAnomaly: has joined #RubyOnRails
[13:03:41] youngbaks: has joined #RubyOnRails
[13:04:59] tknz: has joined #RubyOnRails
[13:06:47] mrbubbles: has joined #RubyOnRails
[13:06:57] ruurd: has joined #RubyOnRails
[13:07:03] nemo_: has joined #RubyOnRails
[13:08:16] iateadonut: has joined #RubyOnRails
[13:10:46] hd1: _form.html.haml:34: syntax error, unexpected keyword_ensure, expecting end-of-input
[13:12:07] Kara: has joined #RubyOnRails
[13:13:30] Octophore: has joined #RubyOnRails
[13:14:38] defsdoor: has joined #RubyOnRails
[13:15:02] gavit: wtb helpermethod select_day_of_the_week
[13:15:30] karam: has joined #RubyOnRails
[13:15:34] octophore2: has joined #RubyOnRails
[13:16:48] hd1: arup_r: _form.html.haml:34: syntax error, unexpected keyword_ensure, expecting end-of-input
[13:17:12] workmad3: has joined #RubyOnRails
[13:22:06] Peteykun: has joined #RubyOnRails
[13:24:02] sevenseacat: hd1: https://gist.github.com/hdiwan/26eff5d5034ea1dbf0dd#file-_form-html-haml-L4-L5
[13:24:27] Jon30: has joined #RubyOnRails
[13:24:30] sevenseacat: and the next line
[13:25:06] youngbaks: has joined #RubyOnRails
[13:27:07] hd1: sevenseacat: ok is it supposed to be on one line?
[13:27:29] sevenseacat: you indent things when they're nested inside each other
[13:28:00] sevenseacat: what is the string "prevented this pin from saving." nested inside?
[13:29:39] hd1: it's a static string
[13:29:48] sevenseacat: yes, but you're trying to nest it inside something
[13:29:50] sevenseacat: it is indented
[13:30:01] hd1: the h2 tag
[13:30:18] sevenseacat: is that what its indented under? (no)
[13:30:52] atomical: has joined #RubyOnRails
[13:36:21] Moeh: has joined #RubyOnRails
[13:36:53] johnflux: has joined #RubyOnRails
[13:36:53] johnflux: has joined #RubyOnRails
[13:37:28] Moeh: I would like to serialize one column of a model as "PG::Result", so in the model.rb I added "serialize :sample, PG::Result", however on model.new I get an error. Any tips how to initialize an empty PG::Result object that will then be filled by an actual PG::Result?
[13:38:07] ruurd: has joined #RubyOnRails
[13:40:26] acti0nman: has joined #RubyOnRails
[13:42:17] victortyau: has joined #RubyOnRails
[13:43:30] darrencauthon: has joined #RubyOnRails
[13:45:01] etrae: has joined #RubyOnRails
[13:45:17] jenrzzz: has joined #RubyOnRails
[13:45:30] lessless: has joined #RubyOnRails
[13:46:24] hd1: https://gist.github.com/hdiwan/26eff5d5034ea1dbf0dd
[13:46:34] hd1: what did I sod up now?
[13:46:39] hd1: error's the second file
[13:47:25] sevenseacat: same line https://gist.github.com/hdiwan/26eff5d5034ea1dbf0dd#file-_form-html-haml-L5
[13:47:33] MaDErroR123: has joined #RubyOnRails
[13:47:36] sevenseacat: you're trying to evaluate something and then you have static content as well
[13:47:43] corehook: has joined #RubyOnRails
[13:48:00] Octophore: has joined #RubyOnRails
[13:48:32] sevenseacat: = is for evaluating and printing ruby code only
[13:49:00] hd1: ok.. then the static text goes on the next line, at the same indent level?
[13:49:12] chipotle: has joined #RubyOnRails
[13:50:11] hd1: i thought it was aligned with the pluralize, it's aligned with the '='
[13:51:35] octophore2: has joined #RubyOnRails
[13:54:16] michael_mbp: has joined #RubyOnRails
[13:55:30] atomical_: has joined #RubyOnRails
[13:56:09] nicks_: has joined #RubyOnRails
[13:57:34] hd1: thanks sevenseacat
[13:57:44] hd1: has left #RubyOnRails: ()
[13:58:39] mary5030: has joined #RubyOnRails
[13:59:23] nicks_: Hi guys, I have 2 tables - users, and topics. Topics just holds every unique topic title. Now what I want to do is create a table so that a user can have/follow certain topics. What would be the best naming convention for this?
[14:00:25] nicks_: Should I name the model "UsersTopic" or "UserTopic" ?
[14:00:49] rodfersou: has joined #RubyOnRails
[14:02:33] tbuehlmann: I'm not a fan of such assembled models. I'd probably go with "Follow"
[14:02:53] tbuehlmann: then I'd check if that's an english word at all and chose the right one
[14:03:18] karam: has joined #RubyOnRails
[14:04:00] chipotle: has joined #RubyOnRails
[14:04:01] monq: has joined #RubyOnRails
[14:04:43] nicks_: So something like "FollowedTopic"?
[14:05:22] tbuehlmann: that's okay, I think
[14:05:28] nicks_: When you say you're not a fan of such models, are you referring to the pivot table design?
[14:06:17] adac: has joined #RubyOnRails
[14:06:36] tbuehlmann: not a fan of using the model names assembled together, like "assemblies_parts"
[14:06:48] tbuehlmann: or groups_users
[14:06:58] tbuehlmann: I prefer group_memberships
[14:07:16] nicks_: Ahh okay, I see what you mean
[14:08:36] nicks_: Another quick question. In terms of being able to access topics through the followed_topics table, how would I go about doing that? followed_topics will simply hold the user_id and the topic_id
[14:08:36] karam: has joined #RubyOnRails
[14:09:03] nicks_: If I want to access all topics where the "user_id" is "x" inside of followed_topics
[14:09:16] tbuehlmann: right. you'd have User.has_many :followed_topics; User.has_many :topics, through: :followed_topics
[14:10:03] tbuehlmann: it's just user.topics then
[14:10:12] nicks_: Thanks, and you'd access the topics via the user model?
[14:10:36] tbuehlmann: that's the one way. if you need the other way, just set it up that way, too
[14:10:42] Trynemjoel: has joined #RubyOnRails
[14:11:15] nicks_: Thanks a lot for your help, gona try this out now :)
[14:11:22] tbuehlmann: very welcome
[14:11:51] pontiki: has joined #RubyOnRails
[14:14:58] renews: has joined #RubyOnRails
[14:17:05] nicks_: I've added has_many :followed_topics and has_many :topics, through: :followed_topics to the user model
[14:17:37] nicks_: But when I try to call User.topics, I get an error saying "undefined method 'topics'"
[14:18:17] nicks_: Do I need to create a method for this as well?
[14:18:18] tbuehlmann: nicks_, you want to call that on a user instance, not the class
[14:19:28] chipotle: has joined #RubyOnRails
[14:22:08] chills42: has joined #RubyOnRails
[14:22:23] Polysics: has joined #RubyOnRails
[14:22:37] Polysics: I have a tricy form to build and I am slightly confused
[14:22:41] htmldrum: has joined #RubyOnRails
[14:23:00] Polysics: Repair has_many RepairItems has_many ServiceAnswers
[14:23:10] MaDErroR123: has joined #RubyOnRails
[14:23:15] Polysics: ServiceAnswer belongs_to ServiceQuestion
[14:23:29] Polysics: where essentially the question contains the text and a few other hints
[14:23:44] lessless: has joined #RubyOnRails
[14:24:03] Polysics: each item has its own set of answers and they can be different (based on a subtype, so a drill has different questions than a saw)
[14:24:19] Polysics: the edit form is actually very simple to build using accepts_nested
[14:24:29] Polysics: but the new form is driving me mad
[14:25:01] Polysics: am I supposed to build the entire structure in the `new` action? going over every RepairItem and #build-ing the question list?
[14:26:29] n1ck7: has joined #RubyOnRails
[14:27:34] ruurd: has joined #RubyOnRails
[14:30:39] banister: has joined #RubyOnRails
[14:30:56] chipotle: has joined #RubyOnRails
[14:31:29] pontiki: polysics: pretty much, yeah
[14:31:47] krz: has joined #RubyOnRails
[14:31:56] Polysics: pontiki: I was looking into iterating in the view, essentially replicating the parameter structure
[14:32:01] Polysics: bad idea or worst idea? :D
[14:32:07] pontiki: don't put logic in your views
[14:32:24] Polysics: yeah, I agree, it's a dead end
[14:32:33] Polysics: so in `new` I just iterate and build everything?
[14:32:56] pontiki: you may want to write a form object, that will also take out that same logic from the controller
[14:34:19] pontiki: there's a good ep on them on railscasts
[14:34:23] Polysics: pontiki: can you elborate on that jsut a little?
[14:35:04] chills42: has joined #RubyOnRails
[14:35:38] bmalum: has joined #RubyOnRails
[14:35:58] chouhoulis: has joined #RubyOnRails
[14:36:59] pontiki: a form object is a non-persisted model that handles the building, validating, and saving of the full object you in to use in your form
[14:37:51] Polysics: I think my form is not that complicated yet, but I'll read up
[14:40:25] pontiki: you're nested 3 layers deep. it is that compilicated
[14:41:54] chouhoulis: has joined #RubyOnRails
[14:43:26] sunya7a_: has joined #RubyOnRails
[14:45:05] nyaa: has joined #RubyOnRails
[14:45:26] bmxer: has joined #RubyOnRails
[14:45:55] pontiki: a form object isn't complicated; it removes the implementation from the controller and the view; it doesn't belong in any of the persisted object models exclusively, and it gives you a very testable implementation, independent of having to run through the stack to see if it works.
[14:46:47] beauby: has joined #RubyOnRails
[14:48:48] chipotle: has joined #RubyOnRails
[14:53:16] smathy: has joined #RubyOnRails
[14:53:46] camilasan: has joined #RubyOnRails
[14:55:08] chills42: has joined #RubyOnRails
[14:58:50] chouhoulis: has joined #RubyOnRails
[14:58:57] chipotle: has joined #RubyOnRails
[14:59:18] Polysics: I understand, especially testability sounds like a great thing, testing this stuff is insanity :)
[15:01:21] Meow-J: has joined #RubyOnRails
[15:05:14] workmad3: has joined #RubyOnRails
[15:06:11] chipotle: has joined #RubyOnRails
[15:06:19] mary5030: has joined #RubyOnRails
[15:06:52] ellisTAA: has joined #RubyOnRails
[15:07:24] ellisTAA: i???ve tried everything and for some reason i can???t get the checkbox to work on my form, can someone take a look at this: https://gist.github.com/ellismarte/ecc7014d23c3d1096ad9
[15:11:10] tbuehlmann: EllisTAA, not sure why you are assigning value and checked variables there
[15:11:48] ellisTAA: tbuehlmann: i followed this: http://apidock.com/rails/v4.0.2/ActionView/Helpers/FormTagHelper/check_box_tag
[15:12:22] tbuehlmann: whatever, try this first: `<%= check_box_tag "offer_notification", "1", true) %>`
[15:12:34] ellisTAA: tbuehlmann: ok let me try that
[15:12:36] tbuehlmann: then tell us what's happening
[15:14:00] ellisTAA: k one minute, i gotta fix something
[15:16:04] tbuehlmann: I mean, your code should work. you just don't have to call the method like that
[15:17:05] ellisTAA: tbuehlmann: https://gist.github.com/ellismarte/3b6897c86cab7c54d8ec
[15:17:12] ellisTAA: the page won???t load with that
[15:17:30] tbuehlmann: remove that )
[15:18:13] ellisTAA: oh ok i just saw that msg
[15:18:50] honzahovorka: has joined #RubyOnRails
[15:19:02] chipotle: has joined #RubyOnRails
[15:20:18] ischwartz: has joined #RubyOnRails
[15:20:32] jun: has joined #RubyOnRails
[15:20:40] ellisTAA: tbuehlmann: so the page loaded and in the html it the checkbox is there, but i don???t see it
[15:21:03] tbuehlmann: so it's working? \o/
[15:21:26] Macaveli: has joined #RubyOnRails
[15:21:26] workmad3: has joined #RubyOnRails
[15:21:32] ellisTAA: yeah but i???ve gotten to this point??? i dont get why it doesn???t show up on the page
[15:21:49] tbuehlmann: some css hiding it?
[15:22:06] ischwartz: I missed the beginning of the conversation, did you genereate the checkbox using ERB?
[15:22:08] ellisTAA: tbuehlmann: well there is not field called hidden
[15:22:25] ellisTAA: ischwartz: using check_box_tag
[15:22:36] ischwartz: Does the ERB have the equals sign in it to make it appear?
[15:22:48] ischwartz: I often forget that
[15:22:49] tbuehlmann: it wouldn't be in the HTML
[15:22:56] tbuehlmann: it's in the HTML, but not visible
[15:22:58] tbuehlmann: is it in an html comment?
[15:23:22] ischwartz: Is there a github where we can see the code?
[15:23:27] ellisTAA: yes i used <%= and
[15:23:49] ellisTAA: if you login: http://interviewqueue.com/
[15:23:55] ellisTAA: and click under settings
[15:24:22] ellisTAA: if u dont want to i can gist it
[15:24:33] tbuehlmann: sign up credentials?
[15:24:59] lessless: has joined #RubyOnRails
[15:25:03] ischwartz: This is the GIST right? https://gist.github.com/ellismarte/ecc7014d23c3d1096ad9#file-checkbox-rb
[15:26:17] ellisTAA: ischwartz: that???s old let me update it
[15:26:33] ellisTAA: tbuehlmann: i think the problem might be with materialize
[15:26:53] ellisTAA: bc when i load a page without css it shows the button
[15:27:25] tbuehlmann: there you go
[15:27:51] DLSteve: has joined #RubyOnRails
[15:32:42] ischwartz: I actually came on today looking for some guidance
[15:32:49] Mia: has joined #RubyOnRails
[15:33:26] ischwartz: I'm self-teaching rails, and I've gotten pretty comfortable with what I think are a lot of the basics. I can make a crud app easily
[15:33:48] ischwartz: I understand some schema stuff like polymorphism and join tables
[15:34:12] ischwartz: I don't really know what to learn next
[15:34:42] ischwartz: I was wondering if any of you could suggest a more advanced type of project that I could try to figure out how tobuild
[15:35:30] tbuehlmann: I don't have a project for you, but someone created this: https://dgosxlrnzhofi.cloudfront.net/custom_page_images/64/page_images/Rails_Competencies.png
[15:35:40] tbuehlmann: maybe there's something you want to dive in deeper
[15:36:36] ellisTAA: ischwartz: build the website you want to build and youll encounter tons of challenges
[15:37:22] ischwartz: ellis: I guess I just am having trouble with the conceptualization part
[15:39:30] chills42: has joined #RubyOnRails
[15:39:39] ruurd: has joined #RubyOnRails
[15:39:43] imp4t: has joined #RubyOnRails
[15:42:42] The_Phoenix: has joined #RubyOnRails
[15:44:26] ellisTAA: ischwartz: what do u mean?
[15:44:49] ellisTAA: build a production website and youll find things to work on
[15:45:02] ellisTAA: thats my opinion
[15:46:32] awrfas2: has joined #RubyOnRails
[15:47:30] dcope: is there a way to mark a delayed job as incomplete?
[15:47:53] dcope: ie if the job relies on a service, but the call to the service fails is there a way to keep the job in the queue so it can be retried later?
[15:48:41] renegadeandy: has joined #RubyOnRails
[15:49:56] renegadeandy: has left #RubyOnRails: ()
[15:50:33] renegadeandy: has joined #RubyOnRails
[15:50:49] renegadeandy: can you see this?
[15:50:57] fedexo: has joined #RubyOnRails
[15:51:09] renegadeandy: Can anybody see this!?
[15:51:12] dcope: renegadeandy: yes
[15:51:43] renegadeandy: Can somebody help me identify why this error says I have a routing error : https://gist.github.com/renegadeandy/5474e349019edd740066 I believe I have a route for this?
[15:52:45] GriffinHeart: has joined #RubyOnRails
[15:54:02] tbuehlmann: renegadeandy, nope, you don't have a route for that
[15:54:30] ellisTAA: has joined #RubyOnRails
[15:54:31] renegadeandy: edit_user_registration GET /users/edit(.:format) users/registrations#edit
[15:54:32] renegadeandy: PATCH /users(.:format) users/registrations#update
[15:54:33] renegadeandy: PUT /users(.:format) users/registrations#update
[15:54:39] tbuehlmann: I can't see a /users/:id route for PUT/PATCH
[15:54:48] renegadeandy: tbuehlmann: hmm, well im using devise???.
[15:55:18] renegadeandy: maybe if i used <%= form_for edit_user_registration(current_user) ?
[15:56:09] renegadeandy: as my route is there???but the form for is building the wrong url.
[15:57:09] renegadeandy: edit_user_registration is a devise defined route???and i want to make my edit form manually.
[16:01:42] pawnbox: has joined #RubyOnRails
[16:01:53] chipotle: has joined #RubyOnRails
[16:02:56] ellisTAA: has joined #RubyOnRails
[16:04:50] n1ck7: Hi guys. what's the best way of submitting data from a form which requires the use of 2 different models? for example; I have 3 tables - users, topics, and followed_topics. When a user submits the name of a topic they want to follow, I want to get the topic's id if it exists, otherwise create it. Would it be appropriate to do this inside of the followed_topics controller?
[16:05:24] n1ck7: even though there is a seperate resource for topics
[16:05:40] renegadeandy: n1ck7: if there is an association between the, you can do it in the one form
[16:05:42] renegadeandy: using nested fofrms
[16:06:01] renegadeandy: n1ck7: can you post the models in gist?
[16:06:06] n1ck7: Ah, okay, there is an association between them, How do nested forms work?
[16:06:28] renegadeandy: pop a gist together and ill show you
[16:06:35] lele: has joined #RubyOnRails
[16:06:40] n1ck7: Okay :) thanks
[16:06:55] n1ck7: How do I do that? I've never done it before
[16:07:24] renegadeandy: https://gist.github.com/ paste the model and main controller for the form you want here
[16:07:29] renegadeandy: then share the url in here
[16:07:41] srinidhi: has joined #RubyOnRails
[16:10:24] Us54er: has joined #RubyOnRails
[16:10:52] umgrosscol: has joined #RubyOnRails
[16:10:54] bmalum: has joined #RubyOnRails
[16:11:09] netzfisch: has joined #RubyOnRails
[16:12:27] n1ck7: https://gist.github.com/nickshears/e09c4ff78c5f1b8ba7d7
[16:12:51] n1ck7: The form as well?
[16:13:31] renegadeandy: n1ck7: yep please include it
[16:15:36] n1ck7: Added the form :)
[16:16:06] renegadeandy: you want a form to create a new followedtopic
[16:16:44] prestorium: has joined #RubyOnRails
[16:16:50] n1ck7: Yeah, and the followed_topics table stores a topic_id
[16:16:52] mary5030: has joined #RubyOnRails
[16:17:02] workmad3: has joined #RubyOnRails
[16:17:04] siaW: has joined #RubyOnRails
[16:17:04] jenrzzz: has joined #RubyOnRails
[16:17:37] chipotle: has joined #RubyOnRails
[16:18:46] renegadeandy: why not display a select tag, where the options are the topic names, and the values for those options are their ID. The name of the field would be topic_id, and when it is submitted it will be added to the new followedtopic in the TopicFollowed.new(topic_followed_params) call
[16:19:24] FailBit: https://i.imgur.com/Y1n3bxW.png episode day be like
[16:19:26] renegadeandy: n1ck7: would that give you what you want?
[16:19:43] n1ck7: Ah, because the topics only ever get added when the user submits a new one which they want to add/follow. There will end up being thousands of potential topics
[16:19:47] i: has joined #RubyOnRails
[16:19:55] moeabdol: has joined #RubyOnRails
[16:20:06] renegadeandy: Ok, so this form will also create a new topic?
[16:20:15] n1ck7: Yeah, potentially, if the topic doesn't already exist
[16:21:41] renegadeandy: n1ck7: Ok I see. In that case, I would do it a different way. Have a form for the user which accepts_nested_attributes for FollowedTopic. Then have the FollowedTopic model accepts_nested_attributes_for_Topic,
[16:22:05] renegadeandy: n1ck7: its quite a complicated form you are building, have you triied just making a form to build a new Topic to begin with?
[16:22:07] tsujp: has joined #RubyOnRails
[16:22:21] ellisTAA: has joined #RubyOnRails
[16:22:22] n1ck7: Ahh, that sounds like what I need
[16:22:39] n1ck7: Yeah, there is a simple resource for topics with a form
[16:22:47] renegadeandy: :) give it a go, i???ll be here if you get stuck
[16:23:27] htmldrum: has joined #RubyOnRails
[16:24:07] moeabdol: in my model I'm trying to validate a forign key such as
[16:24:08] renegadeandy: tbuehlmann: I fixed it - used the devise example edit form to get the right url from the devise helper :)
[16:24:34] moeabdol: validates :user_id, uniqunesess: { scope: [:uid, :provider] }
[16:24:43] cleopatra: Dum Dee Dum
[16:25:50] arup_r: moeabdol: Then what happened ?
[16:25:54] moeabdol: however my specs are not failing when i test for validity of a second record with same uid and provider
[16:26:10] renegadeandy: did you try spelling uniqueness right?
[16:26:27] moeabdol: renegadeandy: yes its spelled correctly
[16:26:44] axl_: has joined #RubyOnRails
[16:26:56] nurbson: has joined #RubyOnRails
[16:27:06] moeabdol: i'll make a gist to make it clear
[16:27:22] moeabdol: no thank you :) renegadeandy
[16:29:49] n1ck7: renegadeandy: I'm a little bit stuck with how to create the form. Should I still be using the syntax of "form_for @followed_topic"
[16:31:00] hfp_work: has joined #RubyOnRails
[16:31:12] moeabdol: renegadeandy: here is the gist https://gist.github.com/moeabdol/45418d779ed373ae545a
[16:31:20] mostlybadfly: has joined #RubyOnRails
[16:31:30] hfp: has joined #RubyOnRails
[16:31:43] nurbson: has left #RubyOnRails: ()
[16:31:45] Kara: has joined #RubyOnRails
[16:31:47] nurbson: has joined #RubyOnRails
[16:32:24] renegadeandy: i would do something like this n1ck7 https://gist.github.com/nickshears/e09c4ff78c5f1b8ba7d7 ??? see my comment
[16:32:50] renegadeandy: n1ck7: you will need to add accepts_nested_attributes_for :topics_followed to the User model
[16:33:04] karam: has joined #RubyOnRails
[16:33:55] adavia: has joined #RubyOnRails
[16:35:25] chipotle: has joined #RubyOnRails
[16:35:44] n1ck7: Okay thanks, I'm gonna try it out. The syntax is kind of strange having the form for @user. Would this all be easier to simply validate/insert to the Topic model from the followed_topics#create method? or is nested forms the more appropriate solution?
[16:36:21] adavia: is there a nice tutorial with good practices for building apps with angular?
[16:36:45] renegadeandy: moeabdol: hmm it looks ok, im not sure im sorry, maybe try 2 uniqueness validates statements instead of one containing an array?
[16:37:07] nurbson: can someone help my with a code design decision with rails controllers?
[16:37:09] renegadeandy: n1ck7: yeah that would work as well
[16:37:20] renegadeandy: nurbson: happy to help ask away
[16:37:48] nurbson: I'm developing a rails app with articles for institutions
[16:37:54] nurbson: every article belongs to an institution, every institution has many articles
[16:38:01] nurbson: I have two controllers, InstitutionsController and ArticlesController
[16:38:08] nurbson: my idea is that the InstitutionsController#show passes the selected institution to ArticlesController#index, the problem with that is that I have to pass an institution to every action in my articles controller
[16:38:28] moeabdol: renegadeandy: it still fails!
[16:38:38] moeabdol: do I have to enforce this restriction on the database
[16:38:57] renegadeandy: moeabdol: these validations occur before the record hits the database???..
[16:38:59] nurbson: I see a code smell in my ArticlesController in my tests
[16:39:28] renegadeandy: nurbson: im not completely following you, posting code helps using gist
[16:39:28] moeabdol: renegadeandy: correct!
[16:40:03] fschuindt: In this spec: https://gist.github.com/fschuindt/fc2535a8d6380175ee09 every 'describe' block must the the three contexts: 'when logged as admin', 'when logged as staff' and 'when is not logged in'. There's a good way to make it all over without repeating?
[16:40:21] moeabdol: renegadeandy: is rails ok with validation on forigen keys
[16:41:45] nurbson: @renegadeandy: give me a minute :)
[16:43:00] renegadeandy: moeabdol: yeah, you can use this a presence check for the association name , as per : http://railsguides.net/belongs-to-and-presence-validation-rule1/
[16:44:03] moeabdol: thank you renegadeandy :)
[16:44:12] Oog: has joined #RubyOnRails
[16:44:24] nemo_: has joined #RubyOnRails
[16:44:55] hightower4: Hey, in a rails app, if I want to store basic info somewhere, like the site name, phone number, email etc., what's the convenient way to store and display that info?
[16:45:47] renegadeandy: hightower4: Hmm, good question! You could make a model called Site with those attributes? Or you could store them in the configuration and pull them from there in the views?
[16:46:23] renegadeandy: hightower4: i would see what everyone else suggests though.....
[16:46:38] renegadeandy: hightower4: If you don???t need to store em, then just hardcode them in the view!?
[16:47:05] nurbson: renegadeandy: here is my InstitutionsController: https://gist.github.com/anonymous/317888ff506f43e81634
[16:47:38] renegadeandy: ok nurbson so remind me the question?
[16:47:51] renegadeandy: nurbson: the show looks odd
[16:48:04] renegadeandy: do you need a show action for institutions? You could always just remove it?
[16:48:45] nurbson: the show action should redirect to the index action of ArticlesController to edit all articles for an institution
[16:48:47] renegadeandy: for the institution show, simply show all the articles, by URL / name, and let the user click on the one they want?
[16:49:00] renegadeandy: nurbson: I don???t thikn thats what you really want
[16:49:41] nurbson: every institution has many articles
[16:49:47] renegadeandy: nurbson: yes....
[16:50:02] renegadeandy: so if you want to see an institution, you probably want to see a list of all it???s articles,
[16:50:16] renegadeandy: which is not what you are doing currently
[16:50:42] nurbson: but I need an ArticlesController for adding/editing articles
[16:51:09] renegadeandy: nurbson: yes???.
[16:51:24] nurbson: right now I pass the institution to my ArticlesController to show all articles belonging to an institution
[16:51:29] nurbson: is that the way to go?
[16:51:45] nurbson: thats my point :)
[16:51:49] renegadeandy: you are doing this not quite right, can you include the 2 models, and the 2 views for show please?
[16:52:18] nurbson: my views are not ready, I post the models
[16:52:41] linocisco: has joined #RubyOnRails
[16:52:49] renegadeandy: nurbson: ok.....
[16:54:42] nurbson: https://gist.github.com/anonymous/84861848089a097aacf4
[16:55:01] renegadeandy: nurbson: add your institurtion controller to that gist please
[16:55:53] linocisco: when I first created using "rails new blog" and rails server and run localhost:3000
[16:55:55] linocisco: it was fine
[16:56:56] linocisco: now today I navigate to created blog folder and run rails server. there is error saying Could not find i18n-0.7.0 in any of the sources Run `bundle install` to install missing gems.
[16:57:26] renegadeandy: linocisco: try running ???bundle install'
[16:57:26] nurbson: renegadeandy: how do I add files to gist? clone commit and push?
[16:57:38] renegadeandy: nurbson: ???.edit in top right then add as you did before
[16:57:47] linocisco: renegadeandy, do I always need to have internet which is difficult and expensive for me?
[16:58:03] renegadeandy: linocisco: for bundle install yes, but once the bundle is installed...no
[16:58:37] linocisco: renegadeandy, the other day was fine, now it is not ok. again why is that? I could run that day. now not
[16:58:53] renegadeandy: linocisco: is it exactly the same project...
[16:58:57] renegadeandy: or is this a new project
[16:59:04] linocisco: renegadeandy, same project
[16:59:19] renegadeandy: linocisco: are you running ???rails server??? in the correct folder?
[17:00:02] renegadeandy: moeabdol: did you get it solved?
[17:00:12] renegadeandy: moeabdol: im confused by the fact the uniqueness failed...
[17:00:20] moeabdol: nope renegadeandy still working on it
[17:00:37] moeabdol: yes I'm guessing i did something wrong somewhere
[17:00:45] nurbson: adding with anonymous account doesn't work
[17:00:46] nurbson: https://gist.github.com/nurbs999/3868e1d236776c8994ce
[17:00:59] linocisco: renegadeandy, yes. here is what shown with "bundle install" again. http://pastebin.com/JvEKULsH
[17:03:06] linocisco: renegadeandy, http://pastie.org/private/1b1blwz0gfj6nvkcxkzlq
[17:03:11] renegadeandy: nurbson: check my comment please, and try it out
[17:03:53] renegadeandy: linocisco: i think thats still running???.its not finished yet
[17:04:29] linocisco: renegadeandy, I can't see the size or progress of download.
[17:05:30] renegadeandy: linocisco: just wait!
[17:05:39] renegadeandy: linocisco: leave it to run
[17:05:44] bmalum: has joined #RubyOnRails
[17:06:07] linocisco: renegadeandy, thanks.
[17:06:09] nurbson: renegadeandy: thanks a lot, your code looks familiar
[17:06:24] renegadeandy: nurbson: how do you mean!?
[17:06:55] nurbson: I wrote something like that before, but with TDD I just forgot about that
[17:07:41] renegadeandy: nurbson: ah i see
[17:07:55] renegadeandy: nurbson: let me know if it works
[17:08:18] linocisco: hi all folks, what is the best use of Ruby on Rails? It is known that twitter and facebook use Ruby on Rails before they got maximum users that Rails can't handle. Is that true? does Rails have many constraints? why should we use that?
[17:08:42] capin: afternoon
[17:08:44] nurbson: TDD forces me to rething every step in developing a rails app, so there is little space left in my head for other stuff ;)
[17:08:48] jun: has joined #RubyOnRails
[17:08:50] nurbson: I will, thanks again
[17:09:46] renegadeandy: linocisco: rails is great for rapidly building a web application! It uses convention over configuration to save you time and complexity
[17:09:52] arup_r: Why the `asset_path("wysihtml5", type: :stylesheet)` not creating proper stylesheet url ?
[17:09:58] arup_r: https://gist.github.com/aruprakshit/68073f6c256b42918c26
[17:10:18] renegadeandy: nurbson: thats why i don???t do TDD ;)
[17:10:23] arup_r: nurbson: you made me ROFL
[17:11:07] arup_r: How would you create a proper url inside the Rails view ?
[17:11:53] renegadeandy: arup_r: using the URLHelper?
[17:11:53] nurbson: I just started TDD to check if it helps me write better organized code
[17:12:00] linocisco: renegadeandy, it is also read already on its philosophy. so what is the limitation of using rails in reality? all websites will look the same in appearance by default?
[17:12:05] adac: has joined #RubyOnRails
[17:12:20] renegadeandy: linocisco: I don???t know what the limitation is, ive not hit it!
[17:12:32] arup_r: renegadeandy: didn't get you. I already used asset_path
[17:12:48] arup_r: but Rails view made a complete non sense path for that
[17:12:54] arup_r: stylesheet
[17:12:56] EminenceHC: has joined #RubyOnRails
[17:12:58] renegadeandy: linocisco: ive used many things for web development, JEE, PHP, Rails etc and i vastly prefer rails for any kind of project
[17:13:17] arup_r: wysihtml5 is inside app/assets/stylesheets dir
[17:13:28] renegadeandy: arup_r: what are you trying to do, get the actual absolute URL to that file?
[17:13:42] arup_r: yes, tried asset_url also
[17:13:54] arup_r: it seems I need to keep the CSS inside the public dir
[17:13:58] arup_r: not assets/
[17:14:07] renegadeandy: arup_r: try asset_url
[17:14:12] renegadeandy: http://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-asset_url
[17:14:27] arup_r: both are creating wrong url
[17:14:27] smathy: has joined #RubyOnRails
[17:14:47] linocisco: renegadeandy, thanks for your opinion
[17:15:33] raidiant: has joined #RubyOnRails
[17:15:38] renegadeandy: arup_r: sorry i don???t know.
[17:15:49] arup_r: hum .. not me too
[17:17:24] DoubleMalt: has joined #RubyOnRails
[17:18:09] jenrzzz: has joined #RubyOnRails
[17:18:55] EminenceHC: has joined #RubyOnRails
[17:19:15] capin: does anyone know what the proper "symbol" for a model that looks like this, https://gist.github.com/ipatch/2889e206d8cee78505ea im using refile to try and upload CSV files
[17:19:31] FailBit: with the threat of chrome 46 looming, I finally installed camo on my site
[17:19:42] FailBit: never looking back now
[17:20:12] FailBit: https://camo.derpicdn.net/
[17:20:33] xtagon: has joined #RubyOnRails
[17:21:59] towski_: has joined #RubyOnRails
[17:22:07] smathy: has joined #RubyOnRails
[17:22:45] cleopatra: has joined #RubyOnRails
[17:22:47] renegadeandy: FailBit: what is that?
[17:23:12] renegadeandy: FailBit: still don???t know the value of that???please explain
[17:23:15] FailBit: instead of letting external images be fetched by the users' browsers, we route them through camo
[17:23:21] FailBit: this serves 2 purposes
[17:23:29] FailBit: 1. it keeps the connection secure at all times
[17:23:42] FailBit: 2. it stops websites from recording pageviews using user-submitted images
[17:23:54] renegadeandy: FailBit: interesting.
[17:23:59] FailBit: (and more importantly, IP addresses)
[17:24:20] FailBit: https://github.com/atmos/camo
[17:24:22] FailBit: smoke node everyday
[17:25:46] siddart: has joined #RubyOnRails
[17:25:49] jun: has joined #RubyOnRails
[17:27:04] adavia: is there a nice tutorial with good practices for building apps with angular?
[17:27:56] youngbaks: has joined #RubyOnRails
[17:28:09] snarkfest: has joined #RubyOnRails
[17:28:34] arup_r: capin: check the output of this method : http://api.rubyonrails.org/classes/ActiveModel/Naming.html#method-i-model_name
[17:29:28] cleopatra: adavia, there are some ebook
[17:31:48] capin: arup_r: i changed the symbol to ":csv" FWIW
[17:32:11] arup_r: what is FWIW ?
[17:32:12] cleopatra: but basically when using a javascript MVC framework, the main idea is to separate the view of all in rails
[17:33:02] FailBit: for what it's worth, arup_r
[17:33:27] Skelz0r: has joined #RubyOnRails
[17:34:08] FailBit: when using a javascript MVC framework, that's when you know it's time to lay off the drugs a bit
[17:34:25] netzfisch: has joined #RubyOnRails
[17:36:01] cleopatra: adavia, there are some example app https://bendyworks.com/angularjs-rails-donuts/
[17:36:17] applegrain: has joined #RubyOnRails
[17:37:43] cleopatra: adavia, http://bw-donuts.herokuapp.com/
[17:38:25] adavia: cleopatra: i have seen lot of complains about angular playing nice with rails. Seems like ppl tend to choose ember or at medium level backbone
[17:40:22] cleopatra: personally, I was using backbone but i switch to Reac Js -flux
[17:41:19] gremax: has joined #RubyOnRails
[17:43:57] kies^: has joined #RubyOnRails
[17:45:15] Uo9er_: has joined #RubyOnRails
[17:45:24] siddart: has joined #RubyOnRails
[17:47:03] moeabdol: renegadeandy: I figured it out!
[17:47:15] moeabdol: It was my logic that is wrong
[17:47:23] renegadeandy: moeabdol: where in the rspec?
[17:47:45] moeabdol: i was checking that every user_id has a unique provider and uid
[17:48:04] moeabdol: in that case it's ok if another user has the same unique set of provider and uid
[17:48:18] moeabdol: I should have check uniqueness along every record on that table instead
[17:48:21] moeabdol: something like:
[17:48:30] t_mmyv: has joined #RubyOnRails
[17:48:44] moeabdol: validates :id, uniqueness: scope........
[17:48:58] moeabdol: validates :user_id, uniqueness:.....
[17:49:04] moeabdol: does it make sense
[17:49:33] renegadeandy: moeabdol: oh of course!
[17:49:36] renegadeandy: what a silly billy
[17:49:46] FailBit: {scope: [:provider_id]}
[17:50:20] moeabdol: renegadeandy: thanks :)
[17:52:19] gaboesquivel: has joined #RubyOnRails
[17:58:02] sankaber: has joined #RubyOnRails
[17:58:26] imp4t: has joined #RubyOnRails
[17:59:10] renegadeandy: moeabdol: no problem, sorry i didnt spot it before. You could try the gem ???annotate??? it helps you to spot that kinda thing, because it puts the attributes of a model in comments at the top of the model file! I love it!
[17:59:22] podman: has joined #RubyOnRails
[18:03:24] FailBit: aroudn_filter is stupid...
[18:03:28] FailBit: *around_filter
[18:03:45] FailBit: it doesn't allow you to consolidate the rendering of a group of actions into one method easily
[18:04:32] jun: has joined #RubyOnRails
[18:05:10] workmad3: has joined #RubyOnRails
[18:07:00] pontiki: has joined #RubyOnRails
[18:07:40] imp4t: has joined #RubyOnRails
[18:09:09] Pupeno: has joined #RubyOnRails
[18:10:10] adac: has joined #RubyOnRails
[18:14:42] netzfisch: has joined #RubyOnRails
[18:16:07] centrx: has joined #RubyOnRails
[18:16:57] imp4t: has joined #RubyOnRails
[18:17:57] siddart: has joined #RubyOnRails
[18:19:33] Skelz0r: has joined #RubyOnRails
[18:19:36] jun__: has joined #RubyOnRails
[18:21:23] rickmasta: has joined #RubyOnRails
[18:22:15] ellisTAA: has joined #RubyOnRails
[18:22:23] m0nge: has joined #RubyOnRails
[18:23:03] ellisTAA: i have this problem where when i try to test my site locally i have to change all my links to point to localhost instead of my production url. how do people usually handle this? i feel like i need to set up some sort of development environment
[18:24:11] htmldrum: has joined #RubyOnRails
[18:26:40] tbuehlmann: EllisTAA, how do you setup links in your templates exactly?
[18:27:27] ellisTAA: tbuehlmann: it???s embarrasing, i just hardcode them
[18:27:46] tbuehlmann: that's it, then. if you use the link_to helper, all links will be relative and you don't have to care anymore
[18:27:56] FailBit: use relative links always
[18:28:00] ellisTAA: tbuehlmann: oooo ok ill check it, thanks
[18:29:18] rodfersou: has joined #RubyOnRails
[18:31:29] Kara: has joined #RubyOnRails
[18:31:50] Skelz0r: has joined #RubyOnRails
[18:32:07] yfeldblum: has joined #RubyOnRails
[18:32:35] karam: has joined #RubyOnRails
[18:32:39] capin: is there a way i can modify my controller to only allow CSV file uploads? right now any filetype can be uploaded (-.-) https://gist.github.com/ipatch/e54b919b548eb94a48c0
[18:33:48] nemo__: has joined #RubyOnRails
[18:33:50] tbuehlmann: capin, you mean, don't accept the request at all if it's not a csv file?
[18:34:13] kiez0rd: has joined #RubyOnRails
[18:34:19] capin: tbuehlmann: yeah something like that
[18:34:34] tbuehlmann: nope, not possible (or at least not that easy)
[18:34:41] imp4t: has joined #RubyOnRails
[18:34:48] tbuehlmann: the request/file goes through the middleware stack first
[18:35:47] raazdaan: has joined #RubyOnRails
[18:35:52] tbuehlmann: only allowing a valid file input in your model is a different story, though
[18:36:13] Spami: has joined #RubyOnRails
[18:36:20] capin: well that sounds like a solution ;)
[18:36:33] capin: how could i go about doing that?
[18:36:55] renegadeandy: capin: validation
[18:37:06] tbuehlmann: right, have a validation for that
[18:37:17] capin: renegadeandy: tbuehlmann thanks
[18:38:09] kies^: has joined #RubyOnRails
[18:38:10] siddart: has joined #RubyOnRails
[18:39:03] raazdaan: has joined #RubyOnRails
[18:41:30] jun: has joined #RubyOnRails
[18:44:13] imp4t: has joined #RubyOnRails
[18:48:04] capin: so i updated my model to look like this, https://gist.github.com/ipatch/e54b919b548eb94a48c0 but it is still allowing various filetypes :l
[18:48:13] Skelz0r: has joined #RubyOnRails
[18:52:08] ruurd: has joined #RubyOnRails
[18:52:34] pwnd_nsfw: paperclip capin ?
[18:52:44] sankaber: has joined #RubyOnRails
[18:52:47] n1ck7: has joined #RubyOnRails
[18:54:15] Kara: has joined #RubyOnRails
[18:56:57] futilegames: has joined #RubyOnRails
[18:59:39] tbuehlmann: I'd validate the file input. like calling `CSV.parse(input)` and rescuing errors. if an error where raised, add an actual error to the record
[19:00:12] mustmodify: has joined #RubyOnRails
[19:00:48] corehook: has joined #RubyOnRails
[19:00:48] DoubleMalt: has joined #RubyOnRails
[19:00:59] mustmodify: What's the term for the period of time between which a security vulnerability is discovered and known to the core team and the time they announce it publicly, ie the time during which major vendors can take corrective action?
[19:02:10] imp4t: has joined #RubyOnRails
[19:03:16] honzahovorka: has joined #RubyOnRails
[19:04:00] VeryBewitching: has joined #RubyOnRails
[19:06:37] centrx: mustmodify, 'embargo'?
[19:07:09] futilegames: has joined #RubyOnRails
[19:09:36] bmalum: has joined #RubyOnRails
[19:11:55] applegrain: has joined #RubyOnRails
[19:13:49] jun: has joined #RubyOnRails
[19:14:10] nogic: has joined #RubyOnRails
[19:17:04] hephaestus_rg: has joined #RubyOnRails
[19:18:51] Cache_Money: has joined #RubyOnRails
[19:19:43] jenrzzz: has joined #RubyOnRails
[19:20:54] jun: has joined #RubyOnRails
[19:20:59] njero: has joined #RubyOnRails
[19:22:47] pontiki: has joined #RubyOnRails
[19:26:34] rakm: has joined #RubyOnRails
[19:27:07] mustmodify: centrx: perfect
[19:27:20] mustmodify: centrx is gone. Oh well.
[19:29:06] Epic-Games: has joined #RubyOnRails
[19:29:08] ruurd: has joined #RubyOnRails
[19:29:10] Epic-Games: has left #RubyOnRails: ()
[19:29:29] imp4t: has joined #RubyOnRails
[19:30:35] oflannabhra: has joined #RubyOnRails
[19:31:30] axl_: has joined #RubyOnRails
[19:35:06] doublemalt_: has joined #RubyOnRails
[19:35:36] fedexo: has joined #RubyOnRails
[19:38:22] baweaver: has joined #RubyOnRails
[19:38:23] andrew9184: has joined #RubyOnRails
[19:38:23] jun: has joined #RubyOnRails
[19:44:47] Motoservo: has joined #RubyOnRails
[19:45:25] U7se6: has joined #RubyOnRails
[19:46:00] fedexo: has joined #RubyOnRails
[19:46:54] camilasan: has joined #RubyOnRails
[19:47:57] imp4t: has joined #RubyOnRails
[19:48:55] kalusn: has joined #RubyOnRails
[19:50:56] SamGerber: has joined #RubyOnRails
[19:51:17] applegrain: has joined #RubyOnRails
[19:51:31] atomical: has joined #RubyOnRails
[19:52:19] kies^: has joined #RubyOnRails
[19:52:56] Spami: has joined #RubyOnRails
[19:53:06] gerep: has joined #RubyOnRails
[19:53:17] workmad3: has joined #RubyOnRails
[19:53:44] gerep: Hello good people. I'm running a mailer test with a fixture but it happens that in this fixture I need to check a token that is generated dynamically. This is what I have: https://gist.github.com/gerep/d980b162fcd67eccfb5f
[19:54:04] gerep: How can I make the @user.token work? Should I use a fake value?
[19:54:33] gerep: In my test I'd do @user.toke = "123456abcdef" and in my test I'll add that value?
[19:54:36] futilegames: has joined #RubyOnRails
[19:55:47] mustmodify: gerep: So you're saying you have a user fixture, but you have a randomly generated user token... if you set the token in the fixture, will it be overwritten?
[19:55:58] ereslibre: has joined #RubyOnRails
[19:55:58] ereslibre: has joined #RubyOnRails
[19:56:33] gerep: mustmodify: I have a email fixture and the user token sent in this email is generated after the user creation. The email fixture is a txt file
[19:57:04] gerep: mustmodify: I just tested and I can do this: https://gist.github.com/gerep/d980b162fcd67eccfb5f
[19:57:07] mustmodify: So you have an emails table?
[19:57:17] qejk: has joined #RubyOnRails
[19:57:28] gerep: mustmodify: no, I don't, the token is generated with: before_create { self.token = SecureRandom.hex(10) }
[19:57:34] mustmodify: Great, glad you found something that works.
[19:57:40] gerep: mustmodify: =)
[19:57:51] gerep: mustmodify: but I found another "problem" haha
[19:58:00] gerep: The test result:
[19:58:02] gerep: -http://localhost:3000/activate/123456abcdef\"
[19:58:02] gerep: +http://localhost:3000/activate/123456abcdef
[19:58:12] gerep: It is expecting a link with an ending \
[19:58:13] mustmodify: if you want to be able to use fixtures to specify the token you could always change that to self.token ||= SecureRandom.hex(10)
[19:58:13] rhizome: why do you need to check that the token is a specific value?
[19:58:57] gerep: rhizome: I don't but it would be nice to test it with the real value
[19:59:06] mustmodify: rhinon: gerep is asserting that the email and a text file are the same.
[19:59:12] gerep: Anyway, it works if I set the token value, no problem at all :D
[19:59:16] mustmodify: has left #RubyOnRails: ()
[19:59:36] rhizome: isn't the "real value" set as part of the User.create?
[20:00:43] gerep: rhizome: but how will I send this "real value" to my fixture? It is not dynamic
[20:00:46] gerep: It is a txt file
[20:01:06] rhizome: you're in the test, why are you trying to send things to your fixture?
[20:01:29] rhizome: aren't you actually re-setting the token?
[20:02:22] gerep: rhizome: Yes, that's one revision in the gist, check this one: https://gist.github.com/gerep/d980b162fcd67eccfb5f/dc28d2b61adb861c912fb67107d8cbb55387ab4f
[20:02:44] gerep: rhizome: in this one I wasn't re-setting the token
[20:03:00] gerep: rhizome: anyway, I'll just re-set the token and check for its value in the email fixture ;)
[20:03:40] rhizome: i guess i don't understand
[20:05:03] gerep: rhizome: No problem, I'll use the pre-defined token value and check for it in my email fixture
[20:05:08] gerep: thanks for your patience :D
[20:06:25] imp4t: has joined #RubyOnRails
[20:07:09] m0nge: has joined #RubyOnRails
[20:07:27] njero: has joined #RubyOnRails
[20:08:55] renegadeandy: has joined #RubyOnRails
[20:09:15] ruurd: has joined #RubyOnRails
[20:10:45] creature: has joined #RubyOnRails
[20:10:45] creature: has joined #RubyOnRails
[20:11:26] njero: has joined #RubyOnRails
[20:13:09] chipotle: has joined #RubyOnRails
[20:14:43] pawnbox: has joined #RubyOnRails
[20:17:17] boombadaroomba: has joined #RubyOnRails
[20:17:44] capin: any help would be appreciated, http://stackoverflow.com/questions/33190587
[20:17:50] sankaber: has joined #RubyOnRails
[20:18:45] kadoppe: has joined #RubyOnRails
[20:19:07] mkp: has joined #RubyOnRails
[20:20:02] Pupeno: has joined #RubyOnRails
[20:20:13] sankaber: has joined #RubyOnRails
[20:22:36] Kara: has joined #RubyOnRails
[20:24:50] imp4t: has joined #RubyOnRails
[20:24:58] htmldrum: has joined #RubyOnRails
[20:25:52] fedexo: has joined #RubyOnRails
[20:26:54] njero: has joined #RubyOnRails
[20:27:13] rhizome: you should have used more words to describe your problem
[20:31:02] chipotle_: has joined #RubyOnRails
[20:37:28] Coldblackice: has joined #RubyOnRails
[20:39:30] atomical: has joined #RubyOnRails
[20:39:31] EminenceHC: has joined #RubyOnRails
[20:42:48] yashinbasement: has joined #RubyOnRails
[20:44:11] atomical_: has joined #RubyOnRails
[20:45:33] chipotle: has joined #RubyOnRails
[20:46:38] corehook: has joined #RubyOnRails
[20:47:00] jun: has joined #RubyOnRails
[20:48:39] mkp: has joined #RubyOnRails
[20:48:52] mkp: anyone here know how i can nest a devise registration form within a parent form? everything i've been able to find on google only shows how it can be done in reverse (adding a child form to a registration form).
[20:48:59] mkp: my app is using devise to register users. these users belong to an overall account, and this account needs to exist before the user is created. the flow for new users will be one of two use cases: both the account and user are new and the user will need to sign up via an account create form with a nested devise user form or 2: the account already e
[20:48:59] mkp: xists and the new user has been invited to the account by an existing user. (i'm not worried about #2, but I haven't found any documentation on nesting a devise form)
[20:49:17] oflannabhra: has joined #RubyOnRails
[20:49:21] chipotle_: has joined #RubyOnRails
[20:49:31] rhizome: you nest it like normal
[20:50:35] shahwaq: has joined #RubyOnRails
[20:51:35] imp4t: has joined #RubyOnRails
[20:53:10] dikaio: has joined #RubyOnRails
[20:53:39] mkp: rhizome: wouldn't nesting it as normal use the default user forms/flow and not the devise forms/flow to create a user?
[20:57:16] mary5030: has joined #RubyOnRails
[20:59:27] trosborn: has joined #RubyOnRails
[21:00:09] fedexo: has joined #RubyOnRails
[21:01:09] rhizome: you're just creating a user through a nested form, what flow is missing?
[21:05:14] jsrn_: has joined #RubyOnRails
[21:07:48] kalusn: has joined #RubyOnRails
[21:10:17] imp4t: has joined #RubyOnRails
[21:13:52] smathy: has joined #RubyOnRails
[21:15:04] jun: has joined #RubyOnRails
[21:19:51] imp4t: has joined #RubyOnRails
[21:21:13] trosborn: has joined #RubyOnRails
[21:21:38] bruno-: has joined #RubyOnRails
[21:22:29] jun: has joined #RubyOnRails
[21:23:01] atomical: has joined #RubyOnRails
[21:23:39] blackmesa: has joined #RubyOnRails
[21:24:48] sankaber: has joined #RubyOnRails
[21:26:35] marr: has joined #RubyOnRails
[21:27:03] framling: has joined #RubyOnRails
[21:33:17] blackmesa: has joined #RubyOnRails
[21:34:37] atomical_: has joined #RubyOnRails
[21:34:59] yfeldblum: has joined #RubyOnRails
[21:35:41] honzahovorka: has joined #RubyOnRails
[21:38:14] greenride: has joined #RubyOnRails
[21:39:11] greenride: I'm trying to understand csrf tokens. Why can't a Rogue site do both the get request to get the csrf token and the post request?
[21:39:52] dideler: has joined #RubyOnRails
[21:41:24] workmad3: has joined #RubyOnRails
[21:43:25] siddart: has joined #RubyOnRails
[21:43:41] pontiki: has joined #RubyOnRails
[21:43:56] hightower4: Hey, what's a good/stable gem to use for breadcrumbs in a rails app?
[21:45:32] jun: has joined #RubyOnRails
[21:45:34] Uo9er_: has joined #RubyOnRails
[21:47:20] chipotle: has joined #RubyOnRails
[21:48:45] spellbook: has joined #RubyOnRails
[21:48:48] meoblast001: has joined #RubyOnRails
[21:50:01] EminenceHC: has joined #RubyOnRails
[21:51:21] jenrzzz: has joined #RubyOnRails
[21:51:23] mkp: has joined #RubyOnRails
[21:52:39] nogic: has joined #RubyOnRails
[21:53:01] spellbook: Hi. I have a question about the naming restrictions of columns. I checked the rails guides, but it doesn't seem to say anything about bad column names. Is there such a thing? And if not, is it in bad taste to name a column 'integer' or 'text' for example?
[21:53:12] chipotle: has joined #RubyOnRails
[21:55:01] shtirlic: has joined #RubyOnRails
[21:55:12] siddart: has joined #RubyOnRails
[21:55:55] imp4t: has joined #RubyOnRails
[21:58:16] elaptics: spellbook: a useful resource http://radar.github.io/rails-reserved-words/
[22:00:57] chipotle: has joined #RubyOnRails
[22:01:16] michael_mbp: has joined #RubyOnRails
[22:02:39] spellbook: elaptics: thanks
[22:06:38] rhizome: also reserved words for your database
[22:06:58] proboszcz: has joined #RubyOnRails
[22:07:22] jun: has joined #RubyOnRails
[22:07:25] glundgren: has joined #RubyOnRails
[22:08:41] mkp: has joined #RubyOnRails
[22:09:47] s2013: has joined #RubyOnRails
[22:10:47] chipotle: has joined #RubyOnRails
[22:12:33] greenride: How do people typically generate CSRF tokens for json apis?
[22:13:03] jgt: has joined #RubyOnRails
[22:14:14] FailBit: they don't
[22:14:28] trosborn: has joined #RubyOnRails
[22:14:38] imp4t: has joined #RubyOnRails
[22:15:01] greenride: FailBit: CSRF protection should also be required for json apis supporting web frontends. Right?
[22:16:46] riotjones: has joined #RubyOnRails
[22:19:17] shinnya: has joined #RubyOnRails
[22:19:42] greenride: If no one is doing csrf protection for their json posts (and puts and deletes), this means every Rails json api is subject to csrf attacks. Right?
[22:20:27] Pupeno: has joined #RubyOnRails
[22:20:28] tbuehlmann: that's only for cookie based sessions
[22:20:49] hmsimha: has joined #RubyOnRails
[22:21:36] greenride: Rogue site can log a browser in as some other user
[22:21:38] jun: has joined #RubyOnRails
[22:23:04] Or1on: has joined #RubyOnRails
[22:23:07] jenrzzz: has joined #RubyOnRails
[22:23:12] bato: has joined #RubyOnRails
[22:25:13] IFrank00: has joined #RubyOnRails
[22:25:14] quazimodo: has joined #RubyOnRails
[22:28:45] closer: has joined #RubyOnRails
[22:31:48] seuros: has joined #RubyOnRails
[22:32:58] imp4t: has joined #RubyOnRails
[22:37:56] jun: has joined #RubyOnRails
[22:39:16] Anubix: has joined #RubyOnRails
[22:40:03] Anubix: Is there any option to deploy rails app except capistrano or mina? I am trying to setup it last 3 days and unsuccesfully.
[22:40:55] FailBit: but you're probably not going to like any of the alternatives
[22:42:24] Anubix: Hm i am getting this error with Mina - http://pastie.org/private/vitbcfoq3cuilqbejmhktq
[22:42:47] FailBit: you need to set up a deploy key for the repo
[22:42:52] Anubix: I have using SSH with DigitalOcena server and Git without problems
[22:43:05] Anubix: it is already done
[22:43:09] FailBit: the deploy key cannot be password protected
[22:43:35] FailBit: git must be able to find it
[22:43:37] yashinbasement: has joined #RubyOnRails
[22:43:56] Anubix: When I push git on bitbucket, it didnt need password anymore
[22:44:17] Anubix: same i connect ssh user@ip and it doesnt need password as well
[22:44:28] FailBit: that doesn't mean it's not password protected
[22:44:31] wethu: has joined #RubyOnRails
[22:44:37] FailBit: that just means that your ssh-agent is running on your computer
[22:44:46] FailBit: you need to decrypt the key on the server
[22:45:08] Anubix: how i do it?
[22:46:10] Anubix: On bitbucket in settings there is just ssh key which is already added
[22:46:58] FailBit: on the production server, run:
[22:46:59] FailBit: openssl rsa -in ~/.ssh/id_rsa -out ~/.ssh/id_rsa
[22:47:19] FailBit: this will decrypt your deploy key and allow git to access it
[22:47:45] Anubix: i am using ubuntu
[22:47:54] FailBit: ACTION uses an ed25519 key, but same idea
[22:48:03] FailBit: Anubix: doesn't matter, still works
[22:48:27] Anubix: unable to load Private Key
[22:48:52] Anubix: 139938490914464:error:02001002:system library:fopen:No such file or directory:bss_file
[22:49:25] s2013: has joined #RubyOnRails
[22:49:26] Anubix: true is i didnt setup any ssh on production
[22:49:41] FailBit: you have to, to be able to deploy
[22:49:59] Anubix: i was doing this guide https://gorails.com/deploy/ubuntu/14.04
[22:50:34] Anubix: there is nothing about ssh on production
[22:51:14] FailBit: production has to be able to clone the repository
[22:51:25] FailBit: likely it assumes that you are using a public git repository that does not require authentication to pull from
[22:51:37] FailBit: since you are using a private bitbucket repository, you must provide authentication
[22:51:39] htmldrum: has joined #RubyOnRails
[22:51:59] s2013: has joined #RubyOnRails
[22:52:08] Anubix: ah ok but where i find some manual?
[22:52:58] FailBit: I can just tell you, if you want
[22:53:25] Anubix: ok this could be great, i lost 3 days on this and i am really k.o. :)
[22:53:41] taxen: has joined #RubyOnRails
[22:53:48] Anubix: i don't understand it so i just use documenation
[22:54:29] FailBit: run ssh-keygen, and pick ~/.ssh/id_rsa_deploy for the path when it asks
[22:54:47] FailBit: (do this on the server)
[22:55:02] FailBit: don't enter a passcode
[22:56:19] Anubix: pick mean what
[22:56:27] Anubix: i should add full path or
[22:56:43] Anubix: Enter file in which to save the key (/home/user/.ssh/id_rsa):
[22:56:59] FailBit: you might as well just hit enter, I suppose
[22:57:13] Anubix: ok no paraphrase
[22:58:06] Anubix: generated fingerprint
[22:58:06] FailBit: now run 'cat ~/.ssh/id_rsa.pub' on the server and copy everything that it outputs
[22:58:39] Anubix: done and now add it to bitbucket?
[22:58:42] FailBit: on bitbucket
[22:58:45] FailBit: go to your repository
[22:58:49] FailBit: go to settings
[22:58:58] FailBit: click deployment keys
[22:59:04] FailBit: hit add key
[22:59:20] FailBit: paste the contents, and select add key
[22:59:26] FailBit: now you should be able to deploy
[22:59:29] Anubix: well i did this same on development local
[22:59:37] imp4t: has joined #RubyOnRails
[22:59:39] Anubix: didnt know i have to do same for server too
[22:59:46] trosborn: has joined #RubyOnRails
[22:59:55] Anubix: ok so lets test it
[22:59:57] FailBit: development doesn't need a deploy key, it needs a regular key
[23:00:01] FailBit: but that's irrelevant
[23:00:40] Anubix: deploy failed :D
[23:00:52] FailBit: same error?
[23:00:57] Anubix: rake aborted!
[23:00:57] Anubix: ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
[23:01:03] FailBit: install nodejs on the server
[23:01:16] Anubix: thats missing on that guide gorails :/
[23:02:01] Anubix: this is fine? sudo add-apt-repository ppa:chris-lea/node.js
[23:02:01] Anubix: sudo apt-get update
[23:02:01] Anubix: sudo apt-get install nodejs
[23:02:21] FailBit: ubuntu ships with node
[23:02:24] FailBit: sudo apt-get install nodejs
[23:02:33] rakm: has joined #RubyOnRails
[23:04:10] Anubix: rake aborted!
[23:04:10] Anubix: ActiveRecord::AdapterNotSpecified: 'production' database is not configured. Available: []
[23:04:23] FailBit: you don't have production configured in your database.yml
[23:04:49] Anubix: production:
[23:04:49] Anubix: adapter: postgresql
[23:04:49] Anubix: encoding: unicode
[23:04:49] Anubix: database: myapp_production
[23:04:49] Anubix: username: anubix
[23:04:50] Anubix: password: xxxxxxx
[23:05:15] cornerma1: has joined #RubyOnRails
[23:06:03] trosborn: has joined #RubyOnRails
[23:06:25] Anubix: i didnt create database on production server
[23:06:54] FailBit: sudo -u postgres -s
[23:07:13] FailBit: create role anubix with createdb login password 'xxxxxxx';
[23:07:41] Anubix: user is already created
[23:08:00] Anubix: i mean rake db:setup doesnt work on production because there is no rails installed, only ruby
[23:08:56] FailBit: if you have bundler installed, then it doesn't matter
[23:09:24] Anubix: user anubix is already created with pass
[23:11:31] renegadeandy: has left #RubyOnRails: ()
[23:11:49] renegadeandy: has joined #RubyOnRails
[23:11:55] FailBit: Anubix: can you pastie your gemfile?
[23:12:44] Anubix: http://pastie.org/private/s6n0pgxejkmsj5lhlmq
[23:13:39] FailBit: how about your mina config?
[23:14:32] Anubix: When i deploy my app first time on production, then is rake db:setup automatic or ihave to write in ?
[23:15:12] FailBit: I've not deployed using mina before and I've never deployed anything from scratch, so I'm not positive but I think you might have to
[23:15:51] Anubix: i just found - The file config/database.yml needs to be updated for the production database server username, password, and host.
[23:16:08] Anubix: as i copied, there is no host row in production
[23:16:14] craysiii: has joined #RubyOnRails
[23:16:51] FailBit: that'd do it
[23:16:53] FailBit: set it to localhost
[23:17:47] FailBit: https://gist.github.com/liamwhite/718ee38838264cf7328f this is my own, btw
[23:18:31] Anubix: maybe this is the problem i do it
[23:18:38] imp4t: has joined #RubyOnRails
[23:18:51] GriffinHeart: has joined #RubyOnRails
[23:19:07] stardiviner: has joined #RubyOnRails
[23:19:39] GriffinHeart: has joined #RubyOnRails
[23:20:19] Anubix: rake aborted!
[23:20:20] Anubix: ActiveRecord::AdapterNotSpecified: 'production' database is not configured. Available: []
[23:20:22] Anubix: same uhhh
[23:20:51] Anubix: never ending story
[23:22:05] Anubix: can i check somehow on server if my user anubix had right passoword?
[23:22:45] FailBit: it wouldn't throw that error if that were the issue
[23:22:58] Anubix: btw my password is beggining with #
[23:23:15] trosborn: has joined #RubyOnRails
[23:23:22] FailBit: you need to quote your password
[23:23:46] annlewis: has joined #RubyOnRails
[23:23:49] FailBit: password: '#hashtagpassword'
[23:23:56] jenrzzz: has joined #RubyOnRails
[23:25:27] taxen: I have the following models; Group, User, Game and Bet. Users can belong to different groups and can place bets on games. Now I'm struggling with the query to list all bets that have been placed in a certain game by the users in a specific group. I suspect I'll have to use something lilke a WHERE IN on the game object...?
[23:26:14] Anubix: FailBit: Same error
[23:26:30] FailBit: taxen: Bets.where(game: @game, user_id: group.users.select(:id))
[23:26:39] FailBit: Bet, but you get the idea
[23:26:49] FailBit: Anubix, I think I'm out of ideas
[23:26:51] taxen: FailBit: thanks
[23:27:19] Anubix: FailBit: If i install sftp is it safe? Maybe not perfect for deploy but it could do the job
[23:27:31] FailBit: why not use scp?
[23:27:41] FailBit: also, no that is not safe
[23:27:52] Anubix: or something that i can just copy files to folder
[23:28:28] FailBit: tar the files, scp the tarball to the server, untar
[23:28:29] Anubix: should i run bundle install on production?
[23:28:31] djbkd: has joined #RubyOnRails
[23:28:48] siddart: has joined #RubyOnRails
[23:29:04] FailBit: note that if you run rake or rails on production, you need to set RAILS_ENV=production
[23:29:36] workmad3: has joined #RubyOnRails
[23:29:39] Anubix: Could not locate Gemfile or .bundle/ directory
[23:32:46] Anubix: FailBit: You can set host to "localhost" and you will have to create a database on the server with the same name.
[23:35:01] matharvard: has joined #RubyOnRails
[23:35:38] matharvard: has left #RubyOnRails: ()
[23:36:10] rickmasta: has joined #RubyOnRails
[23:36:17] imp4t: has joined #RubyOnRails
[23:36:28] Anubix: And i am using rbenv
[23:37:36] sankaber: has joined #RubyOnRails
[23:38:32] renews: has joined #RubyOnRails
[23:40:12] Anubix: FailBit: What are u using in secreyts.yml production secrey key based?
[23:40:27] FailBit: I can't tell you that.
[23:40:39] FailBit: I can tell you how I made the secret: rake secret
[23:40:45] Anubix: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
[23:40:47] Anubix: i have this
[23:41:35] FailBit: I use secrets.yml.local instead of reading from the env, but that shouldn't be of importance for new projects
[23:41:42] FailBit: that's only for much older ones
[23:42:12] Anubix: ok i give you look on my deploy.rb and i go sleep, no chance to configure this
[23:43:43] Anubix: http://pastie.org/private/cqhz8uuvnes5mhnxmvtjg
[23:46:01] U7se6: has joined #RubyOnRails
[23:46:32] Anubix: maybe tomorrow i try capistrano with that solved ssh problem what we did on begin
[23:47:13] Kara: has joined #RubyOnRails
[23:48:06] Anubix: FailBit: Do you see anything bad in that deploy.rb?
[23:48:07] siddart: has joined #RubyOnRails
[23:48:25] karam: has joined #RubyOnRails
[23:48:36] FailBit: not at a glance
[23:49:16] Anubix: ok, anyway thanks for help
[23:52:07] Pupeno: has joined #RubyOnRails
[23:52:47] michael_mbp: has joined #RubyOnRails
[23:54:55] imp4t: has joined #RubyOnRails