« Back to channel list

#RubyOnRails - 28 September 2015

« Back 1 day Forward 1 day »
[00:00:33] jun_: has joined #RubyOnRails
[00:01:06] idd2d: has joined #RubyOnRails
[00:03:03] pwnd_nfsw: MRI is stock ruby interpreter?
[00:03:27] ericjphillips: has joined #RubyOnRails
[00:05:34] Aeyrix: pwnd_nfsw: Technically it's YARV
[00:05:43] Aeyrix: but everyone just calls it MRI because that's what it was called originally.
[00:07:05] chills42: has joined #RubyOnRails
[00:08:32] natevick: has joined #RubyOnRails
[00:10:05] donkey-hotei: has joined #RubyOnRails
[00:10:10] FailBit: also if we used jruby we'd have to switch to puma or something
[00:10:23] swhitt: has joined #RubyOnRails
[00:10:30] Aeyrix: That's definitely not a downside.
[00:10:32] Aeyrix: Puma is fantastic.
[00:10:33] FailBit: and the same lead admin has a passenger enterprise license
[00:10:49] Aeyrix: >he bought passenger enterprise
[00:10:49] dikaio: has joined #RubyOnRails
[00:10:52] Aeyrix: >laughinglions.jpg
[00:11:38] FailBit: I'll admit, the deploy is quite smooth
[00:11:53] FailBit: touch current/tmp/restart.txt and 20 seconds later, everything's rebooted
[00:12:56] djbkd: has joined #RubyOnRails
[00:12:57] YankNYC: has joined #RubyOnRails
[00:14:34] rushed: JRuby is great tech for projects that can leverage its strengths and we shouldn't be laughing at people who support the Rails ecosystem (ie people who purchase a Passenger license)
[00:14:42] YankNYC: can someone please help me get these tests to pass from hartl's raills tutorial?
[00:14:44] YankNYC: https://gist.github.com/genericlady/b45b4ae73738a2478faf
[00:15:20] YankNYC: lik i don't understand why user isn't even valid but it's so weird it runs the other tests first
[00:15:35] YankNYC: i got through chapter 7 with everything passing then got up to 8 and something went wrong somewhere lol
[00:16:01] YankNYC: so i decided to go back a branch, drop the db and set it up again.... deleted some of the tests from chapter 8 since they are not tracked
[00:16:16] voltalio: has joined #RubyOnRails
[00:16:34] YankNYC: i can post the blocks of code that match the error if someone is interested in helping me
[00:16:36] rushed: YankNYC: depending on your test runner test order may be intentionally randomized, have you gisted the tests themselves (or compared them to the tutorial carefully)?
[00:17:00] workmad3: has joined #RubyOnRails
[00:17:01] YankNYC: i have compared them to the tutorial carefully there are no typos or little problems like that
[00:17:34] YankNYC: maybe the test order is tripping me up but i think test order makes more of a difference in chapter 8 when testing the http sessions for logging in and out. but i could still be wrong.
[00:17:50] dikaio: has joined #RubyOnRails
[00:18:03] YankNYC: which block do u want me to paste? test_should_be_valid@UserTest
[00:18:39] FooBarWidget: has joined #RubyOnRails
[00:19:37] fre: has joined #RubyOnRails
[00:21:49] YankNYC: this is the user_test errors https://gist.github.com/genericlady/8bf670c0d82f9fcd9440
[00:21:55] YankNYC: i mean test
[00:22:19] YankNYC: the third which was the first error to debug is an integration test i'll dig it up
[00:22:58] maz-dev: has joined #RubyOnRails
[00:23:44] YankNYC: https://gist.github.com/genericlady/2cdfe43839bb2be62900
[00:24:06] YankNYC: and this is calling info from the fixtures
[00:25:07] YankNYC: this is not calling from fixtures
[00:25:43] tejasmanohar: has joined #RubyOnRails
[00:25:47] yfeldblum: has joined #RubyOnRails
[00:25:57] rushed: YankNYC: so, you probably want to investigate why your users aren't valid :) binding.pry (if you use pry) or maybe puts @user.errors.messages
[00:26:06] YankNYC: yes i am using pry
[00:26:28] YankNYC: i was in rails console using pry gem and made a user cd user and ls
[00:26:40] YankNYC: and it was missing a password_digest method
[00:26:45] YankNYC: i think i'm missing something
[00:26:52] YankNYC: the bcrypt gem is in the gemfile
[00:27:29] IceyEC: has joined #RubyOnRails
[00:27:34] YankNYC: there was one more project he has you use i think for the pw digest. i'll look at it real quick
[00:27:53] donkey-hotei: has joined #RubyOnRails
[00:28:04] rushed: YankNYC: no idea about any of that, but your tests are failing because the user isn't validating, there will be messages about why in @user.errors / @user.errors.messages which you should look at, either using pry (by putting a binding.pry in the failing test) or puts to dump it to the console when the test runs
[00:28:17] one_zero: has joined #RubyOnRails
[00:29:27] YankNYC: ahhh i see
[00:29:30] YankNYC: goto the test
[00:29:36] YankNYC: in that block put in binding.pry?
[00:29:46] YankNYC: then rails console and @user.errors
[00:29:58] rushed: YankNYC: http://railscasts.com/episodes/280-pry-with-rails
[00:30:01] YankNYC: sorry i'm newish
[00:30:15] YankNYC: yeah it's also in their documentation i guess i'll look there
[00:33:07] Rodya_: has joined #RubyOnRails
[00:34:17] northfurr: has joined #RubyOnRails
[00:35:16] yfeldblum: has joined #RubyOnRails
[00:36:59] chills42: has joined #RubyOnRails
[00:37:16] YankNYC: @rushed thank you for helping me
[00:38:47] bronson: has joined #RubyOnRails
[00:40:41] lemur: has joined #RubyOnRails
[00:40:48] YankNYC: no method error for pry
[00:41:15] rushed: YankNYC: "binding.pry" is the command to launch pry at a paticular point
[00:41:59] rushed: YankNYC: and generally you'll want to gist the complete error w/ stack trace if you have a question :)
[00:42:39] YankNYC: required pry got it.. this is cool
[00:42:47] YankNYC: pry really is special tho
[00:43:29] YankNYC: something funky is happening with the tests
[00:44:44] YankNYC: https://gist.github.com/genericlady/f1273206d2f0267bd986
[00:44:48] YankNYC: how strange is that
[00:45:21] YankNYC: whoops hold on
[00:45:36] YankNYC: basically @user returns nil
[00:45:42] YankNYC: sorry for not pasting that bit
[00:45:56] YankNYC: but yeah there should be a @user variable
[00:46:16] rushed: YankNYC: you didn't breakpoint where you think you did
[00:47:27] YankNYC: oh that makes sens
[00:47:51] annlewis: has joined #RubyOnRails
[00:47:55] YankNYC: ok i'll put in the method because the intrepeter of course will load up that variable after parsing the class the first time for hooks
[00:47:59] northfurr: has joined #RubyOnRails
[00:48:05] rushed: YankNYC: exactly
[00:49:04] RegulationD: has joined #RubyOnRails
[00:51:27] YankNYC: i think we write out own valid? method.. i'll go look at that.. maybe the valid? method isn't looking for a field that's there. There's a remember digest field for the user. I think that's from a leftover db migration from chapter8. i was failing in chapter 8 so decided to go back to chapter 7 smh
[00:51:39] ericjphillips1: has joined #RubyOnRails
[00:52:09] robbyoconnor: has joined #RubyOnRails
[00:54:55] YankNYC: no i think it's native
[00:56:31] rushed: YankNYC: once you have your binding.pry in the right spot and have a prompt... enter "@user.valid?" (should return false) then "@user.errors.messages" (should return helpful messages regarding why valid? returned false)
[00:56:44] robbyoconnor: has joined #RubyOnRails
[00:57:12] YankNYC: the email has already been taken
[00:57:18] YankNYC: oh maybe it matches the fixture
[00:57:24] YankNYC: ::falls over::
[00:57:57] nya: has joined #RubyOnRails
[00:59:22] YankNYC: you my friend are a hero
[00:59:31] YankNYC: and so are the pry people
[00:59:40] jun_: has joined #RubyOnRails
[01:00:19] charliesome: has joined #RubyOnRails
[01:04:41] taiar: has joined #RubyOnRails
[01:04:49] stardiviner: has joined #RubyOnRails
[01:05:51] taiar: Hi guys, having trouble on making navigasmic gem to work with correct link verbs... Any thoughts?
[01:10:38] VeryBewitching: taiar: What have you tried?
[01:11:47] FrankD: has joined #RubyOnRails
[01:12:09] smathy: has joined #RubyOnRails
[01:13:26] pwnd_nfsw: I don't know the bot commands
[01:13:30] pwnd_nfsw: and obv help isn't going to help
[01:13:41] chills42: has joined #RubyOnRails
[01:14:08] quazimod1: has joined #RubyOnRails
[01:14:09] asheinfeld: has joined #RubyOnRails
[01:15:18] VeryBewitching: taiar: !gist some code so we can see what you're seeing. Backtraces, code to implement, anything is more helpful than nothing.
[01:15:18] helpa: taiar: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[01:16:06] blackmesa: has joined #RubyOnRails
[01:21:42] Lytol: has joined #RubyOnRails
[01:22:13] donkey-hotei: has joined #RubyOnRails
[01:23:15] baweaver: has joined #RubyOnRails
[01:25:50] pontiki: has joined #RubyOnRails
[01:26:40] pontiki: has joined #RubyOnRails
[01:29:33] CanTonic: has joined #RubyOnRails
[01:30:13] thejamespinto: has joined #RubyOnRails
[01:32:12] seank__: has joined #RubyOnRails
[01:32:25] ChadyG_: has joined #RubyOnRails
[01:32:26] dstarh: has joined #RubyOnRails
[01:32:31] Pazician_: has joined #RubyOnRails
[01:32:35] argami_: has joined #RubyOnRails
[01:34:02] synfinatic_: has joined #RubyOnRails
[01:35:39] matt_d_: has joined #RubyOnRails
[01:35:44] aaronr_: has joined #RubyOnRails
[01:36:27] mosez_: has joined #RubyOnRails
[01:36:29] ArTiSTiX_: has joined #RubyOnRails
[01:36:29] moloch__: has joined #RubyOnRails
[01:36:31] AlHafoudh_: has joined #RubyOnRails
[01:36:43] EiN_: has joined #RubyOnRails
[01:36:43] shaman42: has joined #RubyOnRails
[01:36:46] nightsh_: has joined #RubyOnRails
[01:36:52] janno_: has joined #RubyOnRails
[01:36:58] ngr_: has joined #RubyOnRails
[01:37:16] inoperable_: has joined #RubyOnRails
[01:37:20] charliesome: has joined #RubyOnRails
[01:37:44] fryguy9: has joined #RubyOnRails
[01:37:57] rboyd_: has joined #RubyOnRails
[01:38:34] widith: has joined #RubyOnRails
[01:38:35] martinbjeldbak_: has joined #RubyOnRails
[01:38:55] slash_nick: has joined #RubyOnRails
[01:38:55] xye: has joined #RubyOnRails
[01:38:56] soahccc: has joined #RubyOnRails
[01:38:56] differentreality: has joined #RubyOnRails
[01:38:56] contradictioned: has joined #RubyOnRails
[01:38:56] ddv: has joined #RubyOnRails
[01:38:56] slash_nick: has joined #RubyOnRails
[01:38:56] differentreality: has joined #RubyOnRails
[01:38:56] Quintasan: has joined #RubyOnRails
[01:38:56] Quintasan: has joined #RubyOnRails
[01:39:14] bruno-: has joined #RubyOnRails
[01:39:20] drPoggs: has joined #RubyOnRails
[01:39:31] bauruine: has joined #RubyOnRails
[01:39:38] bronson: has joined #RubyOnRails
[01:39:43] Isthar: has joined #RubyOnRails
[01:39:47] Olipro: has joined #RubyOnRails
[01:40:04] JonasOSDever: has joined #RubyOnRails
[01:40:33] FrankD: has joined #RubyOnRails
[01:42:11] larissa: has joined #RubyOnRails
[01:42:18] ebertx: has joined #RubyOnRails
[01:42:25] bphogan: has joined #RubyOnRails
[01:42:32] slash_nick: has joined #RubyOnRails
[01:42:37] andatche: has joined #RubyOnRails
[01:42:38] vedu: has joined #RubyOnRails
[01:42:39] thejoecarroll: has joined #RubyOnRails
[01:42:47] phrozen77: has joined #RubyOnRails
[01:42:49] russt: has joined #RubyOnRails
[01:42:59] baash05: has joined #RubyOnRails
[01:43:24] TheMonster: has joined #RubyOnRails
[01:43:38] bmurt: has joined #RubyOnRails
[01:43:50] mjc_: has joined #RubyOnRails
[01:43:54] baash05: Hey guys.. I have an order and an order line.. I don't want people to be able to create an order without at least one order line, but an orderline has order_id as one of it's fields.
[01:44:03] baash05: Is there a way to write that validation?
[01:44:04] hoodow: has joined #RubyOnRails
[01:44:47] Aeyrix: Create the order_line first and if there's nothing, fail?
[01:44:56] bonhoeffer: has joined #RubyOnRails
[01:45:05] iateadonut: has joined #RubyOnRails
[01:45:15] DukeDave: has joined #RubyOnRails
[01:45:23] Hosh: has joined #RubyOnRails
[01:45:30] bonhoeffer: in my application_helper, what methods are available? i???m getting undefined method for a gem i???ve installed
[01:45:43] bonhoeffer: wondering what the application_helper includes
[01:45:51] Aeyrix: Are you requiring it?
[01:46:19] bonhoeffer: no . . . when are gem???s required on load
[01:46:28] bonhoeffer: rails4 default
[01:46:42] Aeyrix: If it's in the Gemfile, it'll be required.
[01:46:51] Aeyrix: Add to gemfile, bundle install, should be usable.
[01:47:29] lacrosse: has joined #RubyOnRails
[01:47:43] bonhoeffer: hmm .. . undefined method `gravatar_image_url' for #<#<Class:0x00000108260940> in application_helper
[01:48:04] Aeyrix: the fuck is that object
[01:48:35] bonhoeffer: trying to implement: https://github.com/mdeering/gravatar_image_tag
[01:48:41] GnuYawk: has joined #RubyOnRails
[01:48:47] GnuYawk: has joined #RubyOnRails
[01:48:51] bonhoeffer: perhaps that is a view method
[01:48:52] dmz: has joined #RubyOnRails
[01:49:02] Aeyrix: Did you follow the readme?
[01:49:07] jeadre: has joined #RubyOnRails
[01:49:09] Aeyrix: also yes that is a view method
[01:49:12] Aeyrix: it is a helper in itself
[01:49:12] bonhoeffer: as far as in know
[01:49:29] bonhoeffer: so i don???t think i can use as a helper without some ugly hacking
[01:49:38] Aeyrix: Why would you want to use it as a helper?
[01:49:40] Aeyrix: It *is* a helper,
[01:49:46] Aeyrix: You can use it in your views.
[01:49:47] benlieb: has joined #RubyOnRails
[01:49:59] bonhoeffer: i have code surrounding it that i want as a helper
[01:50:25] bonhoeffer: https://gist.github.com/tbbooher/f41ea587d138a79bc6c6
[01:50:49] PlasmaStar: has joined #RubyOnRails
[01:51:18] hive-mind: has joined #RubyOnRails
[01:51:53] bonhoeffer: i just got the idea from this tutorial: http://www.sitepoint.com/messaging-rails-mailboxer/
[01:52:58] bonhoeffer: but the code is short enough to just put in the view
[01:53:30] bonhoeffer: updated with the whole file: https://gist.github.com/tbbooher/f41ea587d138a79bc6c6
[01:53:42] iateadonut: has joined #RubyOnRails
[01:54:00] mheld: has joined #RubyOnRails
[01:54:55] bonhoeffer: crap ??? same problem in the view . . .
[01:55:36] bonhoeffer: so not the helper ??? yes ??? that object is odd
[01:55:56] Aeyrix: no idea about that error
[01:55:58] Aeyrix: looks weird
[01:56:26] bonhoeffer: that class might be the parent of a partial
[01:56:44] voltalio: has joined #RubyOnRails
[01:57:37] bonhoeffer: the method is called in a partial ??? so the default class might be something i???m not used to in a view
[01:57:47] bonhoeffer: ok ??? cabin door closed ??? will hack on in flight . . .
[01:58:59] Maletor: has joined #RubyOnRails
[02:03:22] ericjphillips: has joined #RubyOnRails
[02:03:26] benlieb: has joined #RubyOnRails
[02:09:16] voltalio: has joined #RubyOnRails
[02:09:18] jun: has joined #RubyOnRails
[02:10:24] oflannabhra: has joined #RubyOnRails
[02:12:35] djbkd: has joined #RubyOnRails
[02:14:53] chills42: has joined #RubyOnRails
[02:18:53] sadaf2605: has joined #RubyOnRails
[02:20:34] baweaver: Don't suppose I could get someone to sanity check something for me?
[02:20:54] baweaver: getting into advanced sql hackery and shenanigans
[02:21:18] baweaver: and by advanced, I mean I'm probably doing this horribly wrong and someone should put this code out of its misery
[02:21:37] baweaver: https://gist.github.com/baweaver/ad887797486fa213a058 - last section of this details it.
[02:22:22] baweaver: fair warning, it will give you a headache.
[02:22:39] FCser: has joined #RubyOnRails
[02:23:20] benlieb: has joined #RubyOnRails
[02:24:12] baweaver: Tempted to scrap that one as just propagating really bad habits and data modeling.
[02:24:53] slash_nick: baweaver: which part?
[02:24:57] maz-dev: has joined #RubyOnRails
[02:25:01] baweaver: very last section
[02:25:20] baweaver: assuming a tag is (key: String, value: String)
[02:25:21] fedexo: has joined #RubyOnRails
[02:25:31] baweaver: find a Foo with two or more distinct tags
[02:25:39] baweaver: which is a really annoying problem admittedly.
[02:26:28] baweaver: let's just say I really want someone to tell me I'm doing something dastardly wrong with AR, and suggest a higher path
[02:26:38] baweaver: insofar I'm not finding one.
[02:27:04] baweaver: MTI and STI get close to it at least, but the problem there is that the tags could be named anything
[02:28:16] baweaver: ah, and I tend to use that state bit whenever I want to isolate what I'm doing to a single area. Easier to factor out later.
[02:33:01] slash_nick: baweaver: does this have a name? it's a little like kwargs... 'a = :a AND b = :b AND c = :c', {a: 1, b: 2, c:3}
[02:34:09] baweaver: http://guides.rubyonrails.org/active_record_querying.html#array-conditions - See 2.2.1
[02:34:30] baweaver: placeholder conditions can be used with ?s or with a hash
[02:34:35] baweaver: hash is really quite handy.
[02:34:42] n008f4g_: has joined #RubyOnRails
[02:35:02] slash_nick: baweaver: 2.2.1 Placeholder Conditions Similar to the (?) replacement style of params, you can also specify keys/values hash in your array conditions:
[02:35:26] slash_nick: baweaver: that oughta have a link in the TOC in the top right
[02:35:32] asheinfeld: has joined #RubyOnRails
[02:35:40] slash_nick: ACTION keeps reading
[02:35:43] baweaver: I can only dive to minor sections
[02:36:05] baweaver: correct me if I'm wrong though.
[02:36:37] baweaver: The next section is where it gets all types of dirty.
[02:37:20] oflannabhra: has joined #RubyOnRails
[02:39:58] Lytol: has joined #RubyOnRails
[02:40:01] baweaver: Probably going to go off and start writing on Generators, get a good comprehensive tutorial going on how to customize workflows and turn it into a conference talk for next RailsConf
[02:40:34] bronson: has joined #RubyOnRails
[02:41:04] rickmasta: has joined #RubyOnRails
[02:41:18] slash_nick: baweaver: gotta admit, the last sections are too thick for me to digest after the N+1 wines i've had tonight
[02:41:20] VeryBewitching: baweaver: I was considering hashing out something that created scaffolds to target multiple front-end frameworks.
[02:41:48] baweaver: slash_nick: yeah, that's the problem :D
[02:41:57] moeabdol: has joined #RubyOnRails
[02:41:59] baweaver: VeryBewitching: Yeah, working on it myself.
[02:42:13] baweaver: Angular to start with.
[02:42:26] baweaver: Probably make some opinionated generators for bootstrap styled sites and such
[02:42:55] slash_nick: baweaver: i'm a fan of thor... "system wide tasks" > per project tasks
[02:42:57] VeryBewitching: Starting with bootstrap makes it somewhat easier to get the design pattern down for other frameworks.
[02:43:29] baweaver: slash_nick: take one more step back
[02:43:33] baweaver: gemified generators
[02:43:47] slash_nick: baweaver: https://github.com/rthbound/pay_dirt/blob/master/pay_dirt.thor is a service object generator i use often at work
[02:43:59] slash_nick: </shameless_plug>
[02:45:10] VeryBewitching: It would be nice for folks getting into Rails to be able to do: rails g scaffold:bootstrap3 user
[02:45:11] rickmasta: has joined #RubyOnRails
[02:45:28] baweaver: Most of what I use right now are Sublime and Vim macros
[02:45:42] slash_nick: VeryBewitching: that's neat... rails g scaffold:default User foo:string bar:text
[02:45:47] baweaver: snippet systems are very handy for mass code generation after a pattern
[02:46:36] VeryBewitching: RubyMine has live templates per file type, so in a HAML file if I want the basic structure for bootstrap nav.nav-default I just type boo and the live template autocompletes and dumps out the HAML, properly indented, wherever the cursor is.
[02:46:37] baweaver: talk idea is going to be named "You type too much- Code generation techniques for Rails"
[02:46:58] nya: has joined #RubyOnRails
[02:47:18] VeryBewitching: baweaver: haha, good name.
[02:47:32] baweaver: and it's in KC this year, so back to my home state.
[02:47:34] slash_nick: VeryBewitching: it'd be neat to be able to say "i want to use bootstrappy views, a model with change auditing via papertrail, image uploads with dragonfly... so rails g scaffold User --plugins=dragonfly,papertrail,bootstrap ... i dunno
[02:47:53] baweaver: slash_nick: at that point don't use command line options
[02:48:04] baweaver: make some type of manifest folder which describes it in YAML
[02:48:08] baweaver: think chef script
[02:48:12] baweaver: but for Rails components
[02:48:17] baweaver: also something I'm working on later.
[02:49:58] RegulationD: has joined #RubyOnRails
[02:50:26] VeryBewitching: slash_nick: Ya, that kinda idea. rails g scaffold:bootstrap3 User --use-haml --paginate --searchable
[02:50:28] baash05: Gahh I hate meetings
[02:50:41] baweaver: A scaffold is how you set up the base of something, a blueprint lays out the plan for even the scaffolds
[02:51:06] baweaver: so make something like RailsBlueprint for specifying larger components as a unification of Scaffolds
[02:51:06] VeryBewitching: baweaver: I guess I don't think that everything should be automated. :)
[02:51:18] baweaver: Automate all the things!
[02:51:26] VeryBewitching: But providing a basis for all front-end frameworks is something I'm surprised isn't already present.
[02:51:30] baweaver: If I have to type something more than once, it's getting automated.
[02:51:43] baweaver: VeryBewitching: which one are you thinking of building out?
[02:51:45] slash_nick: VeryBewitching: it sounds cool... but a house of cards to maintain
[02:52:04] slash_nick: baweaver: i'm with you
[02:52:09] baweaver: No sense in going separate ways on it if we're both working towards the same thing.
[02:52:14] mechaxl: has joined #RubyOnRails
[02:52:28] VeryBewitching: baweaver: I wanted to build out models and controllers generation, see how that goes (and it is quite a job to do just that) and maybe move onto form builder generation based on YAML
[02:52:31] slash_nick: ACTION looks forward to witchweaver's first release
[02:52:54] baweaver: ping me on Twitter later @keystonelemur
[02:53:02] baweaver: can probably get something going
[02:53:12] baweaver: though my first goal is going to be Angular service code generation.
[02:53:21] baweaver: or rather a base frame for Rails SOA
[02:53:22] slash_nick: speaking of form generation... i'd like to see a good workflow engine...
[02:53:32] baweaver: ...second thought, I need to think this through more.
[02:54:15] VeryBewitching: baweaver: If you can come up with Angular view templates, I'll happily contribute to a generator repository for parts fabrication indefinately.
[02:54:29] VeryBewitching: ACTION doesn't know much about AngularJS
[02:54:39] baweaver: Yeah, give me a week to plot things out
[02:55:00] baweaver: The base of what would need to be done would be some type of scaffold hook that would generate API documentation and jbuilders.
[02:55:24] VeryBewitching: Generating RDoc on the fly?
[02:55:27] baweaver: APIPie is decent for it, and I've already got the author interested in supporting RAML
[02:55:27] VeryBewitching: ACTION shudders.
[02:55:44] baweaver: such as endpoints and params it takes
[02:55:51] VeryBewitching: Ah, roger that.
[02:55:57] baweaver: tedious stuff that could be automated to 80%+ usefulness.
[02:55:59] VeryBewitching: Sent you a ping.
[02:56:08] slash_nick: ACTION 's wife just got a lead role in a local production of Oliver! (a musical)... decibel meter is pegged out at the moment
[02:56:19] VeryBewitching: Though, PM me quick as I don't look at my twitter feed often, I'll toss you my email address.
[02:56:42] natevick: has joined #RubyOnRails
[02:57:23] mechaxl: Sorry if this is too easy of a question, but I'd like to contribute to this repo: https://github.com/osbridge/openconferenceware
[02:57:39] slash_nick: mechaxl: awesome, what it do?
[02:57:51] mechaxl: And when I pull down code and run "bundle install", then "bin/rails generate open_conference_ware:install", it says that that generator can't be found
[02:57:58] mechaxl: anybody know what I'm doing wrong?
[02:58:46] slash_nick: mechaxl: ... what about `rails g ...` instead of bin/rails? their instructions seem funny.
[03:00:09] Tempesta: has joined #RubyOnRails
[03:00:16] sevenseacat: has joined #RubyOnRails
[03:07:53] chi6rag: has joined #RubyOnRails
[03:08:28] mechaxl_: has joined #RubyOnRails
[03:09:27] braincrash: has joined #RubyOnRails
[03:10:10] chi6rag: has left #RubyOnRails: ()
[03:12:15] charliesome: has joined #RubyOnRails
[03:14:50] djbkd: has joined #RubyOnRails
[03:15:03] hahuang65: has joined #RubyOnRails
[03:18:14] sar1nk: has joined #RubyOnRails
[03:19:04] youngbaks: has joined #RubyOnRails
[03:19:39] annlewis: has joined #RubyOnRails
[03:20:14] liquid-silence: has joined #RubyOnRails
[03:23:06] fre: has joined #RubyOnRails
[03:24:26] mechaxl: has joined #RubyOnRails
[03:27:59] mechaxl_: has joined #RubyOnRails
[03:32:57] baweaver: has joined #RubyOnRails
[03:37:15] riskish: has joined #RubyOnRails
[03:37:40] rickmasta: has joined #RubyOnRails
[03:39:42] ciree: has joined #RubyOnRails
[03:41:31] bronson: has joined #RubyOnRails
[03:42:59] lemur: has joined #RubyOnRails
[03:44:45] stardiviner: has joined #RubyOnRails
[03:47:59] roxtrongo: has joined #RubyOnRails
[03:49:26] roxtrongo: has joined #RubyOnRails
[03:55:11] i: has joined #RubyOnRails
[04:00:34] djbkd: has joined #RubyOnRails
[04:04:21] krz: has joined #RubyOnRails
[04:10:24] dopie: has joined #RubyOnRails
[04:11:06] baash05: has joined #RubyOnRails
[04:13:30] rickmasta: has joined #RubyOnRails
[04:16:38] pontiki: bin/rails is appropriate in the 4.x versions
[04:16:53] pontiki: it's the same as saying `bundle exec rails`
[04:18:41] pontiki: ^ for slash_nick over an hour ago
[04:19:36] fre: has joined #RubyOnRails
[04:20:18] theery: has joined #RubyOnRails
[04:20:27] annlewis: has joined #RubyOnRails
[04:22:01] towski_: has joined #RubyOnRails
[04:26:13] slash_nick: eh.. i thought i was reading rails script/server... thanks pontiki
[04:27:17] towski_: has joined #RubyOnRails
[04:31:11] krz: has joined #RubyOnRails
[04:31:53] jenrzzz: has joined #RubyOnRails
[04:32:46] towski_: has joined #RubyOnRails
[04:34:02] bonhoeffer: has joined #RubyOnRails
[04:34:35] widith: has joined #RubyOnRails
[04:36:31] chi6rag: has joined #RubyOnRails
[04:36:50] Cork: has joined #RubyOnRails
[04:42:26] bronson: has joined #RubyOnRails
[04:43:07] jun: has joined #RubyOnRails
[04:43:31] bamorim: has joined #RubyOnRails
[04:50:51] RegulationD: has joined #RubyOnRails
[04:52:12] FrankD: has joined #RubyOnRails
[04:52:27] kp666: has joined #RubyOnRails
[04:52:41] eyck: has joined #RubyOnRails
[04:55:11] SteenJobs: has joined #RubyOnRails
[04:57:54] qejk: has joined #RubyOnRails
[04:58:13] FrankD: has joined #RubyOnRails
[04:58:57] Peteykun: has joined #RubyOnRails
[04:59:32] roxtrongo: has joined #RubyOnRails
[04:59:34] pawnbox: has joined #RubyOnRails
[05:00:10] towski_: has joined #RubyOnRails
[05:00:46] doctorly: has joined #RubyOnRails
[05:01:04] moeabdol: has joined #RubyOnRails
[05:03:57] SteenJobs: has joined #RubyOnRails
[05:04:09] jun: has joined #RubyOnRails
[05:05:21] pawnbox: has joined #RubyOnRails
[05:08:55] robbyoconnor: has joined #RubyOnRails
[05:09:40] PhaseCode: has joined #RubyOnRails
[05:10:07] charliesome: has joined #RubyOnRails
[05:10:25] allcentury: has joined #RubyOnRails
[05:11:14] roxtrongo: has joined #RubyOnRails
[05:13:50] bonhoeffer: has joined #RubyOnRails
[05:15:06] pawnbox: has joined #RubyOnRails
[05:16:55] dhjondoh: has joined #RubyOnRails
[05:16:59] chills42: has joined #RubyOnRails
[05:18:44] montagesoftware: has joined #RubyOnRails
[05:19:34] Baliw: has joined #RubyOnRails
[05:20:02] nya: has joined #RubyOnRails
[05:20:38] pydave6367: has joined #RubyOnRails
[05:21:14] annlewis: has joined #RubyOnRails
[05:21:49] raunicolae: has joined #RubyOnRails
[05:24:35] atmosx: has joined #RubyOnRails
[05:27:48] atmosx: has joined #RubyOnRails
[05:31:52] alexUaN: has joined #RubyOnRails
[05:33:14] allcentu1: has joined #RubyOnRails
[05:34:11] r0x0rZ: has joined #RubyOnRails
[05:34:15] atmosx: has joined #RubyOnRails
[05:38:37] liquid-silence: has joined #RubyOnRails
[05:39:49] theery: has joined #RubyOnRails
[05:39:50] fre: has joined #RubyOnRails
[05:40:54] bruno-: has joined #RubyOnRails
[05:43:03] h7br1x: has joined #RubyOnRails
[05:43:28] jun: has joined #RubyOnRails
[05:44:17] roxtrongo: has joined #RubyOnRails
[05:44:36] bronson: has joined #RubyOnRails
[05:45:42] tagrudev: has joined #RubyOnRails
[05:46:09] h7br1x: Hey guys, I'm having issues with my users controller. I've permitted the params for fname, lname, avatar, and avatar_cache but it's saying they're unpermitted in the log. https://gist.github.com/ktdmedia/1e41758165804a49a298 any suggestions?
[05:51:23] rushed: has joined #RubyOnRails
[05:51:44] dionysus69: has joined #RubyOnRails
[05:56:23] Ropeney: h7br1x: Can you add the log output
[05:56:33] rvanlieshout: has joined #RubyOnRails
[05:57:26] h7br1x: Ropeney: Turns out it was a devise issue. I think I've got it now.
[05:57:41] sevenseacat: it definitely wasnt, based on that code
[05:58:29] h7br1x: sevenseacat: You're welcome to improve it :P
[05:59:00] sevenseacat: https://gist.github.com/ktdmedia/1e41758165804a49a298#file-users-controller-L44 is completely wrong, but i was also waiting to see the log - given you mentioned it in the question, it appears important.
[06:02:34] h7br1x: the log was just saying the custom params i mentioned were unpermitted. But I was able to fix it by adding devise_parameter_sanitizer to my application controller for :account_update and :sign_up which fixed my issue.
[06:03:48] sevenseacat: except your users controller has nothing to do with devise
[06:04:08] sevenseacat: the log also shows what params you're actually submitting to the controller which helps when diagnosing strong params problems
[06:04:36] Ropeney: h7br1x: I would like to see log, because i think your not even hitting that controller?
[06:05:02] sevenseacat: indeed, logs also show which controller and action are being used
[06:05:22] sevenseacat: and if theyre important enough to mention, they're important enough to show especially when two people specifically request them
[06:06:54] DoubleMalt: has joined #RubyOnRails
[06:09:49] h7br1x: https://gist.github.com/ktdmedia/1e41758165804a49a298#file-log
[06:10:19] sevenseacat: yep, not touching your users controller at all
[06:11:28] pawnbox_: has joined #RubyOnRails
[06:12:08] h7br1x: I fixed it using devise_parameter_sanitizers. Would you suggest something else?
[06:12:23] sevenseacat: i would suggest understanding the problem
[06:12:34] sevenseacat: your users controller's update method is not being called
[06:13:21] sevenseacat: your registration controller is, meaning you are always updating the current user
[06:13:41] dionysus69: can I send form submit request on each checkbox check/uncheck?
[06:13:53] konsolebox: has joined #RubyOnRails
[06:14:05] sevenseacat: you can send a request, yes.
[06:14:31] dionysus69: how do I achieve it? I tried onclick javascript unsuccessfully?
[06:15:22] sevenseacat: https://api.jquery.com/change/
[06:15:37] dionysus69: ok thanks :)
[06:15:45] eGGsha: has joined #RubyOnRails
[06:16:03] netzfisch: has joined #RubyOnRails
[06:16:40] konsolebox: has joined #RubyOnRails
[06:19:44] yfeldblum: has joined #RubyOnRails
[06:20:07] borkdude: has joined #RubyOnRails
[06:21:21] dionysus69: yay it works :D any idea how to make checkboxes prettier?
[06:21:43] konsolebox: has joined #RubyOnRails
[06:21:43] Aeyrix: you can't really style checkboxes or select inputs much.
[06:21:45] yaw: has joined #RubyOnRails
[06:21:45] sevenseacat: not cross-browser easily
[06:21:47] Aeyrix: or radio buttons
[06:21:50] Aeyrix: welcome to the web
[06:21:50] naftilos76: has joined #RubyOnRails
[06:22:00] annlewis: has joined #RubyOnRails
[06:22:09] dionysus69: I tried bootstrap button-group and data-toggle options to convert them to buttons but data-toggle is preventing form from submission
[06:22:12] Aeyrix: Five revisions of HTML, and three of CSS, and we still can't reliably style half the input field types.
[06:22:23] rushed: dionysus69: you might consider bootstrap
[06:23:07] dionysus69: yes thats what I did but data-toggle="button" option on the button-group is using some javascript that prevents form from submission totally
[06:23:12] artto: has joined #RubyOnRails
[06:23:24] dionysus69: so that seemed to be the only option I discovered and it doesnt work :D
[06:23:35] Aeyrix: ... then don't include that attribtue?
[06:23:41] Aeyrix: The CSS isn't going to be based on a data attribute.
[06:24:04] dionysus69: then the checkboxes appear, the point is to give buttons the behaviour of checkboxes
[06:24:33] dionysus69: bootstrap basically breaks, that attribute is key to utilize that feature :p
[06:24:54] sevenseacat: 'to give buttons the behaviour of checkboxes' say what?
[06:25:35] dionysus69: http://getbootstrap.com/javascript/#buttons-checkbox-radio the first example is the one i mean
[06:25:38] rromanch_: has joined #RubyOnRails
[06:26:10] dionysus69: check the example, button push and unpush state similar to checkbox just for visual purpose
[06:26:27] pontiki: has joined #RubyOnRails
[06:26:31] dionysus69: because checkboxes work for sites like amazon and ebay and less for design oriented websites :D
[06:26:40] rvanlieshout: design oriented websites?
[06:26:51] Aeyrix: Whatthefuckamireading.tiff
[06:27:08] dionysus69: ye like presentation websites that rely on beauty ^.^
[06:27:18] rvanlieshout: dionysus69: beauty is irrelevant
[06:27:21] rvanlieshout: for big websites
[06:27:34] dionysus69: yes thats what I meant, i am not making a big website :D
[06:27:48] comrad: has joined #RubyOnRails
[06:28:06] rvanlieshout: so you _just_ want to display a checkbox as a button?
[06:29:12] dionysus69: yes haha whatever link i posted works it just refuses to send get request which is also as important
[06:29:47] rushed: dionysus69: refuses to send get requests?
[06:30:06] rushed: dionysus69: how were they getting sent before?
[06:30:43] dionysus69: yea i insert that snippet inside form tag for example push submit button and nothing happens, data-toggle bootstrap option breaks submit button weird but bootstrap channel said thats expected but they didnt suggest workaround
[06:31:06] SteenJobs: has joined #RubyOnRails
[06:31:49] rushed: dionysus69: have you gisted what you're working with?
[06:32:22] dionysus69: yesterday yes, I can gist it now too i guess one sek let me rebuild it
[06:33:25] blackmesa: has joined #RubyOnRails
[06:35:22] towski_: has joined #RubyOnRails
[06:35:47] dionysus69: https://gist.github.com/webzorg/862b5b1c6eee45f16194 so the design is ok, but the submit has no effect until you take off the data-toggle from the div, but then the design is lost
[06:36:23] arup_r: has joined #RubyOnRails
[06:36:24] Denarii: has joined #RubyOnRails
[06:36:58] maokomioko: has joined #RubyOnRails
[06:37:38] rushed: dionysus69: right, so where are your value fields?
[06:37:56] rushed: dionysus69: with buttons, only the one you pushed gets sent to the server
[06:38:09] rushed: dionysus69: so you'll need to stuff the value into a hidden field
[06:38:28] Macaveli: has joined #RubyOnRails
[06:38:36] pontiki: there aren't any buttons, actually; just formatting to make the labels look like buttons
[06:39:13] dionysus69: wait a second lol it works now
[06:39:31] pontiki: what bootstrap is doing is turning those checkbox inputs into something that looks like a button
[06:40:05] dionysus69: yes, wait let me post the thing that works now i ll go crazy i was bashing my head on it whole yesterday and it didnt work
[06:40:07] pontiki: it requires the bootstrap.js to be loaded
[06:40:47] sanjayu: has joined #RubyOnRails
[06:40:52] dionysus69: https://gist.github.com/webzorg/6a1dbdac68ec8a21b106
[06:41:17] rushed: oh now we get the not fake :)
[06:41:42] aganov: has joined #RubyOnRails
[06:42:19] konsolebox: has joined #RubyOnRails
[06:42:59] pontiki: the fake was straight off the getbootstrap site
[06:43:24] dionysus69: just wrapped with form around it :D
[06:43:35] dionysus69: wow it works damn it
[06:44:32] banjara: has joined #RubyOnRails
[06:45:28] slayerjain: has joined #RubyOnRails
[06:45:34] bronson: has joined #RubyOnRails
[06:45:42] dionysus69: but I wonder why this is not used mainstream
[06:45:51] dionysus69: no one wants pretty checkboxes ? :D
[06:46:08] konsolebox: has joined #RubyOnRails
[06:46:44] sevenseacat: reinventing standard form controls isn't really recommended
[06:47:13] sandstrom: has joined #RubyOnRails
[06:48:33] dionysus69: hmm ok, i will post working final so you evaluate it and tell me what might be the flaw :P
[06:49:02] nfk|laptop: has joined #RubyOnRails
[06:49:14] moeabdol: has joined #RubyOnRails
[06:49:39] nya: has joined #RubyOnRails
[06:50:50] dionysus69: so this is it https://gist.github.com/webzorg/fe12fb020a087f52754b
[06:50:53] slayerja_: has joined #RubyOnRails
[06:51:17] dionysus69: with one flaw, on submit the active button losses it's active attribute
[06:51:23] ruurd: has joined #RubyOnRails
[06:51:44] RegulationD: has joined #RubyOnRails
[06:52:46] Pumukel: has joined #RubyOnRails
[06:53:58] sevenseacat: why are you using checkboxes if they're actually submit buttons
[06:54:26] yottanami1: has joined #RubyOnRails
[06:54:55] dionysus69: because I want to "remember" their state, if you select 2 out of 3, products get filtered accordingly
[06:55:58] dionysus69: brb now! thanks for all
[06:56:50] pontiki: i suppose there's a way to make that work, but wow that looks janky
[06:57:32] absklb: has joined #RubyOnRails
[06:57:47] absklb: can i ask css question here? regarding my rails project!
[06:57:57] slayerjain: has joined #RubyOnRails
[06:58:10] yottanami1: I am trying to bundle install on my machine but it can not install gems in group :development
[06:58:43] absklb: yottanami_: whats the error its giving
[06:59:51] yottanami1: nothing it will install all gems but not development group and when I run I have errors like cannot load such file -- pry
[07:00:22] yottanami1: because the pry is in development
[07:00:26] yottanami1: here is my gemfile http://dpaste.com/0E78S5G
[07:00:53] pontiki: have you ever run bundle install --without development in this directory?
[07:01:06] yottanami1: pontiki, yes for deploy
[07:01:23] pontiki: so look for a .bundle directory, and a config file in it
[07:01:46] yottanami1: What happens if I remote .bundle?
[07:02:09] pontiki: you shouldn't ever deploy the exact same directory you're developing and testing in
[07:02:22] pontiki: the deploy directory is the one running live
[07:02:31] yaw: has joined #RubyOnRails
[07:02:36] cih: has joined #RubyOnRails
[07:03:02] Cervajz: has joined #RubyOnRails
[07:03:25] solars: has joined #RubyOnRails
[07:03:30] pontiki: you should be able to remove that .bundle directory, and make sure it is *not* in your repo
[07:03:44] arup_r: pontiki: I am not getting the idea why the extra option has to be performed while things are mentioned Gemfile. I asked you yesterday also the same question, but you were offline.. Can you clarify this ?
[07:04:02] yottanami1: pontiki, I had to use --without development test because I tried to deploy on server using Capistrano but It tries to install in Development
[07:04:15] pontiki: what are you talking about arup_r?
[07:04:23] tejasmanohar: recommended books after rails tutorial?
[07:04:30] arup_r: bundle install --without development << Why needed ?
[07:04:35] tejasmanohar: (this one https://www.railstutorial.org)
[07:04:42] VeryBewitching: tejasmanohar: !r4ia
[07:04:42] helpa: tejasmanohar: 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
[07:04:42] arup_r: why the option is needed ?
[07:05:25] pontiki: arup_r: that is used when you deploy your application *on the production machine* so when you bunde up the gems, it does not fetch or require any of the ones in the development group
[07:05:35] Cervajz_: has joined #RubyOnRails
[07:06:16] pontiki: http://bundler.io/v1.10/bundle_install.html
[07:06:23] yottanami1: arup_r, I used --without development because capistrano was trying to install development gems
[07:06:45] arup_r: pontiki: Yesterday the same guy asked that pg is getting installed in his dev env although it is under production group.. And you said to do bundle install --without production .. and yottanami_ confirmed it is fixed.
[07:07:39] arup_r: I am confused that is why.. I never used the extra flag... and it worked well. Let me read the doc
[07:08:13] yottanami1: arup_r, It fixed but does not solve my deploy problem
[07:08:46] yottanami1: here is my gem file http://dpaste.com/0E78S5G I am trying to deply using cap production deploy and I got this error
[07:08:56] yottanami1: Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
[07:09:25] pontiki: perhaps your deploy.rb and deploy/*.rb files are messed up
[07:09:28] banjara: has joined #RubyOnRails
[07:09:59] arup_r: pontiki: So bundler don't check the current rails environment .. it does install all from Gemfiles you meant irrespective of which are placed in which group ?
[07:10:40] pontiki: the Gemfile groups actually have nothing to do with the RAILS_ENV except naming conventions
[07:10:50] slayerja_: has joined #RubyOnRails
[07:11:38] pontiki: you can use group names of "banana", "george", and "millenium_falcon"
[07:11:48] Cervajz: has joined #RubyOnRails
[07:12:42] pontiki: it's equally possible to use Rails environment names of :billings, :yachtzee, or :larch
[07:13:34] pontiki: that the names match is a goodness, but it isn't a requirement, and there is no linkage between the Gemfile group names and Rails environment names
[07:15:12] alex88: has joined #RubyOnRails
[07:15:54] arup_r: Well.. I had the misconceptions then it seems..
[07:16:00] yottanami1: pontiki, here is my production file http://dpaste.com/2M2VY8K
[07:17:28] arBmind: has joined #RubyOnRails
[07:17:40] pragmatism: has joined #RubyOnRails
[07:17:49] srinidhi: has joined #RubyOnRails
[07:17:56] h7br1x: has joined #RubyOnRails
[07:18:48] blackmesa: has joined #RubyOnRails
[07:19:35] alphaatom: has joined #RubyOnRails
[07:21:31] arup_r: Guys in mandrill ,,, any chance to see the content of the outbound email ? I am not seeing any option.. Do they have the facility ?
[07:21:48] arup_r: I am on the mandrill dashboard..
[07:21:57] Pavster: has joined #RubyOnRails
[07:22:46] annlewis: has joined #RubyOnRails
[07:23:04] zpe: has joined #RubyOnRails
[07:24:46] pawnbox: has joined #RubyOnRails
[07:26:00] h7br1x: has joined #RubyOnRails
[07:26:14] Balzrael: has joined #RubyOnRails
[07:27:02] pragmatism: has joined #RubyOnRails
[07:27:02] fre: has joined #RubyOnRails
[07:27:11] raunico3: has joined #RubyOnRails
[07:27:33] raunicolae: has left #RubyOnRails: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[07:28:43] Linuus: has joined #RubyOnRails
[07:32:14] naftilos76: has joined #RubyOnRails
[07:33:31] absklb: has joined #RubyOnRails
[07:33:50] absklb: is there any way I can know from which file the current #footer is coming from?
[07:33:55] absklb: there are more than one css files
[07:34:06] absklb: and i cant decide from file name
[07:34:30] arup_r: absklb: You can use browser dev tool for that
[07:34:47] absklb: I am looking in firebug. where to look?
[07:34:59] arup_r: I use Chrome devtool
[07:35:28] absklb: i have chromium. where to look in that?
[07:35:45] arup_r: so if you select the element, devtool shows all the CSS applied to the element with a link to the file where it is written
[07:36:20] sininen: has joined #RubyOnRails
[07:37:31] sandstrom: has joined #RubyOnRails
[07:39:53] Macaveli: Still having difficulty while upgrade to Rails 4 and latest Ruby version with Pow @ Pry-remote / Pry? Looking for any help! Thanks :) http://stackoverflow.com/questions/32780971/pry-remote-not-triggered-rails-4
[07:40:36] Ergo: has joined #RubyOnRails
[07:43:47] burgestrand: has joined #RubyOnRails
[07:46:24] bronson: has joined #RubyOnRails
[07:47:40] arup_r: regarding the mandril thing.. I got it https://mandrill.zendesk.com/hc/en-us/articles/205583147-Can-I-view-the-contents-of-email-I-sent-through-Mandrill-
[07:48:17] quazimod1: is there a nicer way of doing collection.each{|c| return true if c.something?}; return false
[07:48:36] quazimod1: basically, return true if atleast 1 thing in the collection satisfies the requirement
[07:48:48] quazimod1: select i guess
[07:49:27] pawnbox: has joined #RubyOnRails
[07:50:24] abuzze: has joined #RubyOnRails
[07:50:27] arup_r: quazimod1: use .any?
[07:51:26] arup_r: collection.any? {|c| c.something? ? true : false } # will return
[07:51:51] slash_nick: c.any?(&:blank?)
[07:51:53] arup_r: Or if `c.something?` return true or false ..
[07:52:14] arup_r: then collection.any?(&:something?)
[07:52:47] slash_nick: right on arup_r
[07:52:57] qwertme: has joined #RubyOnRails
[07:53:05] thejamespinto: slash_nick: yo!
[07:53:08] arup_r: right below slash_nick
[07:53:54] Linuus: has joined #RubyOnRails
[07:54:20] slash_nick: hola thejamespinto
[07:55:28] Mia: has joined #RubyOnRails
[07:55:28] Mia: has joined #RubyOnRails
[07:55:46] thejamespinto: slash_nick: would you please help me evaluate a certain situation over here?
[07:56:04] kalusn: has joined #RubyOnRails
[07:57:09] Axy: has joined #RubyOnRails
[07:58:32] slash_nick: thejamespinto: i'm about to fall asleep...3am for me.
[07:59:00] thejamespinto: slash_nick: please carefully move your keyboard sideways then :)
[07:59:37] thejamespinto: it's 5 AM and I can't sleep :(
[07:59:53] thejamespinto: I've done too much Rails on Sunday :(
[08:01:01] thejamespinto: slash_nick: I'm sending you on PM
[08:01:32] quazimod1: arup_r: excelent :D
[08:01:48] slash_nick: thejamespinto: if there's a problem you want help with, it's a good idea to just post it in channel... you benefit from having more people around to answer, and others get the opportunity to benefit as well
[08:01:51] alphaatom: has joined #RubyOnRails
[08:02:17] agit0: has joined #RubyOnRails
[08:02:51] Hates_: has joined #RubyOnRails
[08:02:55] thejamespinto: slash_nick: I'm used to the channel rules
[08:03:02] Hates_: has joined #RubyOnRails
[08:03:10] Yakko: @helpa !botsnack
[08:03:17] Yakko: !botsnack
[08:03:17] helpa: Nom nom. Thanks, yakko!
[08:04:04] thejamespinto: it was hungry, I could tell
[08:04:33] kalusn: has joined #RubyOnRails
[08:08:05] jsrn_: has joined #RubyOnRails
[08:10:43] ngr_: has left #RubyOnRails: ()
[08:15:12] drptbl: has joined #RubyOnRails
[08:17:56] darutoko: has joined #RubyOnRails
[08:19:54] krisquigley: has joined #RubyOnRails
[08:20:15] chrissonar: has joined #RubyOnRails
[08:21:12] futilegames: has joined #RubyOnRails
[08:22:40] Peteykun: has joined #RubyOnRails
[08:23:28] ddv: has joined #RubyOnRails
[08:23:30] annlewis: has joined #RubyOnRails
[08:24:07] pierre_f: has joined #RubyOnRails
[08:24:25] charliesome: has joined #RubyOnRails
[08:26:09] piotrj: has joined #RubyOnRails
[08:27:16] pawnbox: has joined #RubyOnRails
[08:30:00] blackmesa: has joined #RubyOnRails
[08:30:14] abuzze: has joined #RubyOnRails
[08:31:07] abuzze: has joined #RubyOnRails
[08:32:39] habitullence: has joined #RubyOnRails
[08:37:19] moeabdol: has joined #RubyOnRails
[08:38:28] exadeci: has joined #RubyOnRails
[08:39:09] artto_: has joined #RubyOnRails
[08:39:36] voker57: has joined #RubyOnRails
[08:41:11] absklb: has joined #RubyOnRails
[08:47:21] bronson: has joined #RubyOnRails
[08:50:25] basldex: has joined #RubyOnRails
[08:51:37] habitullence: has joined #RubyOnRails
[08:52:36] RegulationD: has joined #RubyOnRails
[08:52:54] maokomioko: has joined #RubyOnRails
[08:53:10] marr: has joined #RubyOnRails
[08:53:18] arup_r: thejamespinto: Your problem solved ? :)
[08:53:28] arup_r: absklb: and basldex hello :D
[08:53:37] habitullence: has joined #RubyOnRails
[08:53:54] thejamespinto: arup_r: I'm building a rails auth gem and I really wanted to hear nick's opinions
[08:55:06] thejamespinto: he had helped me on it the other day but he never saw what it does :)
[08:55:07] Palsson: has joined #RubyOnRails
[08:57:02] basldex: thejamespinto: authorization or authentificatin? or both?
[08:57:29] bruno-: has joined #RubyOnRails
[08:58:57] thejamespinto: basldex: authentication but it does touch the surface of authorization in order to solve a problem with long sign up forms and sign up with multiple roles
[08:59:36] basldex: anything online yet? I'm looking for a replacement
[08:59:36] Cervajz_: has joined #RubyOnRails
[08:59:44] thejamespinto: it leaves the rest entirely for cancan, pundit or any other autho solution
[08:59:57] thejamespinto: basldex: yes I could give you a quick tour
[09:00:10] basldex: a link would be enough tough :)
[09:00:33] thejamespinto: you'd need a tour for the first feature
[09:00:49] basldex: I assume it's open source?
[09:01:11] thejamespinto: oh, it also deals with locale and timezone for you
[09:01:24] basldex: sounds neat
[09:01:37] thejamespinto: basldex: give it a sign up on this demo website http://hello-gem.herokuapp.com/users
[09:01:50] basldex: cool, will do. thanks
[09:02:09] Lytol: has joined #RubyOnRails
[09:02:11] basldex: got a repo too?
[09:02:37] thejamespinto: basldex: now click on: Switch Accounts > Sign In and sign in with my account james/1234
[09:02:55] thejamespinto: multiple sign in, that's the feature I said you'd need a tour
[09:03:37] basldex: is it based on devise or standalone?
[09:03:40] thejamespinto: we're still debating how it should be presented by default
[09:04:04] thejamespinto: it's standalone
[09:04:19] arup_r: has joined #RubyOnRails
[09:04:41] thejamespinto: basldex: so, now that you've seen the Switch Users feature
[09:04:55] thejamespinto: be my guest and give this a mount on a dummy app :) https://github.com/hello-gem/hello
[09:05:42] basldex: thanks, I'll take a closer look at it
[09:06:12] thejamespinto: please send me some feedback with your thoughts
[09:06:36] thejamespinto: we're currently arguing with some changes in the implementation before release
[09:07:42] thejamespinto: and right now we really want people to add votes and opinions
[09:07:56] thejamespinto: but I don't want to bother you with internal sources for now :P
[09:09:04] basldex: I will take a look at the code anyway :)
[09:09:32] thejamespinto: start with the migration files so you don't go crazy >:)
[09:09:41] basldex: heh ok, will do
[09:10:16] tonios57: has joined #RubyOnRails
[09:13:08] yaw: has joined #RubyOnRails
[09:15:08] Linuus: Can I somehow override the values set from a form? Rails does not use the setters for this, right? I have a nested form Foo --{has_many}-> Bar --{belongs_to (polymorphic)}--> Baz. When I edit a Foo, I add a Bar and add a value to a field. When posting I want to override this value. In Bar I tried to just create a setter method, but it is never called... Any ideas?
[09:17:38] blackmesa: has joined #RubyOnRails
[09:18:57] thejamespinto: Linuus: you might be getting the false impression you're using nested forms correctly, if you configure your strong parameters to raise an error if you try to update an invalid field it's gonna be easier to find the problem. Do you want to try that?
[09:19:53] thejamespinto: it's described here https://github.com/rails/strong_parameters#handling-of-unpermitted-keys
[09:19:54] dhjondoh: has joined #RubyOnRails
[09:20:10] thejamespinto: Linuus: go to application.rb and add this -> config.action_controller.action_on_unpermitted_parameters = :raise
[09:21:54] habitullence: Does anyone know why when I drop and create a postgres db it has the same tables in it? :S
[09:22:43] Linuus: thejamespinto: No errors. The attributes are permitted correctly. I just think that Rails never use the setters. Don't they just set all attributes with a hash directly?
[09:23:18] thejamespinto: you can google on how to override model attributes correctly
[09:23:54] thejamespinto: here's how I do it
[09:23:58] nettoweb: has joined #RubyOnRails
[09:24:09] thejamespinto: super(v.to_s.downcase.gsub(' ', ''))
[09:24:11] pawnbox: has joined #RubyOnRails
[09:24:20] annlewis: has joined #RubyOnRails
[09:24:24] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[09:24:44] habitullence: maybe the postgres chan...
[09:24:45] Yakko: !botsnack
[09:24:45] helpa: Nom nom. Thanks, yakko!
[09:24:47] Hates_: !botsnack
[09:24:47] helpa: Nom nom. Thanks, Hates_!
[09:24:54] Yakko: I gotta speak to Ryan about this
[09:24:54] Hates_: habitullence: what tables?
[09:25:27] arup_r: has joined #RubyOnRails
[09:25:28] Hates_: habitullence: you'll probably have a schema_migrations in there
[09:26:00] habitullence: hi Hates_: I drop and then create postgres db from command line and the original databases tables are still there... I'm not using migrations
[09:26:17] habitullence: Noticed my postgres locally does this
[09:26:31] habitullence: It's like postgres is archiving rather than deleting
[09:26:39] Linuus: thejamespinto: Overriding something on the Foo class works (the class I'm editing) but it has accepts_nested_attributes :bar. And it does not use setters to set the attributes on Bar.
[09:26:43] sevenseacat: a) you're not dropping and creating the right db or b) you're looking in the wrong db
[09:27:03] sevenseacat: habitullence: got anything we can see, like some console logs or something?
[09:27:46] thejamespinto: Linuus: oh yes... I don't think it uses the setters for nested :\
[09:28:20] habitullence: seveseacat: the commands are just dropdb ... createdb ... I verify in psql along the way.. I'll dig up the logs. It's freaky weird but my postgres is not amazing.
[09:28:43] Linuus: thejamespinto: Yep. Pretty annoying.
[09:29:13] thejamespinto: here's the sources for that https://github.com/rails/rails/blob/8b26431ba4cec4a5401dd1e5e50c15c11bec0703/activerecord/lib/active_record/attribute_assignment.rb#L23
[09:29:21] Linuus: thejamespinto: I guess I can override bar_attributes=(attrs) in my Foo class or somthing
[09:30:46] Linuus: thejamespinto: That seems to use setters though. https://github.com/rails/rails/blob/8b26431ba4cec4a5401dd1e5e50c15c11bec0703/activerecord/lib/active_record/attribute_assignment.rb#L54
[09:31:10] FailBit: how do you stop spam? we have captchas and require logins, but we still have loads of korean spam getting through
[09:31:18] FailBit: akismet as well
[09:31:19] thejamespinto: yes it does seem to use setters
[09:31:47] thejamespinto: Linuus: couldn't really find the place where it hops to the nested model to run the loop though
[09:32:27] FailBit: I assume that they have defeated the captchas and are using some tool like capybara to figure out how to submit the form
[09:32:47] FailBit: because there's really no better explanation, and now I need a solution
[09:32:51] habitullence: Hates_, sevenseacat: I'd asked on postgres chan as well.. My template1 somehow got screwed up. This could be the fix http://www.depesz.com/2007/08/07/simple-howto-about-restoring-damaged-template1/
[09:33:17] Linuus: thejamespinto: True... I guess that code is not used for nested models
[09:33:26] thejamespinto: oh I get it now
[09:33:30] thejamespinto: it's a bit tricky
[09:33:43] thejamespinto: but yeah, it uses setters inside :(
[09:33:57] thejamespinto: you should be seeing them work fine
[09:34:14] thejamespinto: are you using STI or something like that?
[09:34:46] sevenseacat: well, glad we could help or something.
[09:35:16] Linuus: thejamespinto: No, not using STI
[09:35:21] charliesome: has joined #RubyOnRails
[09:36:01] thejamespinto: Linuus: then it really should be working for you... make a test, add a simple validation and see if it runs
[09:36:02] Linuus: thejamespinto: https://github.com/rails/rails/pull/2945/files They override parrot_attributes
[09:36:13] Linuus: thejamespinto: Yes, I will do that
[09:36:40] thejamespinto: I do anything but debugging :D
[09:37:59] habitullence: sevenseacat: we help each other ;)
[09:39:14] Denarii: has joined #RubyOnRails
[09:43:04] subshad: has joined #RubyOnRails
[09:44:40] Creeves: has joined #RubyOnRails
[09:45:58] pawnbox: has joined #RubyOnRails
[09:49:04] Linuus: thejamespinto: I created a minimal test case, couldn't make it fail... Then I realized I had accepts_nested_attributes_for :bar, reject_if: -> { "bad code that was wrong" }
[09:49:22] Linuus: Removed the reject_if and the setter is indeed called... :D
[09:50:16] Linuus: Stupid code... :P
[09:50:57] thejamespinto: an ant would have remembered that http://static.damnlol.com/i/1520833114733eb1d8f4ff311a73adea.png
[09:53:23] moeabdol: has joined #RubyOnRails
[09:56:02] workmad3_: has joined #RubyOnRails
[09:59:17] ArTiSTiX: has joined #RubyOnRails
[09:59:38] jcromartie: has joined #RubyOnRails
[10:00:25] iszak: has joined #RubyOnRails
[10:00:25] iszak: has joined #RubyOnRails
[10:00:34] jcm: has joined #RubyOnRails
[10:01:26] workmad3_: has joined #RubyOnRails
[10:02:58] mattt: Hi all, i have a model that is using accepts_nested_attributes_for ; this allows me to create two associated resources in a form
[10:03:01] mattt: in the form i allow you to select an existing associated resource or create a new one ... however i need to add a validation to ensure that someone does attempt to do both
[10:03:04] mattt: any suggestions as to how this would be achieved?
[10:03:21] zz_denym_: has joined #RubyOnRails
[10:03:38] chills42: has joined #RubyOnRails
[10:06:40] Ergo: has joined #RubyOnRails
[10:06:50] arup_r: mattt: You can do :) using custom validation
[10:06:56] maz-dev: has joined #RubyOnRails
[10:07:35] arup_r: you will check if inside it .new_record? && .persisted? # id that expr returns true.. then BOOM!!
[10:11:08] mattt: arup_r: hey, long time no speak ! :)
[10:11:09] arup_r: mattt: I was thinking also.. if we know each other.. :) nick is very known.. but the channel is confusing me to claim that "Hey Matt!.. We know each other"
[10:11:09] mattt: arup_r: i tried custom validation, but it looks like the params have already been nested by then
[10:11:09] arup_r: mattt: You resigned from the other channel ? :)
[10:11:35] workmad3_: mattt: or you could do 'validates_associated :association'
[10:11:41] workmad3_: rather than re-inventing the wheel
[10:12:17] arup_r: workmad3_: He don't want to allow both new and existing to update at the same time..
[10:12:48] arup_r: validates_associated how helps.. just asking to understand what I read wrong in the main question.
[10:12:51] mattt: i'm guessing this is probably a front-end fix using javascript, but i'd like to also handle via the model if possible
[10:13:13] workmad3_: arup_r: hmm... ok...
[10:13:47] workmad3_: in that case, I'm not actually sure what an 'attempt to do both' would look like
[10:14:04] arup_r: ACTION puts spectacle back 
[10:14:37] mattt: workmad3_: i have a job and company model, in job i have accepts_nested_attributes_for company
[10:14:57] mattt: workmad3_: in my add a job form, you can select an existing company or add a new one
[10:15:17] workmad3_: mattt: right... and that's a `has_one` or a `belongs_to` association, right?
[10:15:40] mattt: workmad3_: if you select an existing company AND add a new one and then save the job, the job ends up being saved w/ the selected job ... i'd rather it just throw a validation saying you need to do one or the other
[10:15:42] mattt: workmad3_: correct
[10:16:07] workmad3_: mattt: then yeah, you need to handle that entirely with client-side JS
[10:16:27] mattt: ok, thanks workmad3_
[10:16:51] workmad3_: mattt: hmm... or maybe there's a way to do it on the server... would need to see what gets sent
[10:16:53] nikeita: has joined #RubyOnRails
[10:17:39] workmad3_: mattt: but most likely, the last company in the form is all that's getting seen by rails, because `fields_for` for a singular association isn't set up with names that allow for multiple values to be processed
[10:18:13] bruno-: has joined #RubyOnRails
[10:18:35] mattt: workmad3_: if i could validate on the params sent in the controller that would work, but i don't believe i have access to those in the model ... because the object has already been established wiht the params
[10:18:40] relix: has joined #RubyOnRails
[10:19:03] stamina: has joined #RubyOnRails
[10:19:07] workmad3_: mattt: the params processing happens before the controller sees it
[10:19:45] pawnbox: has joined #RubyOnRails
[10:19:46] workmad3_: mattt: so what I'm saying is that the information you're trying to validate on is probably thrown away before your app sees it (once again, this depends on just how you're setting up the form)
[10:19:47] mattt: workmad3_: hmmm, thinking about it, i could probably do something in the controller, but then i run into the situation of not knowing how to throw a similar validation-type error in the controller :P
[10:19:57] pjammer: has joined #RubyOnRails
[10:20:18] mattt: workmad3_: i'll try to gist up some stuff today and re-ask with more information on hand :)
[10:20:20] rickmasta: has joined #RubyOnRails
[10:20:59] workmad3_: mattt: i.e. the place where your app sees the two sets of data is in the browser, indicating you need JS validation, and the inconsistency is thrown away by the time the data is submitted, making the app see a singular view of the world without the error you're wanting to detect
[10:21:11] _lazarevsky: has joined #RubyOnRails
[10:21:22] pawnbox: has joined #RubyOnRails
[10:21:25] _lazarevsky: hell fellow rubiers
[10:21:26] maz-dev: has joined #RubyOnRails
[10:21:29] charliesome: has joined #RubyOnRails
[10:21:30] _lazarevsky: lol hell.. whoops.. freudean slip
[10:21:38] workmad3_: _lazarevsky: s/rubiers/rubyists/
[10:21:44] arup_r: _lazarevsky: ask man
[10:21:57] arup_r: I am excited now here
[10:22:51] _lazarevsky_: has joined #RubyOnRails
[10:22:56] arup_r: Why people use leading or trailing underscores (`_`) with their nicknames ?
[10:23:14] _lazarevsky_: cuz im craving attention
[10:23:28] _lazarevsky_: actually lemme first give you some context
[10:24:38] braincrash: has joined #RubyOnRails
[10:24:45] _lazarevsky_: imagine a table, each row represents a project and each column represents a week (4/1/2015 - 4/8/2015) and so on
[10:24:53] agit0: has joined #RubyOnRails
[10:25:05] annlewis: has joined #RubyOnRails
[10:25:07] _lazarevsky_: I've created an obhect called CalendarWeek which has a start_date, end_date and some other metadata relevant to that project
[10:25:53] _lazarevsky_: my question is, provided I have a cut-off point (project_committed_date), how can I create the correct number of CalendarBlock objects each starting on monday and ending on sunday
[10:26:14] _lazarevsky_: starting from the monday of the current week and ending on the sunday of the week of the project_committed_date
[10:26:33] _lazarevsky_: i'm sure there's some nifty little function in the Date class which does it but I've not been able to find it
[10:26:47] _lazarevsky_: all i'm trying to do is avoid having to write manual code, that's all
[10:27:17] arup_r: _lazarevsky_: begingin_of_the_week and end_of_the_week >
[10:27:48] jcromartie: has joined #RubyOnRails
[10:27:53] _lazarevsky: has joined #RubyOnRails
[10:28:03] _lazarevsky: crap I got d/ced again.. whenever someone mentions my name i get d/ced
[10:28:07] _lazarevsky: plus stop doing it :)
[10:28:31] _lazarevsky: someone replied to my comment saying beginning_of_week end_of_week
[10:28:49] arup_r: me replied
[10:28:54] workmad3_: _lazarevsky: (Date.today.beginning_of_week..project.commited_date).step(7)
[10:29:21] _lazarevsky: workmad3_: wow nice! this is exactly what I was looking for
[10:29:23] arup_r: workmad3_: He got disconnected agin
[10:29:29] arup_r: Ohh! no he is here
[10:29:43] _lazarevsky: workmad3_: well sort of.. I also need to populate start_date and end_date of the CalendarBlock Objects
[10:30:02] _lazarevsky: so I basically need to iterate over the weeks and create a CalendarBlock object
[10:30:03] djbkd: has joined #RubyOnRails
[10:30:13] arup_r: humm kind of
[10:30:15] workmad3_: _lazarevsky: (Date.today.beginning_of_week..project.commited_date).step(7).map{|start_date| CalendarBlock.new(start_date, start_date.end_of_week)} ;)
[10:30:45] _lazarevsky: lemme try that
[10:32:41] codelahoma: has joined #RubyOnRails
[10:32:50] mike___1234: has joined #RubyOnRails
[10:33:05] ereslibre: has joined #RubyOnRails
[10:34:46] _lazarevsky: workmad3_: dude you're a GURU
[10:34:50] _lazarevsky: workmad3_: thanks a million!
[10:35:53] arup_r: _lazarevsky: and me ? :)
[10:36:02] arup_r: just a dev I know :(
[10:37:00] dionysus69: what is this doing really? if params[:wine_type]; params[:wine_type].include?("eu") it doesn't seem to be ternary operator
[10:37:25] _lazarevsky: arup_r: you too :*
[10:37:30] violarium: has joined #RubyOnRails
[10:38:44] arup_r: dionysus69: ugly code
[10:39:12] dionysus69: arup_r: yes and I just copied it and it works so I want to add some functionality and make it perhaps prettier too
[10:39:13] arup_r: ok.. someone wrote ugly way
[10:39:38] dionysus69: it keeps the checked boxes checked after page reload
[10:39:53] arup_r: show more code
[10:40:03] arup_r: that one line is not telling what is is doing
[10:40:24] ericjphillips: has joined #RubyOnRails
[10:40:30] arup_r: it is like if params[:wine_type] is truthy then execute the params[:wine_type].include?("eu")
[10:40:44] chrissonar: has joined #RubyOnRails
[10:40:47] dionysus69: https://gist.github.com/webzorg/3af8ddc2b4eeebf701bc
[10:41:13] arup_r: You write it like params[:wine_type] && params[:wine_type].include?("eu") it is same thing
[10:41:32] dionysus69: my aim is to save state of checked boxes and also the active class on the label, when I check the box it gets active class but after request is sent it becomes inactive again how do I keep it ? :S
[10:41:33] burgestrand: has joined #RubyOnRails
[10:41:34] arup_r: Yes. use what I said
[10:41:56] arup_r: remove the ugly if
[10:42:10] dionysus69: just like you wrote ?
[10:42:14] piotrj: has joined #RubyOnRails
[10:42:23] dionysus69: if params[:wine_type] && params[:wine_type].include?("eu") <<< like that?
[10:42:45] dionysus69: but I its more confusing, it just needs to check if params contains eu
[10:42:50] arup_r: yes.. no if please
[10:43:19] arup_r: <%= check_box_tag "wine_type[]", "hq", params[:wine_type] && params[:wine_type].include?("eu") %>HQ
[10:43:23] arup_r: dionysus69: ^^
[10:43:48] dionysus69: haha cool one sek, also in the previous version the ; was confusing, what was that ; for?
[10:44:02] dionysus69: I dont remember ruby using ; in ternary operator
[10:44:13] arup_r: it is telling ruby parser one lined ended .. next started
[10:44:33] FailBit: ; is statement terminator
[10:44:48] arup_r: ternaery is (: (COLON)) and you have ;(SEMI COLON)
[10:44:50] basldex: has joined #RubyOnRails
[10:45:04] arup_r: dionysus69: better visible ?
[10:45:25] FailBit: ternary is bool_expr ? true_expr : false_expr
[10:45:36] FailBit: same as any other language with it
[10:45:39] arup_r: ys the combo
[10:46:17] dionysus69: yes it was supposed to have colon, and it had semi colon thats what I got confused about :P
[10:47:57] Cervajz_: has joined #RubyOnRails
[10:48:01] alex88_: has joined #RubyOnRails
[10:48:23] dionysus69: ok it works like this too :) so how do I proceed with adding class active to label IF the params contains lets say eu
[10:49:39] arup_r: dionysus69: create a helper method and call it there,,,
[10:49:44] arup_r: inside the view
[10:49:57] arup_r: and inside the helper method check all the shit logics
[10:50:15] Lytol: has joined #RubyOnRails
[10:50:24] dionysus69: yes but how I am noob haha, what do I call the helper where do I put it etc :S
[10:50:36] bronson: has joined #RubyOnRails
[10:50:39] dionysus69: never had experience with helpers
[10:51:45] arup_r: humm do some random Google
[10:51:54] arup_r: you will get to know the connection
[10:52:01] arup_r: it is that easy
[10:52:17] rodfersou: has joined #RubyOnRails
[10:52:20] arup_r: Rails security and caching is hard for me.. I am not able to dominate that part.. :(
[10:53:31] RegulationD: has joined #RubyOnRails
[10:53:40] arBmind: has joined #RubyOnRails
[10:54:04] chills42: has joined #RubyOnRails
[10:55:03] pawnbox: has joined #RubyOnRails
[10:57:31] artto: has joined #RubyOnRails
[10:58:51] mostlybadfly: has joined #RubyOnRails
[10:59:32] pawnbox: has joined #RubyOnRails
[11:02:29] Scripore: has joined #RubyOnRails
[11:04:41] Pavster: has joined #RubyOnRails
[11:05:16] h7br1x: has joined #RubyOnRails
[11:06:12] bonhoeffer: has joined #RubyOnRails
[11:06:15] yaw: has joined #RubyOnRails
[11:07:08] basldex: has joined #RubyOnRails
[11:07:31] basldex: does anybody know an alternative gem for mti? I'm having quite problems with https://github.com/hzamani/active_record-acts_as
[11:08:11] gustav__: has joined #RubyOnRails
[11:08:45] arup_r: basldex: mti full form ?
[11:09:06] Linuus: has joined #RubyOnRails
[11:09:22] moeabdol: has joined #RubyOnRails
[11:09:29] Creeves: has joined #RubyOnRails
[11:09:59] basldex: there seem to be quite a few gems online but many of them look orphaned
[11:11:35] arup_r: basldex: When to use MTI.. I know STI.. Looks like all pencils.. books are kind of product.. Then why went to implement MTI.. Just asking...
[11:11:45] yottanami: has joined #RubyOnRails
[11:11:54] arup_r: instead of STI
[11:12:09] basldex: arup_r, I'm having different attributes but similar behaviour
[11:12:23] basldex: STI would create many nil-ed attributes
[11:12:30] arup_r: ok.. This is the only reason MTI gives you the benefits of STI but without having to place dozens of empty fields into a single table.
[11:12:36] arup_r: ahh I see
[11:13:07] arup_r: basldex: Yes. STI save 3 tables into 1 table.. But MTI saves field and expands to 4 tables..
[11:13:38] rvanlieshout: arup_r: do you even know the consequence of a table or an column?
[11:13:41] basldex: I might rather switch to STI than using some orphaned non-production-ready gem
[11:13:59] arup_r: rvanlieshout: No man! Please teach me..
[11:14:12] arup_r: that is why I am rolling here.......
[11:14:17] rvanlieshout: then why are you using sti?
[11:14:43] arup_r: I do know STI to saves the repeated columns
[11:15:22] rvanlieshout: and you don't have any base in telling if you actually want that?
[11:15:31] arup_r: A model has say N attrs .. which B and C also needed.. But B and C also some extra fields..
[11:15:37] pjammer: has joined #RubyOnRails
[11:15:46] arup_r: and the too keep things in a single place I will go for STI]
[11:16:01] rvanlieshout: but does that make it better?
[11:16:15] arup_r: rvanlieshout: you meant STI ?
[11:16:24] rvanlieshout: in this case yes
[11:16:41] rvanlieshout: or is this using the (wrong) assumption that less tables is better per se
[11:17:19] arup_r: rvanlieshout: I know when to pick up STI.. not the MTI thing
[11:17:36] rvanlieshout: i doubt you do
[11:18:04] rvanlieshout: but you don't know what impact a table or column has
[11:18:05] rvanlieshout: on your db engine
[11:18:07] rvanlieshout: so you can't know
[11:18:18] rvanlieshout: you know that it has one table and not four
[11:18:22] rvanlieshout: but you don't know if that's even better
[11:18:25] rvanlieshout: it's just a lower number
[11:18:25] arup_r: Yes that is a level I need time to go
[11:18:48] tvw: has joined #RubyOnRails
[11:18:48] rvanlieshout: and that's not something you'll be at in a week or two
[11:18:59] arup_r: I don't know the trade off between saving columns and tables
[11:19:02] FailBit: can anyone recommend something to stop botspam
[11:19:11] FailBit: captchas are broken, changing the form doesn't work
[11:19:14] rvanlieshout: what's the trade off?
[11:19:16] Macaveli: has joined #RubyOnRails
[11:19:37] FailBit: IPs are too dynamic....
[11:19:42] FailBit: hmm, could try geoip
[11:19:50] pawnbox: has joined #RubyOnRails
[11:19:51] rvanlieshout: FailBit: i've read about that some people created porn sites to display fetched captchas from gmail so some random user will give them the answer
[11:19:54] pwnd_nfsw: FailBit, "what iz 2 plus 2????" type verification?
[11:19:55] yottanami: I got this error during capistrano deploy http://dpaste.com/1QVW8AF How can I find out why this is happening?
[11:20:01] arup_r: should I expand to multiple tables to save lots of blank fields.. or should I keep all fields in a same table and use only one table
[11:20:10] rvanlieshout: arup_r: what's bad about a blank field?
[11:20:15] pwnd_nfsw: rvanlieshout, we used to do that back in the day for a game called Runescape
[11:20:28] FailBit: pwnd_nfsw: yeah that's not gonna cut it because I assume they are getting someone to click buttons
[11:20:33] rvanlieshout: yottanami: that's not an error
[11:20:33] arup_r: unused space ( guessing )
[11:20:36] basldex: yottanami, that's too few log lines
[11:20:42] FailBit: changing the form itself doesn't work
[11:20:48] pwnd_nfsw: A chinese sweatshop that specializes in solving captchas
[11:20:49] FailBit: so that or they use capybara/variant
[11:20:51] rvanlieshout: arup_r: so either give yourself a few weeks to learn the basics of db storage or quit using sti
[11:20:54] rvanlieshout: without a good reason
[11:21:26] arup_r: rvanlieshout: You meant MTI is good over STI ? I will give some weeks myself man!
[11:21:43] basldex: depends on the requirements
[11:21:45] dici: has joined #RubyOnRails
[11:21:49] basldex: no general answer here
[11:21:50] rvanlieshout: arup_r: it's really not that easy
[11:21:58] arup_r: basldex: Yes.. that is what I am trying to understand
[11:22:21] rvanlieshout: arup_r: so read about db storage
[11:22:24] blackmesa: has joined #RubyOnRails
[11:23:14] rvanlieshout: empty columns to use some space, but using STI creates spaghetti.. balance them
[11:23:23] absklb: has joined #RubyOnRails
[11:23:24] pawnbox: has joined #RubyOnRails
[11:24:28] basldex: rvanlieshout, what do you use for STI?
[11:24:36] basldex: any gem or self written?
[11:24:41] rvanlieshout: i don't use STI
[11:24:41] absklb: in canvas lms, i have course_progress model. that model has one def in_progress . can i do @in_progress=CourseProgress.in_progress in my users_controller so that i can then dispplay that variable in my users_dashboard.html.erb which is renderd by users_controller?
[11:24:46] absklb: currently it gives me error
[11:24:48] basldex: rvanlieshout, errr, MTI, sorry
[11:25:15] absklb: yeah, STI sounded so muc like......
[11:25:25] rvanlieshout: i try to avoid inheritance.. and that seems to work
[11:25:55] annlewis: has joined #RubyOnRails
[11:26:10] yottanami: basldex, rvanlieshout : Here is full output http://dpaste.com/0FXHZ5P and here is my Gemfile http://dpaste.com/0E78S5G
[11:26:28] rvanlieshout: yottanami: Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
[11:26:32] basldex: Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
[11:26:37] basldex: that's quite straight forward, isn't it?
[11:26:46] basldex: also commit Gemfile.lock
[11:27:00] rvanlieshout: what's in your database.conf on the server?
[11:27:12] yottanami: rvanlieshout, Yes I know the error but I have pg in gemfile
[11:27:22] Axilla: can someone tell me what a leading _file.scss does exactly in stylesheet file names?
[11:27:28] Axilla: i can't seem to find anything on it.
[11:27:40] arup_r: axilla: that is a partial
[11:27:44] rvanlieshout: yottanami: could you paste the full output of your cap deploy? and is gemfile.lock in version control?
[11:27:47] yottanami: rvanlieshout, database.conf do you mean database.yml ? where is database.conf?
[11:27:49] arup_r: SCSS use this concept
[11:27:50] syath: has joined #RubyOnRails
[11:27:51] Axilla: right, but what's its purpose in a stylesheet?
[11:28:00] rvanlieshout: yottanami: euh.. yml indeed, but if that should be postgres then it's ok
[11:28:09] Axilla: what does it accomplish is what i'm asking :)
[11:28:23] rvanlieshout: axilla: it means nothing.. some devs use it to mark it as a partial or private
[11:28:29] rvanlieshout: it's nothing different from any other file
[11:28:39] Axilla: rvanlieshout: right so stylesheets that don't belong to a controller
[11:28:40] arup_r: axilla: You can create partial Sass files that contain little snippets of CSS that you can include in other Sass files. .... http://sass-lang.com/guide
[11:28:47] Axilla: that seems to be whats going on here, ok thanks!
[11:29:01] rvanlieshout: axilla: there is no 'so' in this one.. it's just a personal preference
[11:29:08] cajone: has joined #RubyOnRails
[11:29:10] arup_r: axilla: reusing stuff...
[11:29:21] Axilla: yea makes sense, i just wondered if it was serving another purpose
[11:29:24] arup_r: But I don;t resue.. I duplicate CSS :)
[11:29:25] Axilla: i had never used it myself.
[11:29:33] Axilla: i like the concept.
[11:29:34] yottanami: rvanlieshout, Yes gemfile.lock in version controll but I do bundle install in Production END before deploy
[11:29:42] Axilla: i did this, just never used the naming structure
[11:29:57] Axilla: guess would be no different than putting them in folders like i do now.
[11:30:02] yottanami: rvanlieshout, here is gemfile.lock http://dpaste.com/0GW5BH6
[11:30:15] charliesome: has joined #RubyOnRails
[11:30:24] rvanlieshout: yottanami: bundle install yourself or using the proper tasks?
[11:30:27] arup_r: axilla: Your goal is to send the CSS to browser.. that is it
[11:30:31] rvanlieshout: that run bundle install --deployment --without development test
[11:30:38] Axilla: of course :) i just like to know why's
[11:30:39] arup_r: Now how you will.. it is upto you..
[11:30:55] rvanlieshout: yottanami: and check the full output. that error is most likely presented before a bundle install or new code
[11:30:58] Axilla: and the only way I could get my head around rails in the beginning was to learn what the "magic" was doing
[11:31:11] Axilla: so if there is some magic i'm not aware of i like to know.
[11:31:20] arup_r: that is good
[11:31:36] ericjphillips: has joined #RubyOnRails
[11:31:38] absklb: in canvas lms, i have course_progress model. that model has one def in_progress . can i do @in_progress=CourseProgress.in_progress in my users_controller so that i can then dispplay that variable in my users_dashboard.html.erb which is renderd by users_controller?
[11:31:41] yottanami: rvanlieshout, I do bundle install myself and I think capistrano tasks will bundle install on server
[11:31:55] rvanlieshout: yottanami: could you paste the full output?
[11:32:13] yottanami: rvanlieshout, It seems it does not install gems in production group
[11:32:17] rvanlieshout: absklb: perform a @in_progress = CourseProgress.in_progress in your users controller
[11:32:25] rvanlieshout: or use CourseProgress.in_progress directly in the view
[11:32:53] yottanami: rvanlieshout, or maybe it is deploying on development!
[11:33:05] rvanlieshout: the output will tell you :)
[11:33:13] yottanami: rvanlieshout, sure let me share full output, before see the database.yml http://dpaste.com/1MVY5CM
[11:33:19] FailBit: spam! spam! spam! spam! spam! spam! spam!
[11:33:38] rvanlieshout: FailBit: /quit will help you solve that
[11:33:49] FailBit: I could quit life
[11:33:51] absklb: rvanlieshout: ok
[11:34:36] pjammer: has joined #RubyOnRails
[11:34:38] ruurd: has joined #RubyOnRails
[11:36:52] kalusn: has joined #RubyOnRails
[11:37:17] nartes: has joined #RubyOnRails
[11:38:40] ldnunes: has joined #RubyOnRails
[11:40:09] jbrinkmusic: can somebody help me... I don't understand why my partial is rendered twice
[11:40:24] jbrinkmusic: here's the relevant code: http://pastie.org/private/1anmva1e6ausf0cifviedq
[11:40:32] Kallis: has joined #RubyOnRails
[11:41:03] yottanami: rvanlieshout, Here is full output http://dpaste.com/0FVSM1N and here is database http://dpaste.com/1MVY5CM
[11:42:55] rvanlieshout: yottanami: weird.. you might want to run all those commands yourself to see if it actually used the right Gemfile.lock
[11:44:14] yottanami: rvanlieshout, You mean I should run those commands? How should I run commands and what are commands? because I can not find out the commands from output
[11:45:15] atomical: has joined #RubyOnRails
[11:46:10] rvanlieshout: the commands are listed in that output
[11:46:29] rvanlieshout: any line with Running ... as web@...
[11:47:13] yottanami: rvanlieshout, for example what is this: Running /usr/bin/env [ -d ~/.rbenv/versions/2.2.2 ] as
[11:47:34] rvanlieshout: something you can run
[11:47:37] rvanlieshout: it doesn't do anything
[11:48:09] yottanami: rvanlieshout, Should I set gemfile.lock in .gitignore/
[11:48:12] stardiviner: has joined #RubyOnRails
[11:48:13] pawnbox: has joined #RubyOnRails
[11:49:16] yottanami: rvanlieshout, Is anyway to check server is on development env or production?
[11:49:28] yottanami: I think bundle ins installed as development on server
[11:51:13] arup_r: has joined #RubyOnRails
[11:51:28] bronson: has joined #RubyOnRails
[11:51:44] rvanlieshout: don't assume things
[11:51:47] yottanami: rvanlieshout, I checked Gemfile on server is different from local
[11:51:47] AugustoCesar: has joined #RubyOnRails
[11:51:51] rvanlieshout: just run those commands and find out
[11:52:03] rvanlieshout: doesn't capistrano delete the folder on failed deployment?
[11:52:05] rvanlieshout: or is that capistrano 2
[11:53:12] arup_r1: has joined #RubyOnRails
[11:53:39] yottanami: rvanlieshout, It is cap 3
[11:54:02] rvanlieshout: yeah, so if that release-folder still exists you could just run bundle as capistrano does and check the output
[11:54:05] VaibhavRajput: has joined #RubyOnRails
[11:54:07] rvanlieshout: if you leave out the --quit
[11:54:48] yottanami: rvanlieshout, Is it correct way to do Bundle instll in Production env on my machine and then run cap deploy command?
[11:55:28] burgestrand: has joined #RubyOnRails
[11:55:33] rvanlieshout: look at the output of that deployment
[11:55:39] rvanlieshout: it runs bundle the correct way there
[11:55:46] rvanlieshout: only without output
[11:55:48] absklb: rvanlieshout: it gives error.
[11:56:43] rvanlieshout: the capistrano log doesn't contain error for the bundle command
[11:56:54] yottanami: rvanlieshout, so if I run bundle install on server manually will it find to run as production not development?
[11:57:18] absklb: rvanlieshout: not for that. accesing variable of another model in another controller
[11:57:31] nya: has joined #RubyOnRails
[11:57:34] rvanlieshout: yottanami: if you run it in the same way capistrano does
[11:58:12] IceyEC: has joined #RubyOnRails
[11:58:55] yottanami: rvanlieshout, you mean like this: /.rbenv/bin/rbenv exec bundle install --path /home/web/www/sms_api/shared/bundle --without development test --deployment
[12:00:24] mrmylanman: has joined #RubyOnRails
[12:00:53] defsdoor: has joined #RubyOnRails
[12:01:18] DoubleMalt: has joined #RubyOnRails
[12:02:44] quazimodo: has joined #RubyOnRails
[12:03:14] codenapp_: has joined #RubyOnRails
[12:05:12] stannard: has joined #RubyOnRails
[12:05:29] maz-dev: has joined #RubyOnRails
[12:09:37] blackmesa: has joined #RubyOnRails
[12:10:10] pawnbox: has joined #RubyOnRails
[12:10:34] bbrowning: has joined #RubyOnRails
[12:10:34] emilkarl: has joined #RubyOnRails
[12:10:42] nzst: has joined #RubyOnRails
[12:11:40] emilkarl: I would like to setup a father children relationship that includes siblings. How should I set up the siblings relationship through father? http://pastie.org/10448130
[12:12:03] emilkarl: Should I use source: or something?
[12:12:16] pydave6367: has joined #RubyOnRails
[12:13:04] codenapper: has joined #RubyOnRails
[12:13:23] rvanlieshout: emilkarl: has_many :siblings, through: :fater implies that person.siblings == father.iblings
[12:13:36] rvanlieshout: i would create a separate model for sibling
[12:13:40] rvanlieshout: or separate relationship
[12:14:04] rvanlieshout: cause one could say siblings = anybody with same father, but that's not always the case
[12:14:43] _el_fer_: has joined #RubyOnRails
[12:15:01] krisquigley: has joined #RubyOnRails
[12:15:18] unreal_: has joined #RubyOnRails
[12:17:07] dionysus69: is there a cloud platform that lets you execute rails and see what html it outputs?
[12:17:17] rvanlieshout: dionysus69: heroku?
[12:17:32] dionysus69: haha i meant thats too slow
[12:17:37] jbrinkmusic: or Cloud9 for development
[12:17:39] dionysus69: i could do same on localhost
[12:18:24] dionysus69: just like w3school where you have window devided into two parts, in one part you write html and then click on run or something and then it shows the output on the right side
[12:18:30] dionysus69: is there anything like that for rails?
[12:18:35] sevenseacat: dionysus69: your rails console?
[12:18:51] nzst: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[12:19:11] rvanlieshout: dionysus69: or just for erb or haml?
[12:19:16] dionysus69: hmm ye maybe thats a good idea :D never used it except of once for creating a test object
[12:19:43] rvanlieshout: so leave the rails part and google for an online erb template visualisor ish
[12:20:10] dionysus69: hmm yes I guess that was something i was looking for thanks :)
[12:20:31] jbrinkmusic: have any of you ever dealt with a problem when a partial is rendering twice?
[12:22:43] arup_r1: jbrinkmusic: we can debug with you ?
[12:23:40] pawnbox_: has joined #RubyOnRails
[12:23:44] yottanami: arup_r_, What do you use for ENV var on production deploy?
[12:24:29] maz-dev: has joined #RubyOnRails
[12:24:36] arup_r1: dotenv** grm
[12:24:59] yottanami: arup_r_, You mean you upload your .env on sever?
[12:25:36] arup_r1: Yes. But not in Github..
[12:26:07] arup_r1: you need to keep those physically ... otherwise how things will happened
[12:26:10] arup_r1: you need to keep those physically ... otherwise how things will happen
[12:26:15] Macaveli: has joined #RubyOnRails
[12:26:41] annlewis: has joined #RubyOnRails
[12:26:56] jbrinkmusic: arup_r_: this is my code: http://pastie.org/private/1anmva1e6ausf0cifviedq
[12:27:23] jbrinkmusic: and it renders the _comment partial twice
[12:27:47] arup_r1: yes because @message.comments is 2
[12:27:53] _el_fer_: you have 2 comments
[12:28:19] arup_r1: u r using shorthand render ..., collection: ...
[12:28:23] _el_fer_: you should loop comments inside the partial
[12:28:39] arup_r1: _el_fer_: Why loop
[12:28:48] arup_r1: that is fine. what he has now
[12:29:01] saimancroy: has joined #RubyOnRails
[12:29:27] jbrinkmusic: I only have one comment but it renders it again with an empty comment.content
[12:29:35] _el_fer_: but wouldnt he want to show the two comments anyway?
[12:30:29] jbrinkmusic: and on posts with no comments it shows the empty comment as well
[12:30:54] sevenseacat: don't build an empty comment?
[12:32:11] arup_r1: _el_fer_: then @message.comments.first(2) is enough
[12:32:12] jbrinkmusic: sevenseacat: do you mean I should do a @message.comments.each instead and add the wrapping html outside the partial?
[12:32:34] sevenseacat: why are you adding an empty comment to @message.comments
[12:33:47] jbrinkmusic: sevenseacat: I can't see where... I thought I only had a wrapper in _comment and it should show each comment in "comment.content"
[12:33:53] emilkarl: has joined #RubyOnRails
[12:34:04] sevenseacat: jbrinkmusic: you mean you don't have a @message.comments.build in your controller?
[12:34:10] sevenseacat: ACTION raises an eyebrow
[12:35:49] jbrinkmusic: sevenseacat: my controller currently looks like this: http://pastie.org/private/jluf1u1atby4szpscxqv4a
[12:35:52] Peteykun: has joined #RubyOnRails
[12:36:24] Cervajz_: has joined #RubyOnRails
[12:36:33] jbrinkmusic: wait, wrong one
[12:36:34] emilkarl: rvanlieshout: in this case it will always be the case.
[12:36:44] emilkarl: than a fathers children will be the childrens siblings
[12:36:49] sevenseacat: ok, so you're not, but your message definitely has two comments then - why shouldnt they both render?
[12:37:15] jbrinkmusic: http://pastie.org/private/any9f2xb1svx8q8roh54ow
[12:37:34] jbrinkmusic: that's the comments controller
[12:37:38] rvanlieshout: emilkarl: ok.. then a plain has_many :siblings, class person, conditions where father id is same
[12:37:44] jbrinkmusic: my rails console only shows one comment
[12:37:58] sevenseacat: what code are you running in your rails console?
[12:38:20] Lytol: has joined #RubyOnRails
[12:38:23] KorriX: Hello! Why sprockets directives are not parsed in CoffeeScript files other than application.js?
[12:38:28] emilkarl: hmm k so not has_many :siblings, through: :father, class_name: 'User'. source: :children
[12:39:02] jbrinkmusic: http://pastie.org/private/un2pj7asg9eo1wxx47lc8g
[12:39:12] jkamenik: has joined #RubyOnRails
[12:39:20] bkulbida: has joined #RubyOnRails
[12:39:22] emilkarl: ok has_many :children, -> Proc.new { where father_id: self.father_id }
[12:39:29] emilkarl: something like that maybe
[12:39:44] rvanlieshout: has many :sibling, class_name: 'Child', with that proc
[12:40:06] sevenseacat: jbrinkmusic: instead of piece by piece, can you just gist everything? the logs, the output, etc.
[12:40:27] sevenseacat: because atm there's no evidence of a problem
[12:40:34] sevenseacat: just you saying there is
[12:42:45] VaibhavRajput: How to check if the file is locked or not in ruby?
[12:42:56] rvanlieshout: VaibhavRajput: locked for what?
[12:43:36] VaibhavRajput: rvanlieshout, locked with File.open(path).flock(File::LOCK_EX)
[12:44:23] tknz: has joined #RubyOnRails
[12:45:29] VaibhavRajput: I have multiple thread which read and write into the file. I want each thread to write it and read it. in this snippet http://douglasfshearer.com/2011/02/13/threadsafe-file-consistency-in-ruby.html. at a time only one thread can write it. other thread will just ignore it if file is locked by some other thread.
[12:46:29] burgestrand: has joined #RubyOnRails
[12:47:11] VaibhavRajput: I wanted to make sure that each thread should perform read and write. so to do this I wanted to check if file is locked or not and if it is locked then retry after some times.
[12:47:21] VaibhavRajput: ^ any suggestions?
[12:47:43] jbrinkmusic: sevenseacat: here's a picture of the problem: http://ibin.co/2HCoNfHadrdZ
[12:47:59] sevenseacat: I guess that's a no
[12:48:24] jbrinkmusic: I don't understand what you're asking
[12:48:30] Cyberheb: has joined #RubyOnRails
[12:49:06] Cyberheb: has joined #RubyOnRails
[12:49:26] yaw: has joined #RubyOnRails
[12:49:45] Cyberheb: has joined #RubyOnRails
[12:50:10] Cyberheb: has left #RubyOnRails: ()
[12:50:57] kalusn: has joined #RubyOnRails
[12:51:13] _el_fer_: has joined #RubyOnRails
[12:52:10] sevenseacat: can you gist the logs, the output HTML, so we can see whats going on
[12:52:26] bronson: has joined #RubyOnRails
[12:52:35] jbrinkmusic: sevenseacat: do you mean the javascript error logs?
[12:52:48] sevenseacat: no, the logs from your Rails server
[12:52:49] jbrinkmusic: or server logs?
[12:54:20] gustav__: has joined #RubyOnRails
[12:54:25] RegulationD: has joined #RubyOnRails
[12:55:22] bbrowning: has joined #RubyOnRails
[12:55:32] dionysus69: are all helpers loaded in all views by default?
[12:56:03] emilkarl: I can get this proc conditions right??? http://pastie.org/10448196
[12:56:10] sandstrom: has joined #RubyOnRails
[12:57:04] dstarh: has joined #RubyOnRails
[12:57:32] Hydro-x1: has joined #RubyOnRails
[12:57:37] Hydro-x1: has left #RubyOnRails: ()
[12:57:37] moeabdol: has joined #RubyOnRails
[12:58:01] VaibhavRajput: rvanlieshout, anything for me?
[12:58:47] Hates__: has joined #RubyOnRails
[12:59:42] rvanlieshout: VaibhavRajput: oh. i was away for a while. are you able to fetch the lock status from within something like bash?
[13:00:25] VaibhavRajput: lock status from where to fetch?
[13:00:56] VaibhavRajput: I mean how to fetch it from bash.
[13:01:03] VaibhavRajput: I am doing it right now.
[13:01:35] beauby: has joined #RubyOnRails
[13:01:39] rvanlieshout: it's a file system lock
[13:01:44] rvanlieshout: i would expect it to be a .. ^
[13:02:48] slayerjain: has joined #RubyOnRails
[13:02:59] VaibhavRajput: is there any ruby way to check it?
[13:03:06] jbrinkmusic: sevenseacat: I managed to get a white screen from creating a gist
[13:03:31] rvanlieshout: VaibhavRajput: well. are you able to check them using bash?
[13:03:34] rvanlieshout: cause it's a filesystem thing
[13:03:39] jbrinkmusic: will take a bit longer than anticipated
[13:03:47] rvanlieshout: i think you'll need a method in getting filesystem locks
[13:03:52] rvanlieshout: that's not ruby related to start with
[13:04:34] VaibhavRajput: okay. will see.
[13:04:48] bmurt: has joined #RubyOnRails
[13:06:23] slayerjain: has joined #RubyOnRails
[13:06:38] victortyau: has joined #RubyOnRails
[13:07:18] CanTonic: has joined #RubyOnRails
[13:08:10] dionysus69: i am stuck :\ trying to add active class to the label that is wrapping checkbox item, the thing in my case is that when checkbox is being pushed label becomes active but also the form gets submitted and that for label means that it forgets that it's active, how do I make it save state ? for example I save the state of checked boxes on each form submit https://gist.github.com/webzorg/c37a463b60448fd85b12 heres the 2 files
[13:08:58] emilkarl: rvanlieshout: i got it adding the conditions but it includes an extra ???people_id??? which seems strange? http://pastie.org/10448212
[13:09:24] rvanlieshout: emilkarl: well. the has many relates it to the current object
[13:09:47] rvanlieshout: or just create a def siblings
[13:09:58] emilkarl: i could just do that....
[13:10:01] emilkarl: probably better
[13:10:59] emilkarl: and easier and more readable
[13:12:27] moeabdol: has joined #RubyOnRails
[13:12:48] dionysus69: how do I call a method from within quote marks inside class here ? <%= label_tag nil, class: "btn btn-primary" do%>
[13:13:08] Peteykun: has joined #RubyOnRails
[13:13:18] rvanlieshout: dionysus69: ?
[13:14:01] dionysus69: i have a method test for example in a helper and I want to call it from within class: "" so if something is true it inserts extra class inside
[13:14:06] dhjondoh: has joined #RubyOnRails
[13:14:09] dionysus69: and if false returns nothing
[13:14:16] rvanlieshout: class: my_method
[13:14:22] rvanlieshout: class "btn btn-primary #{my_method}"
[13:14:32] ramortegui: has joined #RubyOnRails
[13:14:40] dionysus69: #{} yes that was what i was looking for thanks :)
[13:15:12] dionysus69: i am weak on ruby too, thats my problem
[13:16:24] absklb: how can i authenticate when doin curl REST api testing?
[13:16:38] jmignault: has joined #RubyOnRails
[13:16:39] slayerjain: has joined #RubyOnRails
[13:18:11] jbrinkmusic: sevenseacat: https://gist.github.com/jBrinkMusic/ac9f6025d73673f081ef
[13:18:24] shpoont: has joined #RubyOnRails
[13:19:12] jbrinkmusic: sevenseacat: comments start on line 216 in the html
[13:23:38] sevenseacat: jbrinkmusic: so what comment is populating the comment form above your comments display?
[13:23:52] _el_fer_: has joined #RubyOnRails
[13:23:59] sevenseacat: your very initial posting of messages/show was apparently very incomplete
[13:24:27] gustav__: has joined #RubyOnRails
[13:25:51] Hates_: has joined #RubyOnRails
[13:26:06] jbrinkmusic: sevenseacat: that form comes from a different _form partial and only has a simple_form_for block
[13:26:26] sevenseacat: yes, and what comment populates the form, because its a simple_form_for a comment instance, right?
[13:27:06] jbrinkmusic: it should build a new comment, not an existing comment populating it
[13:27:14] sevenseacat: please just answer the questionnnnn
[13:27:22] annlewis: has joined #RubyOnRails
[13:27:25] sevenseacat: if you cant answer the question, just gist the form
[13:27:42] dionysus69: do I have this method setup correctly? even if there are no params it returns active in all cases, I want it to not to return anything if the statement is wrong
[13:27:42] dionysus69: do I have this method setup correctly? even if there are no
[13:27:48] dionysus69: https://gist.github.com/webzorg/7de128c80d9987c91169
[13:28:11] jbrinkmusic: sevenseacat: https://gist.github.com/jBrinkMusic/ac9f6025d73673f081ef#file-_form-html-erb
[13:28:18] mhib: has joined #RubyOnRails
[13:28:21] sevenseacat: [20:34:03] sevenseacat: jbrinkmusic: you mean you don't have a @message.comments.build in your controller?
[13:28:32] sevenseacat: I was slightly incorrect, its in your form instead :P
[13:28:45] Agis-: has joined #RubyOnRails
[13:29:13] sevenseacat: so that builds an empty comment and adds it to @message.comments
[13:29:30] jbrinkmusic: okay, is there a way around this?
[13:29:48] sevenseacat: don't build an empty comment and add it to @message.comments? why are you doing that?
[13:30:07] absklb: what is the way other than Curls to test REST API so that i wont run on not compatibble sssl error?
[13:30:16] jbrinkmusic: sevenseacat: I'm following a tutorial on YouTube and the instructor did just that :P
[13:30:32] atomical: you need build if you are using it in a form
[13:30:54] sevenseacat: sure, but you dont need to build a comment for that @message
[13:31:38] sevenseacat: Comment.new would work just fine
[13:32:14] jbrinkmusic: then how do I get the comment associated with the message?
[13:33:23] jbrinkmusic: sevenseacat: I was under the impression that I need to do this because my "comment" is a nested resource
[13:33:28] sevenseacat: your controller does that
[13:33:38] sevenseacat: when it does @message.comments.build
[13:34:46] Hates__: has joined #RubyOnRails
[13:35:41] jbrinkmusic: sevenseacat: thank you... it works now, which I guess is the most important part... I still don't quite understand why but I guess it'll sink in eventually :P
[13:36:50] blackmesa: has joined #RubyOnRails
[13:37:33] piotrj: has joined #RubyOnRails
[13:37:40] dionysus69: I want if params[:wine_type].include?(wine_type_var) do not to return true false but return whatever I put in the block following if statement, this evaluates to true false :|
[13:38:47] defsdoor: dionysus69, is that a helper ?
[13:39:05] Lytol: has joined #RubyOnRails
[13:39:13] defsdoor: you really want to return nil if that isnt true ?
[13:39:21] raunicolae: has joined #RubyOnRails
[13:39:34] defsdoor: then you have to test for nil in your view ?
[13:39:40] dionysus69: in case of true I have a string that it should return but instead it returns true/false in both cases
[13:40:15] defsdoor: your undetrstanding of ruby is lacking
[13:40:26] dionysus69: well the way its written it doesnt let me have a block at all, this if statement is written in a weird way
[13:40:28] defsdoor: nothing is connecting your test to your return
[13:40:32] voltalio: has joined #RubyOnRails
[13:40:37] greengriminal: has joined #RubyOnRails
[13:40:39] GreatDanton: has joined #RubyOnRails
[13:40:46] defsdoor: so do return "active" if params[:wine_type] && params[:wine_type].include?(wine_type_var2)
[13:41:02] defsdoor: personally I would be consistent in my return types
[13:41:13] dionysus69: this is what i have https://gist.github.com/webzorg/748571c0462095eea609
[13:41:24] defsdoor: and do ( params[:wine_type] && params[:wine_type].include?(wine_type_var2) ) ? "active" : ""
[13:41:43] raunicolae: has left #RubyOnRails: ()
[13:41:51] dionysus69: hmm ok i ll try the first syntax
[13:41:58] defsdoor: you making this up as you go along ?
[13:42:01] dionysus69: there are so many ways to write if that its confusing :D
[13:43:11] dionysus69: return "active" if ... that solution is enough
[13:43:14] theblang: has joined #RubyOnRails
[13:43:41] dionysus69: it was just weird why this syntax didnt work:
[13:43:41] dionysus69: if params[:wine_type] && params[:wine_type].include?(wine_type_var2) do puts "active" end
[13:44:18] voltalio: has joined #RubyOnRails
[13:44:24] rvanlieshout: dionysus69: it's not really weird
[13:44:32] rvanlieshout: puts uses STDOUT
[13:44:47] rvanlieshout: did you look at the stdout channel of your server?
[13:45:03] dionysus69: what is that??
[13:45:06] dionysus69: what is stdout :D ?
[13:45:14] maz-dev: has joined #RubyOnRails
[13:45:17] rvanlieshout: the standard output channel of a process
[13:45:28] rvanlieshout: and it's not the html that rails returns to the request :)
[13:45:31] dionysus69: no i dont know how to check that or even if I could what should I expect
[13:46:01] dionysus69: so the syntax I used, if I used return instead of puts it would work?
[13:46:12] dionysus69: that is basic way to write if and I dont get why it didnt work
[13:46:35] rvanlieshout: if you expect it to be the return statement of that method, yes
[13:47:39] defsdoor: dionysus69, give your methods some though
[13:48:48] _el_fer_: has joined #RubyOnRails
[13:48:52] defsdoor: a helper method that returns a string to be shown in a view ought to return a string always
[13:49:04] Schwartz: has joined #RubyOnRails
[13:49:10] defsdoor: otherwise you might have to testing for nil in your views and that sucks
[13:49:18] pawnbox: has joined #RubyOnRails
[13:50:46] krz: has joined #RubyOnRails
[13:52:17] dionysus69: has joined #RubyOnRails
[13:53:16] bronson: has joined #RubyOnRails
[13:55:49] RTG`: has joined #RubyOnRails
[13:56:20] arup_r: has joined #RubyOnRails
[13:56:22] Uranio-235: has joined #RubyOnRails
[13:57:22] devdazed: has joined #RubyOnRails
[13:57:59] Lincee: has joined #RubyOnRails
[14:03:45] arup_r: I am here.. no needt to be panicked :)
[14:04:35] yottanami: I deployed my web app using capistrano, here is my route file http://dpaste.com/27KREXT now I open http://XXX.XXX.XXX.XX:6023/api/v1/message/send url I got 404 Not Found
[14:04:35] yottanami: nginx/1.8.0
[14:05:11] sadaf2605: has joined #RubyOnRails
[14:05:59] paulcsmith: has joined #RubyOnRails
[14:07:33] Detch: has joined #RubyOnRails
[14:08:20] dionysus69: defsdoor so you mean that in the case of false I should return empty string?
[14:09:00] stannard: has joined #RubyOnRails
[14:09:11] FelipeBHZ: has joined #RubyOnRails
[14:09:38] umgrosscol: has joined #RubyOnRails
[14:09:40] gustav__: has joined #RubyOnRails
[14:09:51] arup_r: may be url is not proper
[14:10:16] RegulationD: has joined #RubyOnRails
[14:10:18] arup_r: yottanami:
[14:10:49] arup_r: if you sure your url is proper check the HTTP verb is correct or not
[14:11:15] cornerma1: has joined #RubyOnRails
[14:12:47] yottanami: arup_r, What do you mean by url is not proper? how should I check?
[14:12:52] defsdoor: has joined #RubyOnRails
[14:12:53] fryguy9: has left #RubyOnRails: ()
[14:13:17] sypheren: has joined #RubyOnRails
[14:13:25] fryguy: has joined #RubyOnRails
[14:13:30] yottanami: arup_r, in my route http://dpaste.com/27KREXT I have `root to: redirect('docs/api')` it will redirect but show 404 after redirect!
[14:14:33] gustav__: has joined #RubyOnRails
[14:16:56] idd2d: has joined #RubyOnRails
[14:17:19] Lincee: has joined #RubyOnRails
[14:17:19] chills42: has joined #RubyOnRails
[14:19:08] arup_r: yes.. check the log ... it has more details
[14:19:15] arup_r: or show us the log in gist
[14:19:59] youngbaks: has joined #RubyOnRails
[14:20:07] Scriptonaut: has left #RubyOnRails: ()
[14:21:29] sarink: has joined #RubyOnRails
[14:22:45] bruno-: has joined #RubyOnRails
[14:23:24] Zarthus: has joined #RubyOnRails
[14:24:20] Cervajz_: has joined #RubyOnRails
[14:25:13] smathy: has joined #RubyOnRails
[14:26:26] dopie: has joined #RubyOnRails
[14:28:08] annlewis: has joined #RubyOnRails
[14:29:24] hashrocket: has joined #RubyOnRails
[14:29:37] simplesoon: has joined #RubyOnRails
[14:30:31] simplesoon: has joined #RubyOnRails
[14:31:20] nfk: has joined #RubyOnRails
[14:34:20] slayerjain: has joined #RubyOnRails
[14:34:50] drptbl_: has joined #RubyOnRails
[14:36:09] pawnbox_: has joined #RubyOnRails
[14:36:27] yottanami: arup_r, https://gist.github.com/yottanami/6b635c86a5974fe92436
[14:36:44] yottanami: here is access.log and remote.log what other files needs?
[14:36:53] simplesoon: 5.0 has switched from using constants for mime_types in favor of a hash. If a user needs to unregister and reregister in order to add additional mime_type_synonyms, the default JSON param parser gets orphaned since its key of Mime::Type[:JSON] got replaced. Can anyone think of a better way to add mime_type_synonyms without clobbering the default params parser?
[14:37:13] smathy_: has joined #RubyOnRails
[14:37:38] Hates_: has joined #RubyOnRails
[14:38:49] cih_: has joined #RubyOnRails
[14:39:49] stardiviner: has joined #RubyOnRails
[14:40:52] rickmasta: has joined #RubyOnRails
[14:41:04] tubbo: simplesoon: that's interesting, i didn't know anything about that
[14:41:14] tubbo: simplesoon: how do you set mime types in rails 5?
[14:42:21] mdel: has joined #RubyOnRails
[14:43:12] simplesoon: same way. through intializers/mime_types.rb.
[14:43:23] simplesoon: Mime::Type.unregister :json
[14:43:27] simplesoon: Mime::Type.register 'application/json', :json, mime_types
[14:43:50] simplesoon: where mime_types is your new array of mime_types you want associated with :json
[14:44:56] RegulationD: has joined #RubyOnRails
[14:44:57] tubbo: oh that's neat
[14:45:22] tubbo: not sure why you'd want multiple handlers for a template, or how which handler gets picked..
[14:45:31] tubbo: s/which/each
[14:46:40] simplesoon: I???m working on a versioned api which requires me to add application/vnd.app.v1+json
[14:51:06] mary5030: has joined #RubyOnRails
[14:53:15] slayerjain: has joined #RubyOnRails
[14:53:26] ereslibre: has joined #RubyOnRails
[14:54:48] simplesoon: has joined #RubyOnRails
[14:54:49] Caius: has joined #RubyOnRails
[14:55:53] tubbo: simplesoon: that's...not how you version APIs. could cause problems with clients not meant to receive that mime-type.
[14:56:09] tubbo: at least, i've never heard of people versioning APIs that way
[14:57:07] Ropeney: has joined #RubyOnRails
[14:57:20] simplesoon: it???s similar to how github api handles it. AFAIK
[15:01:08] Uranio-238: has joined #RubyOnRails
[15:03:38] Peteykun: has joined #RubyOnRails
[15:03:40] EiN_: has left #RubyOnRails: ()
[15:04:41] EminenceHC: has joined #RubyOnRails
[15:06:18] dionysus69: i can override bootstrap css from the html.erb file directly but not from application.scss.erb, what am I doing wrong?
[15:07:26] VaibhavRajput: has joined #RubyOnRails
[15:09:17] rushed: has joined #RubyOnRails
[15:12:14] bg1: has joined #RubyOnRails
[15:12:45] EminenceHC: has joined #RubyOnRails
[15:14:33] chouhoulis: has joined #RubyOnRails
[15:15:08] chouhoulis: has joined #RubyOnRails
[15:16:42] qejk: has joined #RubyOnRails
[15:16:51] chouhoulis: has joined #RubyOnRails
[15:18:18] bg1: has joined #RubyOnRails
[15:18:47] arup_r: best way to define routes for self joins.. like when comment has many comments
[15:23:58] tubbo: arup_r: comments are comments, it doesn't matter what their threading is
[15:24:27] tubbo: arup_r: for example, look at reddit...you can't tell what the parent or child comments are by the URL
[15:24:31] arup_r: I did it like resources :comments do
[15:24:31] arup_r: resources :comments , shallow: true
[15:24:54] tubbo: so now you have a comment_comment_path? :P
[15:24:57] tubbo: that's ridiculous
[15:25:13] Joufflu: has joined #RubyOnRails
[15:25:23] arup_r: can I rename it ?
[15:25:55] arup_r: inner one is reply .. basically
[15:25:57] roxtrongo: has joined #RubyOnRails
[15:26:01] arup_r: can I rename it ?
[15:26:01] sandstrom: has joined #RubyOnRails
[15:26:10] tubbo: arup_r: are your comments just single-threaded? so if i reply to you, you can't reply back to me?
[15:26:36] MEATCHICKEN: has joined #RubyOnRails
[15:26:40] arup_r: means I have to do that way
[15:26:47] tubbo: arup_r: but what i mean is...what prevents this route from just being /comments/1/comments/2/comments/3/comments/4?
[15:26:50] tubbo: you know what i mean?
[15:26:58] tubbo: it's just...i don't see the point of that
[15:27:02] arup_r: yes.. no it single level
[15:27:18] arup_r: It is just a single level
[15:27:18] Lytol: has joined #RubyOnRails
[15:27:35] arup_r: comment can have reply.. reply don't have reply again for now
[15:27:44] tubbo: arup_r: well i suppose you could call it replies, but i still don't see the point. if it's all going to the same controller and the same model and just adding a possible parent comment, there's really no reason for having two routes
[15:27:50] MEATCHICKEN: Is there a way to check children attributes in a query? For example -> Retrieve all Foo where Foo.bars.boolean = true
[15:28:26] arup_r: ok.. tubbo doing it like that.. so that I can send the parent comment id while replying
[15:28:47] smathy: meatchicken, Foo.where bars: { boolean: true }
[15:28:56] smathy: ...err, Foo.joins(:bars).where....
[15:29:00] annlewis: has joined #RubyOnRails
[15:29:14] tubbo: sure meatchicken, http://guides.rubyonrails.org/active_record_querying.html#specifying-conditions-on-eager-loaded-associations
[15:29:48] tubbo: arup_r: why can't you just send it as a hidden field in the form?
[15:30:05] MEATCHICKEN: smathy: That is still finding Foos that have bars with boolean false
[15:30:17] MEATCHICKEN: tubbo: already looked at that. might be an issue on my end
[15:30:21] arup_r: I will render it using Ajax remote: true with link_to
[15:30:31] arup_r: that will render the form
[15:30:35] tubbo: meatchicken: !gist the code you're working with
[15:30:35] helpa: meatchicken: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[15:32:05] MEATCHICKEN: tubbo: The entire model?
[15:32:25] tubbo: meatchicken: probably just the line(s) of code that are causing you trouble
[15:32:30] piotrj: has joined #RubyOnRails
[15:33:07] EminenceHC: has joined #RubyOnRails
[15:33:23] cschneid_: has joined #RubyOnRails
[15:33:54] MEATCHICKEN: https://gist.github.com/anonymous/81c31cd55024f5732ff4
[15:33:58] MEATCHICKEN: It should work
[15:34:02] MEATCHICKEN: I checked the query as well
[15:34:20] arup_r: can I tell a resources method which controller to point ?
[15:34:21] MEATCHICKEN: Yet when I examine the returned object - it has child records with false
[15:34:32] tubbo: meatchicken: try surrounding that in a lambda.. scope :open, -> { joins(:hotels).where(hotels: { open: true }) }
[15:34:51] tubbo: arup_r: yeah, you can do resources :replies, controller: 'comments'
[15:35:40] arup_r: they don't say all such things
[15:35:41] arup_r: http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/Resources.html#method-i-resources
[15:36:06] arup_r: should I keep still shallow true
[15:36:08] herbst: has joined #RubyOnRails
[15:36:26] disgrntld: has joined #RubyOnRails
[15:36:54] rickmasta: has joined #RubyOnRails
[15:37:09] tubbo: meatchicken: what does the actual SQL query look like? is it being generated correctly?
[15:37:15] MEATCHICKEN: arup_r: http://guides.rubyonrails.org/routing.html#specifying-a-controller-to-use
[15:37:32] tubbo: meatchicken: oh...replace joins with includes, i think that does a RIGHT join rather than a LEFT OUTER join or whatever i don't care i hate joins ;)
[15:37:33] umgrosscol: has joined #RubyOnRails
[15:37:37] tubbo: but yeah...one of those tow
[15:37:54] johnflux: has joined #RubyOnRails
[15:37:55] arup_r: meatchicken: Hum. Not all in same place... here an there.. ugly kind
[15:38:01] sarink: has joined #RubyOnRails
[15:38:11] maz-dev: has joined #RubyOnRails
[15:38:16] MEATCHICKEN: arup_r: maybe contribute a change to the docs to clean it up :P
[15:38:41] arup_r: no I am making myself also ugly ... then no issues
[15:38:57] arup_r: meatchicken: I once asked it.. they didn't convince
[15:39:11] arup_r: I will show you the github link.. where I asked..
[15:39:18] arup_r: that is I didn't make any pull
[15:41:01] hahuang65: has joined #RubyOnRails
[15:41:08] MEATCHICKEN: tubbo: no can do
[15:41:09] MEATCHICKEN: https://gist.githubusercontent.com/anonymous/514294f395d940a5c292/raw/89fa8f3074b95d1278829323251473c03d2cb86c/gistfile1.txt
[15:41:11] MEATCHICKEN: really strange
[15:41:22] MEATCHICKEN: It looks about right to me but I'm no sql expert
[15:42:06] tubbo: meatchicken: seems legit
[15:43:07] mwlang: has joined #RubyOnRails
[15:43:24] rickmasta: has joined #RubyOnRails
[15:43:32] _djbkd: has joined #RubyOnRails
[15:43:53] michaeldeol: has joined #RubyOnRails
[15:43:55] mwlang: are any of the newer WYSIWYG html editers worth considering or is CkEditor and TinyMCE still the considered ???go-tos????
[15:44:37] AzaToth: has joined #RubyOnRails
[15:44:42] tubbo: i'd consider any editor over tinymce or ckeditor purely on the grounds of being able to set it up
[15:44:59] GreatDanton: has joined #RubyOnRails
[15:45:54] mwlang: tubbo: huh? both are easy to set up???the only challenging part is the image/file uploading parts.
[15:47:39] brendan-: has joined #RubyOnRails
[15:47:55] benlieb: has joined #RubyOnRails
[15:49:27] lipoqil: Is there some simple way to start to play with Rails 5?
[15:50:45] Lytol: has joined #RubyOnRails
[15:50:47] tubbo: lipoqil: define "simple"...you can always do gem 'rails', github: 'rails/rails' in your Gemfile to load wherever rails 5 is right now
[15:51:08] [Butch]: has joined #RubyOnRails
[15:51:30] sar1nk: has joined #RubyOnRails
[15:51:38] lipoqil: tubbo: That is simple enough for me ;) But there is no branch for i Rails 5?
[15:51:57] tubbo: lipoqil: since it hasn't been released yet, 'master' branch is the branch for rails 5.
[15:52:40] ryan_000: has joined #RubyOnRails
[15:52:57] Spami: has joined #RubyOnRails
[15:53:54] lipoqil: tubbo: Ok, thx
[15:54:01] Scriptonaut: has joined #RubyOnRails
[15:54:04] simplesoon: has left #RubyOnRails: ()
[15:54:43] ngscheurich: has joined #RubyOnRails
[15:55:07] bronson: has joined #RubyOnRails
[15:57:41] lipoqil: tubbo: Ok, some simpler way ;) https://files.app.net/7n5rvGfER.jpg
[15:58:20] Cervajz_: has joined #RubyOnRails
[15:58:45] jkamenik1: has joined #RubyOnRails
[15:58:58] acti0nman: has joined #RubyOnRails
[16:00:17] ruurd: has joined #RubyOnRails
[16:00:38] EminenceHC: has joined #RubyOnRails
[16:01:58] pawnbox: has joined #RubyOnRails
[16:02:54] tubbo: lipoqil: you gotta run bundle update
[16:03:22] lipoqil: tubbo: Same thing
[16:05:24] bricker: has joined #RubyOnRails
[16:06:55] cnk: has joined #RubyOnRails
[16:07:18] agent_white: has joined #RubyOnRails
[16:07:21] agent_white: has left #RubyOnRails: ()
[16:07:56] maz-dev: has joined #RubyOnRails
[16:08:15] sarink: has joined #RubyOnRails
[16:08:42] blackmesa: has joined #RubyOnRails
[16:08:58] liquid-silence: has joined #RubyOnRails
[16:09:12] DLSteve: has joined #RubyOnRails
[16:10:25] srinidhi: has joined #RubyOnRails
[16:12:03] voltalio: has joined #RubyOnRails
[16:12:33] Cervajz: has joined #RubyOnRails
[16:13:34] dionysus69: has joined #RubyOnRails
[16:16:07] G40ST: has joined #RubyOnRails
[16:16:13] youngbaks: has joined #RubyOnRails
[16:16:24] G40ST: So, this is rails :??
[16:18:44] G40ST: has joined #RubyOnRails
[16:18:50] theery: has joined #RubyOnRails
[16:18:52] Maletor: has joined #RubyOnRails
[16:19:24] tubbo: ^ best evar
[16:20:21] Maletor: has joined #RubyOnRails
[16:23:14] bronson: has joined #RubyOnRails
[16:24:07] towski_: has joined #RubyOnRails
[16:24:24] G40ST: How can I connect a rails web app with parse?
[16:24:49] slash_nick: G40ST: what's parse?
[16:25:38] G40ST: Parse its a cloud service, like heroku
[16:26:55] chipotle: has joined #RubyOnRails
[16:27:39] Macaveli: has joined #RubyOnRails
[16:27:45] tubbo: G40ST: well you could search for a parse api client for ruby, then include that in your gemfile
[16:28:07] G40ST: I need to connect a database from parse with a 'rails web', so I don't know if I need another host.
[16:29:12] hamster88: has joined #RubyOnRails
[16:29:39] annlewis: has joined #RubyOnRails
[16:29:43] G40ST: Well, i'll do that.
[16:32:08] pyreal: has left #RubyOnRails: ()
[16:32:18] arup_r: has joined #RubyOnRails
[16:32:30] arup_r: nvm got it
[16:32:41] hamster88: I am trying to use elasticsearch + searchkick. I am not able to get the search form working.
[16:33:06] hamster88: here is my gist. I would really appreciate any help >> https://gist.github.com/thedesignable/89c4ee72bd593af16ebe
[16:34:54] jtb__: has joined #RubyOnRails
[16:36:24] hamster88: the parameters do change, but it's not giving the right search results, like if i search by a tag say "test" or a post title named "victor" it list all the posts instead of showing the search keyword post. only.
[16:36:37] EminenceHC: has joined #RubyOnRails
[16:37:25] herbst: has joined #RubyOnRails
[16:39:53] h7br1x: has joined #RubyOnRails
[16:42:23] smathy: hamster88, looks like you're getting your :search and :query params mixed up.
[16:43:09] smathy: hamster88, the text_field_tag is named :search, and yet in your controller you're checking `if params[:query].present?`
[16:43:25] fmcgeough: has joined #RubyOnRails
[16:43:40] AnomalousBit: has joined #RubyOnRails
[16:43:45] hamster88: smathy umm but my params are set to query..
[16:43:48] artto: has joined #RubyOnRails
[16:44:30] smathy: hamster88, not sure what that means, https://gist.github.com/thedesignable/89c4ee72bd593af16ebe#file-navbar-html-erb-L3 shows your `text_field_tag :search` that :search is the name of the field in the form, so in your controller the value of that will be `params[:search]`
[16:46:02] hamster88: smathy, i did changed the params to search but that still didnt worked, just throwing all the posts instead of just the search results
[16:46:06] smathy: hamster88, actually, you have `name: "nil"` as one of the options, so in fact it will be params[:nil] in your controller.
[16:46:30] Gustavo: has joined #RubyOnRails
[16:46:56] marcusalmeida: has joined #RubyOnRails
[16:47:56] marcusalmeida: hi guys. Is it possible to acess ActionView instance on Helper?
[16:48:22] smathy: marcusalmeida, view_context
[16:48:31] marcusalmeida: I need to access an instance of actionView on helper's method
[16:48:43] hamster88: not this doesn't makes sense i am getting this > undefined method `paginate' for #<Searchkick
[16:48:52] chills42: has joined #RubyOnRails
[16:49:22] smathy: hamster88, update your gist with the code you have now.
[16:49:46] andy888: has joined #RubyOnRails
[16:49:49] petricore: has joined #RubyOnRails
[16:51:28] mxrguspxrt: has joined #RubyOnRails
[16:51:35] marcusalmeida: smathy: view_context couldn't be accessed on view helper
[16:51:42] andy888: hi there, have a question on jquery datatables rails gem. I have installed it and should have been working in my rails 4 app. but the tables still do not look as nice as I try in normal jquery outside of rails
[16:52:18] andy888: this is the after jquery datatables ==> http://imgur.com/QYUl9Tn
[16:52:33] hamster88: smathy, alright updated it
[16:52:42] andy888: and this is the before ==> http://imgur.com/YfZemeW
[16:53:11] smathy: marcusalmeida, sorry, I misunderstood. What are you actually trying to do?
[16:53:29] smathy: marcusalmeida, you want to access the view instance to add some content to it?
[16:53:31] ryan_000: has joined #RubyOnRails
[16:53:41] paulcsmith: has joined #RubyOnRails
[16:54:11] momomomomo: has joined #RubyOnRails
[16:54:37] marcusalmeida: smathy: I want to access ActionView instance to pass a liquid template render
[16:56:25] smathy: marcusalmeida, why not just render the liquid template directly?
[16:56:38] smathy: marcusalmeida, = render "path/to/partial.liquid"
[16:57:21] moeabdol: has joined #RubyOnRails
[16:57:21] marcusalmeida: smathy: cause i will need to prepend_view_path for template liquid
[16:57:36] marcusalmeida: smathy: and that template are in other project
[16:57:54] _lazarevsky: has joined #RubyOnRails
[16:58:03] _lazarevsky: I have a Project Model
[16:58:05] EminenceHC: has joined #RubyOnRails
[16:58:11] smathy: hamster88, ok, so the Searchkick object is returned by Post.search - and apparently that doesn't have the pagination methods available on it.
[16:58:11] _lazarevsky: Project has_many project_blocks
[16:58:35] _lazarevsky: a project_block a ProjectBlock has a start_date and end_date
[16:59:02] _lazarevsky: I wanna create a scope to only load a particular set of the children blocks depending on the timeframe provided
[16:59:06] _lazarevsky: wanna do something like
[16:59:16] stannard_: has joined #RubyOnRails
[16:59:30] _djbkd: has joined #RubyOnRails
[16:59:34] _lazarevsky: actually.. I am not sure what the code would look like
[16:59:46] skullcrasher_: has joined #RubyOnRails
[17:00:23] annlewis: has joined #RubyOnRails
[17:00:51] workmad3_: _lazarevsky: well, do you want to load ProjectBlock instances where their time range overlaps a given timeframe, or is contained within a timeframe?
[17:00:55] smathy: hamster88, assuming that Searchkick just proxies to the corresponding ElasticSearch object, then you need to do a little more than that for pagination in search results: https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-model#pagination
[17:01:07] kitsuneyo: has joined #RubyOnRails
[17:01:28] _lazarevsky: workmad3_: where it's contained within a given timeframe
[17:01:46] _lazarevsky: im in the index method of the Projects Controller
[17:01:56] smathy: marcusalmeida, ok, so take a look at the concat method: http://devdocs.io/rails/actionview/helpers/texthelper#method-i-concat That's how to add a string to the existing view inside a helper.
[17:02:00] wldcordeiro_: has joined #RubyOnRails
[17:02:09] workmad3_: _lazarevsky: ok, so that would be a .where(start_date: first_date..last_date, end_date: first_date..last_date)
[17:02:46] smathy: I think he wanted a scope on Project not ProjectBlock workmad3_
[17:02:49] _lazarevsky: if the 'page' query param is not present then load only the ProjectBlocks for Today.date.beginning_of_week until 3.months.from_now.end_of_week
[17:02:51] workmad3_: _lazarevsky: i.e. where both start_date and end_date of the project block are BETWEEN the start and end of the date-range given
[17:03:12] bufferino: has joined #RubyOnRails
[17:03:20] _lazarevsky: workmad3_: sounds like it should be a scope, no?
[17:03:33] _lazarevsky: a scope on the Project model
[17:03:47] mices: has joined #RubyOnRails
[17:04:15] tenderlove: has joined #RubyOnRails
[17:04:15] workmad3_: _lazarevsky: sounds like it should be a scope with 2 params on the ProjectBlock model to me, and then maybe a method on project that gives those two specific values
[17:05:16] _lazarevsky: huh? I assumed I should create a scope on the Project model called filtered_blocks
[17:05:50] workmad3_: _lazarevsky: e.g. `def self.within(start_date, end_date); where(start_date: start_date..end_date, end_date: start_date..end_date); end` on ProjectBlock, then `def upcoming_blocks; project_blocks.within(Date.current.beginning_of_week, 3.months.from_now.end_of_week; end`
[17:06:05] raunicolae: has joined #RubyOnRails
[17:06:38] zpe: has joined #RubyOnRails
[17:06:49] workmad3_: _lazarevsky: a scope on Project would always return projects, not project blocks
[17:06:58] greengriminal: has joined #RubyOnRails
[17:07:12] tejasmanohar: has joined #RubyOnRails
[17:08:43] _lazarevsky: workmad3_: could I may ask you to format your code.. I am finding it difficult to follow.. didnt know one could use ; in ruby..
[17:08:44] voltalio: has joined #RubyOnRails
[17:08:45] workmad3_: _lazarevsky: you could create a class method that looks very similar to a scope, that would return you project blocks within your time-range, limited to some subset of projects... but that would likely cause you a lot of confusion, as it would essentially break rules around chainable scopes
[17:09:17] workmad3_: _lazarevsky: bah, I was being lazy and not wanting to gist it :P just replace all `;` with newlines ;)
[17:10:05] raunico3: has joined #RubyOnRails
[17:10:30] _lazarevsky: workmad3_: on ProjectBlock.. what is that?
[17:10:35] maz-dev: has joined #RubyOnRails
[17:10:53] workmad3_: _lazarevsky: not part of the code
[17:11:09] _lazarevsky: workmad3_: https://gist.github.com/anonymous/8797041678a0f353342e
[17:11:36] michaeldeol: has joined #RubyOnRails
[17:11:40] ericjphillips: has joined #RubyOnRails
[17:11:48] _lazarevsky: workmad3_: like so? Ok. Now remember, I'm in the Projects Controller's index method
[17:12:06] blackmesa: has joined #RubyOnRails
[17:12:11] workmad3_: _lazarevsky: right... so I'd expect it to be fairly clear, given the amount of time you've been using rails now, and the context we've been talking in, that the first method should go in your ProjectBlock class, and the second method should go in your Project class :P
[17:12:23] zpe: has joined #RubyOnRails
[17:12:46] _lazarevsky: workmad3_: yupp
[17:12:49] _lazarevsky: it's been a long day
[17:12:55] _lazarevsky: totally missed it
[17:12:58] stannard: has joined #RubyOnRails
[17:14:07] mwlang: I just added the ckeditor_rails gem and set up a form to use it and it works in development. I deploy with capistrano and I watched it generate fingerprinted versions of all the ckeditor files (and verified they???re present in the current deploy). However, I???m seeing 404 on all the ckeditor files. The actual request: ???GET config.js?t=E5OD??? but the actual fingerprinted name is:
[17:14:07] mwlang: config-337b4a5604252cf138d69f1f80563eab32020b500cb0d958c4de9cecc77d4fb8.js
[17:14:13] mwlang: what???s going on?
[17:14:54] pragmatism: has joined #RubyOnRails
[17:15:29] wldcordeiro_: has joined #RubyOnRails
[17:16:00] _lazarevsky: workmad3_: oh sorry man.. never used anything like this before.. never had to filter out dependencies
[17:16:05] _lazarevsky: once I filter the Projects list
[17:16:14] _lazarevsky: do I call upcoming_blocks on each individual project before returning the array?
[17:16:45] darutoko-: has joined #RubyOnRails
[17:17:32] arup_r: not able to save comment due to some error https://gist.github.com/aruprakshit/00d22be3105de26c461b
[17:18:11] TomyLobo: has joined #RubyOnRails
[17:18:18] smathy: mwlang, how did you include the config.js in your project?
[17:18:24] Megatomte: has joined #RubyOnRails
[17:18:28] arup_r: no idea what this mean `assign_user' for #<Comment:0x11e2d6a8> ?
[17:18:58] mwlang: smathy: like the docs say to with: ???#= require ckeditor-jquery???
[17:19:13] pragmatism: has joined #RubyOnRails
[17:19:23] rromanch_: has joined #RubyOnRails
[17:19:48] Megatomte: Hi! I am trying to use Activerecord #find_in_batches with uuids, but that obviously does not work. Is there any reason why it does not use .order? https://github.com/rails/rails/blob/b3f5d3c7b2589da45c09aa2a716be10a8213510d/activerecord/lib/active_record/relation/batches.rb#L222
[17:19:49] workmad3_: _lazarevsky: `upcoming_blocks` is now a method on Project that you can call where you need it... if you want, you can also add the method like this: https://gist.github.com/workmad3/52733f7fefef7a0c3186
[17:20:24] workmad3_: _lazarevsky: which, as you can see, gives you the ability to short-cut the N+1 query otherwise generated in your index method by using the `include` eager-load mechanism
[17:20:44] slayerjain: has joined #RubyOnRails
[17:20:52] _lazarevsky: I can serialize that!
[17:21:28] _lazarevsky: need to do code refactoring
[17:21:34] _lazarevsky: could think of at least 2 places where I could use that
[17:22:41] workmad3_: _lazarevsky: double-check it works first... I'm fairly confident you can use a scope on the target class in a has_many lambda like that, but it's worth double-checking as this is code written directly into gist
[17:22:41] slayerjain: has joined #RubyOnRails
[17:22:52] kitsuneyo: has joined #RubyOnRails
[17:23:16] _lazarevsky: workmad3_: is it possible to parameterise the has_many lambda?
[17:23:31] Netun0: has joined #RubyOnRails
[17:23:35] paulcsmith: has joined #RubyOnRails
[17:23:48] workmad3_: _lazarevsky: no, has_many doesn't support that
[17:24:33] workmad3_: _lazarevsky: you'd need to use a normal instance method then, and you'd lose the eager-load capabalities
[17:24:39] slayerjain: has joined #RubyOnRails
[17:24:47] workmad3_: sometimes you need to though... and you can still serialise it fairly easily
[17:25:02] arup_r: any idea why the error is coming
[17:25:37] _lazarevsky: workmad3_: cool lemme try this code now
[17:25:47] _lazarevsky: workmad3_: I hope it serializes to JSON properly
[17:25:56] _lazarevsky: I think it will cuz you added the className: ProjectBlock
[17:26:01] workmad3_: you just need to seralise in a more manual way, or branch out into something like AM:S or full-blown jbuilder templates :)
[17:26:07] kitsuneyo: has joined #RubyOnRails
[17:28:19] havenwood: has joined #RubyOnRails
[17:28:34] lxsameer: has joined #RubyOnRails
[17:29:17] nettoweb: has joined #RubyOnRails
[17:30:11] dionysus69: has joined #RubyOnRails
[17:30:29] slayerjain: has joined #RubyOnRails
[17:31:21] ahmgeek: has joined #RubyOnRails
[17:32:14] ahmgeek: I am having an error while sending mails from production server: https://gist.github.com/ahmgeek/8609edbf35c858665aed
[17:32:22] ahmgeek: work locally pretty fine
[17:32:41] ahmgeek: the port locally is 587
[17:32:59] ahmgeek: tried to change it to 20, 26, 25 but never worked.
[17:36:09] andrew9184: has joined #RubyOnRails
[17:37:01] smathy: mwlang, from the code, the only time config.js should be requested from the precompiled is if you created it in app/assets/javascripts/ckeditor/config.js.coffee
[17:37:14] johnflux: has joined #RubyOnRails
[17:37:37] youngbaks: has joined #RubyOnRails
[17:37:38] smathy: mwlang, it's for a custom config.
[17:37:38] johnflux_: has joined #RubyOnRails
[17:37:38] johnflux_: has joined #RubyOnRails
[17:37:43] arup_r: smathy: can you tell from where the assign_user is coming ? I have comment belongs_to user
[17:37:48] samuelkadolph: has joined #RubyOnRails
[17:37:49] arup_r: why the error..
[17:37:51] mwlang: smathy: I thought it odd that???s requesting individual files and not a one-shot digested file.
[17:37:57] arup_r: Never saw such an error
[17:38:00] iateadonut: has left #RubyOnRails: ()
[17:38:09] johnflux_: has joined #RubyOnRails
[17:38:31] mwlang: smathy: also see ???GET editor_gecko.css?t=E5OD??? and ???GET en.js?t=E5OD???
[17:38:48] johnflux_: has joined #RubyOnRails
[17:38:48] johnflux_: has joined #RubyOnRails
[17:39:11] johnflux_: has joined #RubyOnRails
[17:39:11] johnflux_: has joined #RubyOnRails
[17:39:29] liquid-silence: has joined #RubyOnRails
[17:39:43] johnflux_: has joined #RubyOnRails
[17:39:43] johnflux_: has joined #RubyOnRails
[17:39:55] alex88: has joined #RubyOnRails
[17:40:22] johnflux_: has joined #RubyOnRails
[17:40:46] johnflux: has joined #RubyOnRails
[17:40:47] mwlang: smathy wait, I think I???m onto the right track now??? ???TypeError: i[e] is undefined??? is showing up in the console, so perhaps I???m missing a prerequisite jquery require directive.
[17:40:58] tvw: has joined #RubyOnRails
[17:41:06] _lazarevsky: workmad3_: that worked beautifully!
[17:41:16] samuelkadolph: has joined #RubyOnRails
[17:41:17] johnflux: has joined #RubyOnRails
[17:41:18] johnflux: has joined #RubyOnRails
[17:41:18] _lazarevsky: workmad3_: only flipside is that I will need to have to parametarise it
[17:41:28] _lazarevsky: I will need to have to*
[17:41:44] _lazarevsky: wow.. maybe it's better if I went home and slept it all off
[17:41:56] johnflux: has joined #RubyOnRails
[17:42:05] slayerja_: has joined #RubyOnRails
[17:42:14] hardtail: has joined #RubyOnRails
[17:42:21] johnflux_: has joined #RubyOnRails
[17:42:52] johnflux: has joined #RubyOnRails
[17:43:19] _lazarevsky: workmad3_: got it.. I can parametarise upcoming_blocks
[17:43:30] johnflux: has joined #RubyOnRails
[17:43:30] johnflux: has joined #RubyOnRails
[17:43:50] _lazarevsky: and just say self.project_blocks = project_blocks.within(start_date, end_date)
[17:43:54] johnflux_: has joined #RubyOnRails
[17:43:54] johnflux_: has joined #RubyOnRails
[17:44:00] _lazarevsky: thanks a million!
[17:44:14] samuelkadolph: has joined #RubyOnRails
[17:44:26] johnflux: has joined #RubyOnRails
[17:44:27] johnflux: has joined #RubyOnRails
[17:45:04] johnflux: has joined #RubyOnRails
[17:45:04] johnflux: has joined #RubyOnRails
[17:45:20] smathy: arup_r, add your models to the gis.
[17:45:28] johnflux: has joined #RubyOnRails
[17:45:32] arup_r: nvm fixed it,..
[17:45:46] arup_r: smathy: there in model had wrong code
[17:45:57] smathy: Figured :)
[17:45:58] arup_r: not added by me..
[17:45:59] johnflux: has joined #RubyOnRails
[17:45:59] johnflux: has joined #RubyOnRails
[17:46:08] arup_r: my team mate added
[17:46:19] yaymukund: has joined #RubyOnRails
[17:46:23] arup_r: :) so I was not getting what is wrong in between
[17:46:39] johnflux: has joined #RubyOnRails
[17:47:02] johnflux: has joined #RubyOnRails
[17:47:34] johnflux_: has joined #RubyOnRails
[17:48:13] johnflux_: has joined #RubyOnRails
[17:48:27] banjara: has joined #RubyOnRails
[17:48:36] johnflux_: has joined #RubyOnRails
[17:48:37] mwlang: ugh???I was working with 4.4.2 version of ckeditor??? I was under the false impression that when I start new projects and put a gem in Gemfile and gem install it, I pick up the latest versions from rubygems, not the newest installed version on my system. :-o
[17:48:44] mwlang: ACTION lives and learns
[17:48:47] banjara: has joined #RubyOnRails
[17:48:47] johnflux_: has joined #RubyOnRails
[17:49:00] arup_r: mwlang: 0/
[17:49:08] smathy: mwlang, heh, cool.
[17:49:08] johnflux_: has joined #RubyOnRails
[17:49:29] ruurd: has joined #RubyOnRails
[17:49:29] mwlang: deploying???3 - 4 minutes to compile assets. :-/
[17:49:47] johnflux_: has joined #RubyOnRails
[17:49:47] johnflux_: has joined #RubyOnRails
[17:50:11] johnflux: has joined #RubyOnRails
[17:50:11] johnflux: has joined #RubyOnRails
[17:50:42] johnflux: has joined #RubyOnRails
[17:50:43] johnflux: has joined #RubyOnRails
[17:51:17] youngbak1: has joined #RubyOnRails
[17:51:22] johnflux: has joined #RubyOnRails
[17:51:46] johnflux: has joined #RubyOnRails
[17:51:46] johnflux: has joined #RubyOnRails
[17:51:48] blackmesa: has joined #RubyOnRails
[17:52:17] johnflux: has joined #RubyOnRails
[17:52:57] johnflux: has joined #RubyOnRails
[17:53:14] arooni: has joined #RubyOnRails
[17:53:21] johnflux_: has joined #RubyOnRails
[17:53:52] johnflux: has joined #RubyOnRails
[17:54:29] johnflux: has joined #RubyOnRails
[17:54:29] johnflux: has joined #RubyOnRails
[17:54:52] slayerjain: has joined #RubyOnRails
[17:54:53] johnflux_: has joined #RubyOnRails
[17:54:53] johnflux_: has joined #RubyOnRails
[17:55:19] kalusn: has joined #RubyOnRails
[17:55:24] johnflux_: has joined #RubyOnRails
[17:55:24] johnflux_: has joined #RubyOnRails
[17:55:27] workmad3_: mwlang: do you mean when you add to your Gemfile and run `bundle install`, not `gem install`?
[17:55:43] mwlang: workmad3_: yes
[17:55:46] workmad3_: mwlang: if so then yeah... bundler has always picked up locally installed gems if they satisfy dependencies
[17:56:00] smathy: Yeah, I think as long as the gem is satisfied - with `bundle` it'll use it.
[17:56:04] johnflux_: has joined #RubyOnRails
[17:56:04] johnflux_: has joined #RubyOnRails
[17:56:16] mwlang: if you happen to have a gem installed to system, then bundle inside your new projects picks up the latest gem you happen to have installed systemwide.
[17:56:27] johnflux_: has joined #RubyOnRails
[17:56:41] workmad3_: mwlang: yeah, as long as it satisfies the dependency graph
[17:56:59] johnflux: has joined #RubyOnRails
[17:57:25] mwlang: makes sense???I just got caught off guard on that one???been doing a lot of new project starts where I don???t happen to have the gems installed, yet.
[17:57:38] johnflux: has joined #RubyOnRails
[17:57:40] jobewan: has joined #RubyOnRails
[17:57:46] mwlang: so was getting used to getting the latest with simple addition to Gemfile.
[17:57:47] EminenceHC: has joined #RubyOnRails
[17:57:54] baweaver: has joined #RubyOnRails
[17:58:02] johnflux: has joined #RubyOnRails
[17:58:54] smathy: Yep, definitely something to be aware of.
[17:58:55] havenwood: has joined #RubyOnRails
[17:59:15] sleungcy: has joined #RubyOnRails
[18:00:22] mwlang: new problem: to get localization working, I made the assets/ckeditor/config.coffee.erb with: https://gist.github.com/mwlang/0dc13e41430805512fbc
[18:00:29] mwlang: works fine if I stop and restart the rails app.
[18:00:41] mwlang: but doesn???t work just reloading page with new locale.
[18:00:43] Cervajz: has joined #RubyOnRails
[18:01:52] Lytol: has joined #RubyOnRails
[18:02:37] slayerja_: has joined #RubyOnRails
[18:04:28] _djbkd: has joined #RubyOnRails
[18:07:07] fgold: has joined #RubyOnRails
[18:07:54] smathy: mwlang, the ERB will only be evaluated when the asset is compiled, it won't change on each request.
[18:08:29] slayerjain: has joined #RubyOnRails
[18:08:29] smathy: mwlang, you probably want to put that logic in a app/views/ file, so it's evaluated on each request.
[18:08:30] mwlang: smathy: figured that out about 5 minutes ago. :-p Trying to find a dynamic solution like in a document ready call.
[18:08:40] manfrin: has joined #RubyOnRails
[18:08:41] smathy: ...or yeah, that.
[18:10:24] workmad3_: mwlang: a quick bit of googling surfaced https://github.com/nicolai86/rails-asset-localization which you may finde useful
[18:11:43] krisquigley: has joined #RubyOnRails
[18:12:05] mwlang: hmmm???does look interesting.
[18:12:06] bamorim: has joined #RubyOnRails
[18:12:54] _djbkd: has joined #RubyOnRails
[18:12:57] Cervajz: has joined #RubyOnRails
[18:13:23] _djbkd: has joined #RubyOnRails
[18:13:30] profdoidao: has joined #RubyOnRails
[18:13:49] habitullence: has joined #RubyOnRails
[18:13:55] profdoidao: coult anyboy ask a question?
[18:14:15] ryan_000: has joined #RubyOnRails
[18:14:25] smathy: profdoidao, yes, if you're interested there's a link to the rules in the channel topic.
[18:14:46] smathy: (or if you have a thick skin, just ask and we'll let you know if you stray)
[18:14:50] redondo: has joined #RubyOnRails
[18:17:16] baweaver: has joined #RubyOnRails
[18:17:51] profdoidao: smathy, have any chanel of Brazil?
[18:18:07] profdoidao: my englesh not very well
[18:18:54] slayerja_: has joined #RubyOnRails
[18:19:20] _djbkd: has joined #RubyOnRails
[18:19:33] profdoidao: I trying use a rake for create all database , but don't work
[18:19:37] ericjphillips: has joined #RubyOnRails
[18:19:40] nettoweb: has joined #RubyOnRails
[18:19:50] _djbkd: has joined #RubyOnRails
[18:20:15] cnk: That is often a permission issue. Did your rake task give errors?
[18:20:20] HalcyonicStorm: has joined #RubyOnRails
[18:21:04] smathy: profdoidao, no, only this one. There are some Brazilians in here sometimes, but we all speak broken English :)
[18:21:28] smathy: profdoidao, what happens when you try?
[18:22:36] profdoidao: Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>nil, "socket"=>"/var/run/mysqld/mysqld.sock", "database"=>"loja_production"}
[18:23:14] baweaver: do you even have MySQL instaled?
[18:23:33] profdoidao: I use mariadb
[18:23:39] yfeldblum: has joined #RubyOnRails
[18:23:56] baweaver: https://github.com/brianmario/mysql2/issues/506
[18:24:25] momomomomo: has joined #RubyOnRails
[18:24:59] baweaver: MariaDB != MySQL
[18:25:02] baweaver: fork or not
[18:25:32] profdoidao: I use it with PHP and other languages ??????, absolutely nothing changes
[18:25:42] smathy: profdoidao, !gist the full error, there'll be more than just that.
[18:25:42] helpa: profdoidao: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[18:25:50] baweaver: Ruby != PHP
[18:25:53] zpe: has joined #RubyOnRails
[18:26:25] baweaver: then it's hazardous to assume things work the exact same.
[18:26:53] Pavster: has joined #RubyOnRails
[18:27:09] profdoidao: https://gist.github.com/ale-php/b22f3496ea014b2ec318
[18:27:10] adam12: profdoidao: can you connect manually with that username/password? `mysql -u root loja_production` or `mysql -u root -p loja_production`
[18:27:29] profdoidao: manually work .
[18:27:35] adam12: You have a password in your Gist
[18:27:43] adam12: but it says password is nil in the error
[18:28:11] baweaver: delete the entire gist and star that out
[18:28:20] baweaver: if you edit it, it'll be there in past versions.
[18:29:18] profdoidao: I did not understand baweaver
[18:29:21] adam12: profdoidao: what rake command did you run? sometimes that error is safe to ignore if the database already exists.
[18:29:34] arup_r: How can I modify the action controller params hash ? Myself couldn't figure it out
[18:29:39] profdoidao: I'm use rake db:create:all
[18:29:40] arup_r: https://gist.github.com/aruprakshit/696fff587c1383f590e9
[18:29:50] baweaver: if you know ruby is not php then you must also know that it is bad to think they behave the same
[18:29:51] arup_r: it is not adding current user
[18:29:59] Hates_: has joined #RubyOnRails
[18:30:00] adam12: profdoidao: if you do `RAILS_ENV=production rails console`, does everything connect ok?
[18:30:01] smathy: profdoidao, sorry, I wanted a gist of the full error you see.
[18:30:56] manfrin: has joined #RubyOnRails
[18:31:07] adam12: arup_r: hard to follow your code, but Enum#map doesn't manipulate data in place. You'd likely have to reassign it back into params.
[18:31:33] profdoidao: smathy, full error
[18:31:34] profdoidao: https://gist.github.com/ale-php/b22f3496ea014b2ec318
[18:32:00] adam12: profdoidao: Do you have `gem "mysql2"` in your Gemfile?
[18:32:12] CanTonic: has joined #RubyOnRails
[18:32:13] arup_r: I used merge! also
[18:33:05] adam12: arup_r: what about annotation_params[:comments_attributes] = ...
[18:33:22] adam12: arup_r: There is likely a better way to do this.
[18:33:25] arup_r: Let me try annotation_params[:comments_attributes].map { |_, comment| comment.merge(user: current_user) }
[18:33:41] adam12: profdoidao: is it in a `group` declaration or anything?
[18:33:53] arup_r: this is - annotation_params[:comments_attributes].each_pair { |_, comment| comment.merge!(user: current_user) }
[18:33:58] arup_r: let me try
[18:34:15] arup_r: adam12: sure.. please give me the idea..
[18:34:51] adam12: arup_r: Well I don't have a better solution for you as I'm not sure what your code is doing. I'm saying, mapping may not be the best route.
[18:35:02] Coldblackice: has joined #RubyOnRails
[18:35:05] adam12: arup_r: That said, map returns a new object. If you dont' assign it back into params, it's not doing anything.
[18:35:14] arup_r: removed map
[18:35:17] momomomomo: has joined #RubyOnRails
[18:35:21] profdoidao: I make database using phpMyadmin e try generate model
[18:35:39] adam12: profdoidao: gist Gemfile.
[18:35:55] smathy: profdoidao, that's a known issue: gem 'mysql2', '~> 0.3.18'
[18:36:16] profdoidao: https://gist.github.com/ale-php/b22f3496ea014b2ec318
[18:37:35] wldcordeiro_: has joined #RubyOnRails
[18:38:01] slayerjain: has joined #RubyOnRails
[18:38:07] smathy: profdoidao, right, change it as I said just above.
[18:38:11] _djbkd: has joined #RubyOnRails
[18:38:18] profdoidao: for update i use bundle update
[18:38:21] smathy: ...can use 0.3.20 if you like, just no 0.4
[18:38:36] herbst: has joined #RubyOnRails
[18:38:54] smathy: Just bundle will work.
[18:39:07] greengriminal: has joined #RubyOnRails
[18:39:13] _djbkd: has joined #RubyOnRails
[18:39:38] Brando753: has joined #RubyOnRails
[18:39:47] profdoidao: thank very much
[18:39:59] profdoidao: was gem mysql
[18:40:29] chouhoulis: has joined #RubyOnRails
[18:40:37] rushed: has joined #RubyOnRails
[18:41:04] jozan: has joined #RubyOnRails
[18:41:13] smathy: profdoidao, yeah, there's some issue with Rails 4.2 and mysql2 0.4
[18:41:37] chouhoul_: has joined #RubyOnRails
[18:41:50] codenapper: has joined #RubyOnRails
[18:42:03] adam12: Good to know...
[18:42:35] lasker85: has joined #RubyOnRails
[18:42:39] arup_r: so buggy.. really..
[18:42:54] arup_r: still rounding my eyes
[18:43:09] lasker85: I'm looking to store a bunch of user information before they login in. (In cookies? in cache?). I'm not sure how to do this. Any good reading? Anyone know what the best practices are?
[18:43:29] adam12: lasker85: what kind of information?
[18:43:56] smathy: *Might* be just when using mariadb
[18:44:10] lasker85: 7-8 strings and floats. (Their height, weight, shoe size)
[18:44:35] lasker85: I also want to be able to do a few calculations with the #'s
[18:44:39] adam12: lasker85: Could be OK in session...
[18:44:55] adam12: lasker85: Just remember cookie store will have size limitations due to cookie constraints.
[18:45:10] lasker85: What kind of constraints we talking about?
[18:45:18] adam12: Cookies themselves are limited in size. I don't remember the amount
[18:45:21] lasker85: can i do 5 kilobytes?
[18:45:31] adam12: A few numbers is no big deal. An entire object can be problematic.
[18:45:53] smathy: No, 5k will be too much.
[18:45:58] adam12: 4093 bytes per domain is the limit, IIRC
[18:45:59] smathy: Use some other session store.
[18:46:32] agent_white: has joined #RubyOnRails
[18:46:44] lasker85: so the other option is to store it on the server
[18:46:59] lasker85: is there any good reading on that?
[18:47:07] finnnnnnnnnnn: has joined #RubyOnRails
[18:47:09] lasker85: what would be the operative search term?
[18:47:20] smathy: lasker85, http://guides.rubyonrails.org/action_controller_overview.html#session
[18:47:47] arup_r: Why don't we have any tool to modify ActionController::Parameters ? Just asking
[18:48:00] smathy: lasker85, note that depending on how much data you plan on using here, and the calculations, etc., you might just be better off with an actual DB table and model.
[18:48:14] DoubleMalt: has joined #RubyOnRails
[18:48:18] nateberkopec: has joined #RubyOnRails
[18:48:24] lasker85: an actual db table and model just for users that have not registered/logged in?
[18:48:28] smathy: lasker85, you can just include the session ID in the table, and still look it up using that - but then you'll have a model with calculations and stuff that you can build in.
[18:48:39] adam12: arup_r: why not build the object from the params, and then manipulate the objects before saving
[18:48:39] smathy: lasker85, perhaps, depending on the complexity and data.
[18:48:47] lasker85: thanks smathy that's helpful
[18:48:51] lasker85: that sounds like what i need to do
[18:49:02] nateberkopec: How would you describe the difference between using cookies.signed and session?
[18:49:44] nateberkopec: Or, I guess, when would you use cookies over session?
[18:49:48] arup_r: adam12: I am lost totally.. not getting you. :(
[18:50:12] adam12: arup_r: you are taking your params and passing them into SomeObject.new, and then calling #save.
[18:50:17] smathy: lasker85, could also not use the session ID, but instead just store the that_table.id in the session, like session[:prospect_id] = @prospect.id
[18:50:20] kadoppe: has joined #RubyOnRails
[18:50:25] adam12: arup_r: why not before calling #save, walk through the objects and do the assignment you need.
[18:50:33] smathy: lasker85, then look it up later with: Prospect.find_by id: session[:prospect_id]
[18:50:40] arup_r: ok.. cool
[18:50:57] CanTonic: has joined #RubyOnRails
[18:51:00] smathy: nateberkopec, I never use cookies instead of session.
[18:51:29] smathy: nateberkopec, the only exception is if I want to set a cookie in JS and read it on the server.
[18:51:33] lasker85: so smathy -- do you just destroy the records from the model when they closet the browser?
[18:51:44] smathy: nateberkopec, and the only time I ever do that is for dynamic timezone offsets.
[18:52:26] nateberkopec: smathy: ah yes, I think that might be what I'm getting at. Why do you have to use cookies in that instance?
[18:52:43] nettoweb: has joined #RubyOnRails
[18:52:50] nateberkopec: actually that isn't probably what I'm getting at
[18:53:00] smathy: nateberkopec, just because JS knows the user's local time.
[18:53:12] smathy: nateberkopec, so you can do that without asking the user to select a timezone, etc.
[18:53:18] nateberkopec: I'm just noticing in the ActionCable examples, they're setting the current_user based on cookies.signed[:user_id] instead of the traditional session[:user_id]
[18:53:22] nateberkopec: And I can't figure out why
[18:53:39] nateberkopec: Because presumably the session cookie is available
[18:53:58] adam12: arup_r: untested obviously. https://gist.github.com/adam12/91a1715bb80e8089bff4
[18:55:42] CanTonic: has joined #RubyOnRails
[18:57:54] jtb__: has joined #RubyOnRails
[18:58:28] n008f4g_: has joined #RubyOnRails
[18:59:26] slayerjain: has joined #RubyOnRails
[18:59:51] arup_r: adam12: Got what you meant..
[19:01:53] pruby_: has joined #RubyOnRails
[19:02:32] fschuindt: has joined #RubyOnRails
[19:02:40] rromanch_: has joined #RubyOnRails
[19:03:59] manfrin: has joined #RubyOnRails
[19:04:49] momomomomo: has joined #RubyOnRails
[19:05:06] profdoidao: away that for use rails comands, i have make source .profile?
[19:05:23] pruby_: has left #RubyOnRails: ()
[19:05:32] mlitwiniuk: has joined #RubyOnRails
[19:05:52] smathy: lasker85, well for a start I'd configure the session to use a persistent cookie `:expire_after` option for `config.session_store`, and then I'd just have a cron job that occasionally swept through and removed old/stale records.
[19:06:38] acti0nman: has joined #RubyOnRails
[19:07:35] dideler: has joined #RubyOnRails
[19:07:45] moeabdol: has joined #RubyOnRails
[19:08:11] adam12: profdoidao: normally those files are sourced by your shell. what lines from there do you need rails to have?
[19:08:52] smathy: nateberkopec, lots of people just use cookies because they're familiar with them.
[19:09:15] netzfisch: has joined #RubyOnRails
[19:11:07] profdoidao: astabelas Rails are used in the plural ?
[19:11:46] RegulationD: has joined #RubyOnRails
[19:12:10] naftilos76: has joined #RubyOnRails
[19:12:19] smathy: profdoidao, yes, the tables are plural.
[19:13:00] K0nserv-: has joined #RubyOnRails
[19:13:54] twohlix: has joined #RubyOnRails
[19:14:05] richipargo: has joined #RubyOnRails
[19:14:23] twohlix: has joined #RubyOnRails
[19:14:55] twohlix: has joined #RubyOnRails
[19:15:37] jozan: has joined #RubyOnRails
[19:15:48] drptbl: has joined #RubyOnRails
[19:15:56] Pavster: has joined #RubyOnRails
[19:16:42] TheAustinSeven: has joined #RubyOnRails
[19:16:53] TheAustinSeven: has left #RubyOnRails: ()
[19:17:03] lele: has joined #RubyOnRails
[19:17:45] Maletor: has joined #RubyOnRails
[19:20:05] pushpak: has joined #RubyOnRails
[19:22:14] scoot: has joined #RubyOnRails
[19:22:38] cac: has joined #RubyOnRails
[19:24:22] podman: has joined #RubyOnRails
[19:25:49] tw1sted: has joined #RubyOnRails
[19:25:54] stamina: has joined #RubyOnRails
[19:26:21] sandstrom: has joined #RubyOnRails
[19:31:23] ruurd: has joined #RubyOnRails
[19:31:56] yaymukund: has joined #RubyOnRails
[19:32:09] rodfersou: has joined #RubyOnRails
[19:32:32] youngbaks: has joined #RubyOnRails
[19:33:11] annlewis: has joined #RubyOnRails
[19:33:40] tw1sted: has joined #RubyOnRails
[19:34:54] momomomomo: has joined #RubyOnRails
[19:35:08] stannard: has joined #RubyOnRails
[19:35:46] andywww: has joined #RubyOnRails
[19:37:50] piotrj: has joined #RubyOnRails
[19:40:00] tw1sted: has joined #RubyOnRails
[19:40:06] herbst: has joined #RubyOnRails
[19:40:50] Uranio-235: has joined #RubyOnRails
[19:44:20] tetraktys: has joined #RubyOnRails
[19:45:54] unreal_: has joined #RubyOnRails
[19:45:56] Pazician: has joined #RubyOnRails
[19:46:22] gustav__: has joined #RubyOnRails
[19:46:28] momomomomo: has joined #RubyOnRails
[19:48:27] squiercaster: has joined #RubyOnRails
[19:49:11] Cervajz_: has joined #RubyOnRails
[19:49:44] tetraktys: hey guys, i'm trying to create a form where my users can upload their profile image. The issue is that I want all uploads (with refile) to be stored in one database table, and i have a join model (profile_images) to connect profiles and uploads. When i save the form in this gist: https://gist.github.com/joostvanrijn/3eabecb1704480fd24c8 it saves the Upload, but not the ProfileImage
[19:49:52] arBmind: has joined #RubyOnRails
[19:52:05] violarium: has joined #RubyOnRails
[19:52:48] scoot: has joined #RubyOnRails
[19:55:19] violarium: has joined #RubyOnRails
[19:55:32] cac: has joined #RubyOnRails
[19:58:44] tvw: has joined #RubyOnRails
[19:59:35] _djbkd: has joined #RubyOnRails
[19:59:59] tubbo: tetraktys: any msgs in the log
[20:00:42] tetraktys: tubbo, i think i figured it out. In the edit action i do @profile.build_profile_image.build_upload, which destroys the current profile_image
[20:01:16] tetraktys: which brings me to a follow-up question. is this the right track i'm on?
[20:01:23] baweaver: has joined #RubyOnRails
[20:01:43] tetraktys: should i just add "unless @profile.profile_image.present?" behind the build line?
[20:02:08] rickmasta: has joined #RubyOnRails
[20:02:35] hightower4: Hey, how do I retrieve the mount path from a controller or view?
[20:02:45] artto: has joined #RubyOnRails
[20:02:52] tetraktys: what do you mean hightower4?
[20:03:57] pawnbox: has joined #RubyOnRails
[20:04:12] hightower4: Let's say my rails app is configured to run inside example.com/test/, and when I access e.g. example.com/test/users, I want to retrieve the value of "example.com/test"
[20:04:38] chipotle: has joined #RubyOnRails
[20:07:10] rickmasta: has joined #RubyOnRails
[20:07:45] cnk: hightower4: it is certainly in the request parameters that Rack supplies but I don't know if there is a convenience method for that info in Rails
[20:09:45] jcromartie: has joined #RubyOnRails
[20:10:34] jcromartie: has joined #RubyOnRails
[20:10:43] maz-dev: has joined #RubyOnRails
[20:11:05] gustav__: has joined #RubyOnRails
[20:11:11] sarink: has joined #RubyOnRails
[20:11:26] gustav__: has joined #RubyOnRails
[20:12:39] krisquigley: has joined #RubyOnRails
[20:13:35] fmcgeough: has joined #RubyOnRails
[20:14:14] ktchup: has joined #RubyOnRails
[20:15:10] FailBit: "Sites are gardens. Moderators are gardeners. The gardeners look for the weeds and infections and remove them to avoid infecting the healthy plants with goatse."
[20:15:13] Cervajz: has joined #RubyOnRails
[20:15:38] _djbkd: has joined #RubyOnRails
[20:16:09] dionysus69: i know its bad but what is the best way to run rails app on windows, through vagrant or any other virtualization or directly on windows?
[20:16:16] tubbo: dionysus69: vagrant
[20:16:40] dionysus69: tubbo: ok thanks! i will have to go through lots of setting up this week xD
[20:17:21] Limix: has joined #RubyOnRails
[20:17:25] dionysus69: also, which server should I aim for, phussion passenger? or unicorn or ?
[20:17:35] FailBit: whatever floats your boat
[20:17:39] FailBit: I like unicorn
[20:18:33] cnk: passenger is almost as easy as setting up just the web server (apache or ngnix) so I always go with that / recommend that unless you have a specific reason to do otherwise
[20:19:13] dionysus69: hmm thanks cnk since simplicity is priority at this moment I ll go with that
[20:19:13] tubbo: cnk: *shrug* i find unicorn to be very easy to set up
[20:19:18] tubbo: got a config file for nginx that i always use
[20:19:29] tubbo: as long as i put the socket in the same location every time, everything is hunky dory
[20:19:43] dionysus69: I have heard of unicorn, just through heroku :D
[20:19:58] Papierkorb: well you can even use passenger as gem and then usage is pretty much like every other ruby server
[20:20:00] mices: is it bad convention to name a field "url"
[20:20:04] cnk: tubbo: and nginix is proxying?
[20:20:10] tubbo: cnk: yeah
[20:20:16] tubbo: proxy passing that sht
[20:20:47] Papierkorb: mices: Could you elaborate?
[20:20:57] dionysus69: what does proxying mean in this case?
[20:21:23] Papierkorb: mices: Per se, I think naming a field 'url' is fine if it contains a URL. no need to come up with a more complicated name just for the sake of it
[20:21:24] FailBit: the reason you don't expose the app server is first of all because it can't serve assets
[20:21:39] FailBit: but also because you most app servers are easily slowloris'd
[20:22:05] FailBit: so you put a proxy like nginx in front of the app server to take care of both problems
[20:22:41] IceyEC: has joined #RubyOnRails
[20:22:43] emmesswhy: has joined #RubyOnRails
[20:23:44] IceyEC: has joined #RubyOnRails
[20:23:53] dionysus69: hmm ok I feel better than before :D
[20:25:50] EminenceHC: has joined #RubyOnRails
[20:26:09] otacon-: has joined #RubyOnRails
[20:26:32] bklane: has joined #RubyOnRails
[20:26:33] scoot: has joined #RubyOnRails
[20:27:32] profdoidao: what version mysql2 ?
[20:28:00] smathy: tetraktys, I always put that logic in the view, like: f.simple_fields_for :profile_image, ( f.object.profile_image || ProfileImage.new ) do |profile_image_f|
[20:28:30] defsdoor: mices, its bad form if its actually a URI
[20:28:35] mwlang: So I removed config.js.coffee.erb and just went back to plain ole??? config.js.coffee ??? now I am getting Sprockets::FileNotFound: could not find file: ./app/assets/javascripts/ckeditor/config.js.coffee.erb ??? rake assets:clean did not resolve.
[20:28:45] mwlang: any ideas what else to try?
[20:28:52] smathy: tetraktys, I know a lot of other people who put it in the controller, like @profile.profile_image ||= ProfileImage.new
[20:29:02] tetraktys: smathy, logic in the view, sounds bad
[20:29:13] smathy: profdoidao, yes, latest 0.3.
[20:29:49] defsdoor: smathy, ideally you should build your data in the controller - however be careful not to fire queries - take advantage of Rails' lazy loading
[20:30:24] smathy: defsdoor, not sure what definition of ideal that is, but no - that's not the best approach in my experience.
[20:30:29] iceyec_: has joined #RubyOnRails
[20:30:38] sypheren: has joined #RubyOnRails
[20:30:42] defsdoor: smathy, sometimes - especially when reusing partials across controllers - I instatiate in the partial
[20:31:01] smathy: tetraktys, that's where it belongs, you're only pre-populating the association so the form helper adds your extra fields to your form.
[20:31:45] smathy: defsdoor, yep, so your partial acts like a self-contained component, regardless of which controller it's rendered from.
[20:31:56] tubbo: defsdoor: what's the difference between a URI and a URL?
[20:32:00] defsdoor: smathy, doing your setup in the controller is much clearer to see what is going on and being used
[20:32:05] smathy: defsdoor, you've reduced the knowledge the controller must have of the view it's rendering.
[20:32:15] ericjphillips: has joined #RubyOnRails
[20:32:33] annlewis: has joined #RubyOnRails
[20:32:40] defsdoor: smathy, not sure that is an ambition you should have
[20:32:52] smathy: defsdoor, only when you're looking at the controller, when you're looking at the view - it's clearer to see what's being done in order to render the extra field when it's required.
[20:33:15] smathy: defsdoor, I'm certain that it is.
[20:33:21] defsdoor: tubbo, you jest yes ?
[20:34:10] tubbo: defsdoor: no, it's just that a URI is a URL.
[20:34:12] tubbo: so it doesn't matter
[20:34:22] tubbo: a URI could either be a URN or a URL. in this case it's a URL.
[20:35:00] defsdoor: tubbo, a URL is a URI you mean ?
[20:35:33] smathy: tetraktys, anyway, as you can see - most people just reach for "pre-populate the association in the controller", which works fine when you're starting.
[20:35:48] tubbo: a convention i like to follow is url == the input url string, uri == the URI object parsed from the string
[20:35:50] manfrin: has joined #RubyOnRails
[20:36:03] tetraktys: i've already silently picked your side smathy ;)
[20:36:11] smathy: Shh, run :)
[20:38:01] mwlang: makes absolutely no sense???I can rake assets:precompile locally, but on the server, it???s consistently trying to find a non-existent file that I don???t include anywhere.
[20:39:00] tetraktys: that sucks mwlang!
[20:39:22] baweaver: has joined #RubyOnRails
[20:39:27] tetraktys: how can may we help
[20:39:36] tetraktys: *how may we help?
[20:40:16] mwlang: tetraktys: I???m trying to figure out how to completely clear the assets cache ??? it???s the only thing I can think is causing this.
[20:40:22] smathy: mwlang, make sure you've stopped spring locally, maybe somethings loaded there that's causing a false positive.
[20:40:39] smathy: mwlang, and double-check the same for your production server, although hopefully you don't have spring loaded there.
[20:40:41] mwlang: bundle exec rake assets:clean && bundle exec rake assets:precompile doesn???t do it.
[20:40:55] mwlang: smathy: ah, good point on spring.
[20:41:06] smathy: mwlang, oh no, :clean doesn't do it. It just removes unused ones. You need assets:clobber
[20:41:49] banjara: has joined #RubyOnRails
[20:42:11] smathy: mwlang, for future, `rake -T assets` shows the tasks that have "assets" in them with the description of each.
[20:42:36] mwlang: and another thing???any reason for asset compilation to take 8 - 10 minutes on a ???good server???? It only takes about 30 seconds on my macbook pro.
[20:42:52] mwlang: smathy: yeah, I was relying on faulty memory.
[20:43:10] smathy: mwlang, production does more than development, by default.
[20:43:25] nateberkopec: TIL you can give arguments to rake -T
[20:43:38] smathy: mwlang, you can also always just: rm -rf public/assets
[20:43:41] kitsuneyo: has joined #RubyOnRails
[20:43:50] mwlang: I think I need a deep dive into sprockets session next time I have some free time.
[20:43:59] mwlang: smathy: already tried that.
[20:44:11] smathy: (or rm -rf public/assets/* if your assets is a symlink in prod)
[20:44:27] mwlang: it???s the latter.
[20:45:00] mwlang: but yeah, I blew the contents of assets away with rm when assets:clean didn???t seem to do enough.
[20:45:03] VeryBewitching: has joined #RubyOnRails
[20:45:27] mwlang: seems to be recompiling from the top now, so rake assets:clobber must???ve touched something else.
[20:47:18] bruno-: has joined #RubyOnRails
[20:47:18] ivanskie: has joined #RubyOnRails
[20:47:57] yfeldblum: has joined #RubyOnRails
[20:51:27] jcromartie: has joined #RubyOnRails
[20:53:27] ruurd: has joined #RubyOnRails
[20:53:27] mwlang: yup, that resolved it.
[20:53:43] pydave6367: has joined #RubyOnRails
[20:56:17] jenrzzz: has joined #RubyOnRails
[20:57:19] yaymukund: has joined #RubyOnRails
[20:57:29] wildlander: has joined #RubyOnRails
[20:59:37] EminenceHC: has joined #RubyOnRails
[21:02:00] krisquigley: has joined #RubyOnRails
[21:03:05] alex88: has joined #RubyOnRails
[21:03:51] Maletor: has joined #RubyOnRails
[21:04:01] arup_r: haha rm is much poweful
[21:05:20] lytol_: has joined #RubyOnRails
[21:06:39] finnnnnnnnnnn: has joined #RubyOnRails
[21:06:54] smathy: mwlang, excellent.
[21:07:14] EminenceHC: has joined #RubyOnRails
[21:07:32] hd1: has joined #RubyOnRails
[21:07:47] mwlang: sheez???now I have the opposite problem???its not precompiling config.js.coffee
[21:08:38] pheuko: has joined #RubyOnRails
[21:09:03] hd1: omniauth's google_oauth2 strategy is giving me a CSRF error -- help?
[21:10:44] smathy: mwlang, and you have it in your manifest?
[21:13:12] mwlang: smathy: yeah??? ???//= require ckeditor/config???
[21:13:47] scoot: has joined #RubyOnRails
[21:14:02] mwlang: 3 hours to add 3 lines of javascript. :-o :-/
[21:14:13] Mia: has joined #RubyOnRails
[21:14:14] Mia: has joined #RubyOnRails
[21:14:18] rhizome: knowing which pipe to hit
[21:14:26] bklane: has joined #RubyOnRails
[21:15:34] cnk: rhizome: sing it again Sam! I am still trying to figure out how React wants me to check if some prop was availalbe in getInitialState
[21:15:35] mwlang: ACTION has glue, seeks pipe
[21:15:51] cnk: do I check undefined? or just !this.props.thingy or ??
[21:18:54] sar1nk: has joined #RubyOnRails
[21:18:58] rhizome: that doesn't sound very tell-don't-ask
[21:20:19] cnk: I could be doing it wrong but... I need to disable a submit button based on wether or not you have already answered a question
[21:20:23] smathy: cnk, ! defined? x
[21:20:54] cnk: there is a defined? in JS?
[21:21:02] cnk: my JS skiz are terrible
[21:21:06] smathy: cnk, when did we switch to JS?
[21:21:23] rhizome: about the 8th or 9th word of their question
[21:21:26] cnk: a few mini ago
[21:21:37] cnk: with the pipe comment
[21:21:43] smathy: Oh, prefixed to rhizome - I only saw the next thing you said.
[21:21:53] hd1: http://lists.d8u.us/auth/google_oauth2/callback what's going on here?
[21:21:54] mwlang: should the file be named config.js.coffee or just config.coffee?
[21:22:02] cnk: but I am getting more traction here than in the react channel
[21:22:11] mary5030: has joined #RubyOnRails
[21:22:19] smathy: typeof variable !== 'undefined'
[21:22:25] cnk: mwlang: config.js.coffee is more common
[21:23:00] VeryBewitching: mwlang: name.ext.preprocessor
[21:23:14] havenwood: has joined #RubyOnRails
[21:23:15] VeryBewitching: mwlang: It seems to be the common theme.
[21:23:38] Swappticon: has joined #RubyOnRails
[21:23:39] jefflt: has joined #RubyOnRails
[21:23:40] banjara: has joined #RubyOnRails
[21:24:05] mwlang: yeah, I was just doubting since I???ve been seeing the middle extension being dropped???haml templates for example.
[21:26:37] mwlang: !?! nuts. I renamed the file to config.coffee and rake assets:clobber && rake assets:precompile and it doesn???t find it. I rename it back to config.js.coffee and rake assets:clobber && rake assets:precompile and it finally finds it.
[21:27:55] cnk: smathy: thank you!
[21:28:36] mwlang: false positive???that config.js is coming out of the ckeditor_rails gem. I had a typo in my renamed file.
[21:28:39] Gustavo: has joined #RubyOnRails
[21:30:01] charliesome: has joined #RubyOnRails
[21:30:39] kitsuneyo: has joined #RubyOnRails
[21:30:56] mwlang: Isn???t this enough to get a coffeescript into the asset pipeline? https://gist.github.com/mwlang/84e21c9386d658d11681
[21:31:08] roxtrongo: has joined #RubyOnRails
[21:32:03] habitullence: has joined #RubyOnRails
[21:33:04] VeryBewitching: mwlang: Are you using ckeditor-rails ?
[21:33:08] workmad3_: has joined #RubyOnRails
[21:33:19] mwlang: VeryBewitching: yes???well ckeditor_rails
[21:34:40] simkessy: has joined #RubyOnRails
[21:34:56] bamorim: has joined #RubyOnRails
[21:35:21] rakm: has joined #RubyOnRails
[21:36:21] banjara: has joined #RubyOnRails
[21:36:23] smathy: cnk, you're welcome.
[21:36:24] simkessy: any way to improve this? It's pretty slow https://gist.github.com/simkessy/fd15f504e73d725662f3
[21:38:17] rakm: anyone ever used paperclip to store a directory of files, rather than just one file?
[21:40:32] rakm: looking to implement a 3d rotation, lke this: http://jquery.vostrel.cz/reel#demo and wondering how we can store the files
[21:41:14] herbst: has joined #RubyOnRails
[21:41:32] artto: has joined #RubyOnRails
[21:41:32] VeryBewitching: mwlang: Out of the box rake assets:precompile works fine, is it the config file that's not being included?
[21:42:03] VeryBewitching: mwlang: And where did you put the ckeditor_config.js.coffee ?
[21:42:14] havenwood: has joined #RubyOnRails
[21:42:40] mwlang: VeryBewitching: yes. I delberately renamed the file to ???ckeditor_config.js.coffee??? and I placed it in app/assets/javascript
[21:42:54] mwlang: javascripts*
[21:42:55] baweaver: has joined #RubyOnRails
[21:43:49] charliesome: has joined #RubyOnRails
[21:44:33] mwlang: simkessy: very ugly way to do it: ActiveRecord::Base.connection.execute(['select date(created_at) as event_date, count(*) as events from bookings b join venue v on b.venue_id = v.id where date(created_at) between ? and ?', start_date, end_date]).pluck(:event_date, :events)
[21:44:42] glennfu: has joined #RubyOnRails
[21:44:51] mwlang: (assuming mysql)
[21:45:21] deavid: has joined #RubyOnRails
[21:45:31] bkulbida: has joined #RubyOnRails
[21:46:05] Cache_Money: has joined #RubyOnRails
[21:46:37] pwnd_nfsw: has joined #RubyOnRails
[21:47:22] simkessy: mwlang: i'm using postgres and yea is pretty ugly :P
[21:48:33] smathy: simkessy, can I confirm that this is doing what you want it to be doing? You're only doing a `created_at == date`, so you'll only be getting records created at midnight on each day in your range.
[21:48:57] simkessy: ill give it a shot
[21:49:04] simkessy: my way isn't working actually
[21:50:03] smathy: simkessy, so, to do what I think you want to do: Booking.where( created_at: 3.months.ago.to_date..Date.today).group("DATE(created_at)").count
[21:50:18] smathy: ...sorry, throw the for_venue(@venue) in there too.
[21:50:36] smathy: ...which will probably mean you need "DATE(bookings.created_at)"
[21:50:59] VeryBewitching: mwlang: I can't get any of the UI options to take with your setup unfortunately.
[21:51:26] closer: has joined #RubyOnRails
[21:51:35] mwlang: VeryBewitching: hmmm???
[21:51:54] smathy: ...probably also want Date.today.end_of_day
[21:52:23] mwlang: If I???m reading the ckeditor_rails source correctly, it should already be putting app/assets/javascripts/ckeditor/config.js.coffee on the manifest
[21:52:44] mwlang: ditching coffeescript for straight up js.
[21:53:14] banjara: has joined #RubyOnRails
[21:54:14] Paradox: has joined #RubyOnRails
[21:54:35] simkessy: smathy: it works but when I throw in the `for_venue` I get this error - https://gist.github.com/simkessy/fd15f504e73d725662f3
[21:55:28] smathy: simkessy, I already explained that, please read what I wrote since my previous prefixed comment.
[21:55:53] havenwood: has joined #RubyOnRails
[21:56:04] VeryBewitching: Oh, mwlang https://github.com/tsechingho/ckeditor-rails#configure-plugins-languages-and-skins-of-ckeditor-assets
[21:56:24] VeryBewitching: By default nothing is included for languages.
[21:56:27] simkessy: smathy: opps missed that
[21:56:33] simkessy: yeaa it's working now
[21:57:17] simkessy: Do you know any tutorials or something I could look at to do different queries, I need to create a dashboard but I'm having trouble with this stuff
[21:57:29] mwlang: VeryBewitching: hmmm???.default is nil for all languages...
[21:57:32] simkessy: like grouping ranges etc etc
[21:58:10] VeryBewitching: mwlang: Oh, yes. Sorry, busy day :D
[21:58:13] mwlang: however, knowing about this is important, too. I didn???t spot the initializer options before you pointed them out.
[21:58:14] smathy: simkessy, learn SQL.
[21:58:36] simkessy: smathy: haha fair enough
[21:58:39] mwlang: trying the next section down??? config.assets.precompile += ['ckeditor/*']
[21:59:24] smathy: simkessy, well I know you already know about the Rails guides, so if the info in there wasn't enough then you need to learn more SQL.
[22:01:25] mwlang: well, well, well???that last line solves the mystery.
[22:01:40] simkessy: yea they have a section on querying ill review that
[22:01:49] simkessy: just need to play around a bit more
[22:02:29] VeryBewitching: mwlang: Did you get it working?
[22:02:37] ianm_: has joined #RubyOnRails
[22:03:07] cac: has joined #RubyOnRails
[22:04:02] mwlang: VeryBewitching: I got it precompiling locally???now deploying to production to see.
[22:04:43] Scripore: has joined #RubyOnRails
[22:05:08] donkey-hotei: has joined #RubyOnRails
[22:05:29] yaymukund: has joined #RubyOnRails
[22:06:07] Zackio: has joined #RubyOnRails
[22:06:27] VeryBewitching: has joined #RubyOnRails
[22:06:59] VeryBewitching: That was an interesting crash.
[22:07:01] donkey-hotei: hello -- ! What's the best way for one to pass data from a template to a controller method?
[22:07:15] donkey-hotei: I'd like to use a form @ not a get request
[22:07:27] donkey-hotei: because I'm trying to pass an array of strings and two dates
[22:07:36] hendricius: has joined #RubyOnRails
[22:07:40] donkey-hotei: and a url w/all that data will be dirty
[22:09:13] mwlang: donkey_hotei: you generally don???t (by rails design)
[22:09:33] pwnd_nfsw: has joined #RubyOnRails
[22:10:04] donkey-hotei: don't what? pass data from a template to back-end code?
[22:10:09] donkey-hotei: thats ridiculous
[22:10:29] mwlang: donkey_hotei: it???s the other way around. Set the data variables in the controller so they???re passed to the template.
[22:11:03] mwlang: there is the helper methods you can define and call from your templates.
[22:11:57] mwlang: but I usually keep those strictly to ???decorator??? roles???displaying data a certain way, not for business logic.
[22:12:36] alex88: has joined #RubyOnRails
[22:14:25] smathy: donkey_hotei, I think mwlang was confused because you said "from a template to a controller", where you meant from an HTML form to a controller.
[22:14:58] smathy: donkey_hotei, also because, assuming that's what you're asking, it's such a basic level that we're not used to people asking how to do it.
[22:15:03] donkey-hotei: mwlang: yea, I'd like to be able to send data via a form (an array of strings, and two timestamps)
[22:16:03] mwlang: smathy???s got my number.
[22:16:10] smathy: donkey_hotei, so where is your problem exactly, you have the form sending other data and need to know how to send arrays and timestamps? Or you have nothing at all and need to know how to even begin?
[22:16:27] unreal: has joined #RubyOnRails
[22:16:36] n1lo: has joined #RubyOnRails
[22:17:18] donkey-hotei: smathy: oh ok -- yeah I'm pretty new to ruby on rails. There's one method that I have which takes three arguments (the data I'm trying to send via form) and returns some data thats made available to the template
[22:17:51] donkey-hotei: smathy: at this point i have just the method in the back-end and I'm working on getting bootstrap-datepicker working
[22:18:05] smathy: donkey_hotei, you have a controller method that takes three arguments? Like `def something(arg1, arg2, arg3)` ?
[22:18:35] donkey-hotei: well, technically I'm breaking MVC conventions because the controller method just reads from params and then calls a method attached to a model that takes the three args
[22:18:58] smathy: donkey_hotei, ok, that's not breaking from conventions.
[22:18:59] donkey-hotei: that method returns a hash that maps strings to numbers that are to be graphed in the UI
[22:20:24] smathy: donkey_hotei, so are you working through some tutorial or something?
[22:21:11] donkey-hotei: smathy, just reading some of the rubyonrails guides
[22:21:40] rspec: has joined #RubyOnRails
[22:21:57] donkey-hotei: smathy, if you'd like to see the project I'm working on its on github github.com/donkey-hotei/edurange
[22:22:28] EminenceHC: has joined #RubyOnRails
[22:22:45] donkey-hotei: I guess I'm mainly wondering how to create forms that would send data to a specific controller method
[22:22:51] smathy: donkey_hotei, I'd rather see the problem you're having :) Is it that you don't know how to trigger the date picker on a given field?
[22:24:37] donkey-hotei: smathy, I guess that's it -- im not sure how to trigger a method call once the datepicker and array have been selected by a user
[22:24:52] jenrzzz: has joined #RubyOnRails
[22:25:20] smathy: donkey_hotei, !gist your view showing the form
[22:25:20] helpa: donkey_hotei: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:26:39] donkey-hotei: k - 1 sec ...
[22:27:43] donkey-hotei: smathy, https://gist.github.com/donkey-hotei/05f3dc8518abcc42723f
[22:28:32] smathy: donkey_hotei, ok cool, so that looks right, how does the behavior vary from your expectations?
[22:28:33] baweaver: has joined #RubyOnRails
[22:28:58] smathy: donkey_hotei, oh, except you have - instead of = for the f.text_field line.
[22:29:00] Glyphik: has joined #RubyOnRails
[22:29:20] nettoweb: has joined #RubyOnRails
[22:29:23] Gustavo: has joined #RubyOnRails
[22:29:25] mwlang: VeryBewitching: confirmed I have resolved the issue.
[22:29:58] mwlang: for whatever reason, the ckeditor files were getting skipped despite referencing them in the application.js
[22:30:41] VeryBewitching: mwlang: It may be that it's a Rails 3+ engine.
[22:31:02] mwlang: that???s a good point.
[22:32:59] workmad3_: has joined #RubyOnRails
[22:35:36] bmurt: has joined #RubyOnRails
[22:37:04] charliesome: has joined #RubyOnRails
[22:39:29] hd1: ahh... our muslim, salaam jacob
[22:44:47] manfrin: has joined #RubyOnRails
[22:46:46] smathy: So racist.
[22:47:22] northfurr: has joined #RubyOnRails
[22:49:44] hd1: smothy: it was a missend
[22:50:05] smathy: Are you drunk hd1?
[22:50:08] hd1: and since when is it racist to wish somebody peace?
[22:50:58] hd1: smothy: why not accuse me of something else without basis?
[22:51:08] mwlang: what is a reliable way to paste Danish text from gmail into TextMate so it actually shows up as intended? For example, instead of ???Vi er blevet underrettet om problemet og arbejder p?? at l??se det.???, I get: ???Vi er blevet underrettet om problemet og arbejder p???? at l????se det.??? when the page is rendered.
[22:51:16] Aeyrix: I'll accuse you of being irritating, is that okay?
[22:52:00] hd1: Aeyrix: that is ok
[22:52:11] havenwood: has joined #RubyOnRails
[22:53:26] bklane: has joined #RubyOnRails
[22:53:26] hd1: mwlang: ensuring correct text encoding would solve your problem
[22:53:58] mwlang: hd1: that???s just it???how do I ensure that?
[22:54:28] mwlang: seems strange that it looks fine in the editors (vi and textmate), but not so fine when actually rendered.
[22:54:41] hd1: mwlang: force string encoding in the browser you're using
[22:55:15] mwlang: oh, wait, it???s rendering in terminal just like it does in browser.
[22:55:27] hd1: you can use stylish or greasemonkey to force an encoding
[22:56:15] ght: Question: When working on an old Rails 3.2 site, we want to ensure that blank isn't allowed in a field "name". What's the model validator on Rails 3.2 for that?
[22:56:44] ght: Sorry, my client may have sent that last sentence twice.
[22:56:45] hd1: meeting time, back in a bit
[22:57:47] herbst: has joined #RubyOnRails
[22:58:13] mwlang: ght: validates_presence_of
[22:58:19] scoot: has joined #RubyOnRails
[22:59:44] mwlang: woah! File => Save As and choose ???Add byte order mark??? checkbox.
[22:59:54] scoot: has joined #RubyOnRails
[23:00:36] smathy: ght, you might not realize, but the old docs are all still live: http://api.rubyonrails.org/v3.2.22/
[23:03:26] pwnd_nsfw: has joined #RubyOnRails
[23:03:45] mwlang: hmmm???validates :field_name, :presence => true works in 3.2.x, too. (I skipped 3.x altogether)
[23:04:47] mwlang: ght: also, the guides for 3.2: http://guides.rubyonrails.org/v3.2.13/
[23:05:10] nahtnam: has joined #RubyOnRails
[23:07:05] pydave6367: has joined #RubyOnRails
[23:07:34] davidheward: has joined #RubyOnRails
[23:11:09] HalcyonicStorm: has joined #RubyOnRails
[23:12:02] Flying_Squirrel: has joined #RubyOnRails
[23:12:38] charliesome: has joined #RubyOnRails
[23:13:52] ktchup: has joined #RubyOnRails
[23:14:27] northfurr: has joined #RubyOnRails
[23:14:54] ianm_: has left #RubyOnRails: ()
[23:15:03] sanjayu: has joined #RubyOnRails
[23:16:44] simkessy: has joined #RubyOnRails
[23:16:52] FrankD: has joined #RubyOnRails
[23:17:18] bruno-: has joined #RubyOnRails
[23:20:13] neanderslob: has joined #RubyOnRails
[23:20:49] jcromartie: has joined #RubyOnRails
[23:21:12] SteenJobs: has joined #RubyOnRails
[23:25:06] bklane: has joined #RubyOnRails
[23:28:56] baweaver: has joined #RubyOnRails
[23:30:10] Gustavo: has joined #RubyOnRails
[23:30:22] nettoweb: has joined #RubyOnRails
[23:31:46] EminenceHC: has joined #RubyOnRails
[23:35:37] quazimodo: has joined #RubyOnRails
[23:35:56] tw1sted: has joined #RubyOnRails
[23:36:37] ellisTAA: has joined #RubyOnRails
[23:39:56] Or1on: has joined #RubyOnRails
[23:40:49] rakm: "This installation of RMagick was configured with ImageMagick 6.8.9 but ImageMagick 6.9.1-10 is in use."
[23:41:10] pwnd_nsfw: has joined #RubyOnRails
[23:41:10] sdwrage: has joined #RubyOnRails
[23:42:01] rakm: i've removed 6.9.1 from my system (rm -rf /usr/local/Cellar/ImageMagick/6.9.*) and `convert -version` returns 6.8.9. I've also reinstall rmagick gem
[23:42:10] rakm: why does ruby think i'm still using 6.9.x?
[23:42:16] Swappticon: has joined #RubyOnRails
[23:42:21] Ropeney: has joined #RubyOnRails
[23:44:10] bklane: has joined #RubyOnRails
[23:44:12] scoot: has joined #RubyOnRails
[23:44:33] rakm: more specifically, i guess it's guard/zeus that's having a problem
[23:45:57] rushed: rakm: restart them?
[23:47:12] rakm: oh hey, zeus hadn't exited properly, I guess. had to remove .zeus.sock manually
[23:47:39] northfurr: has joined #RubyOnRails
[23:52:25] northfurr: has joined #RubyOnRails
[23:55:26] Maletor: has joined #RubyOnRails
[23:55:38] rclanan: has joined #RubyOnRails
[23:57:43] benlieb: has joined #RubyOnRails
[23:58:06] rclanan: Just inherited a new rails code base and trying to track something down. In one of the controllers they are making a call 'redirect_to edit_interest_profiler_interest_profiler_answer_path', yet I can't find that defined anywhere in the codebase. Can anyone tell me what is going on there?
[23:59:01] tomoyuki28jp: has joined #RubyOnRails
[23:59:15] pwnd_nsfw: rclanan, it's not in the routes at all?
[23:59:29] pwnd_nsfw: And is it erroring at that?
[23:59:34] pwnd_nsfw: Seems ERROneous
[23:59:34] tomoyuki28jp: Is that okay to create a table without primary key column in rails4?
[23:59:47] pwnd_nsfw: sure tomoyuki28jp
[23:59:54] tomoyuki28jp: pwnd_nsfw: thanks!