« Back to channel list

#RubyOnRails - 31 May 2016

« Back 1 day Forward 1 day »
[00:00:06] Darmani: Radar: wati...
[00:00:29] Darmani: I'm confused >.<
[00:01:09] Radar: Darmani: At one point there, you're calling a method on `nil`.
[00:01:16] Radar: \comment.author might be `nil` in one of those cases
[00:02:04] Darmani: Radar: Is there anyway around that? Perhaps doing @topic.comments.each isn't the best approach?
[00:02:19] Radar: Darmani: Well, you should find out which comment doesn't have an author.
[00:02:28] Radar: Darmani: <% binding.pry %> inside the comments.each block should do that
[00:02:34] Radar: Well, it should help you find it
[00:02:44] upsell5: has joined #RubyOnRails
[00:02:45] Darmani: Radar: Ohhhhh.
[00:02:55] superlou: has joined #RubyOnRails
[00:03:04] Darmani: Let me see if that solves it.
[00:03:21] jeromelanteri: question is not complete... on has_and_belongs_to_many relation model, :dependant => :destroy would work or not ?
[00:05:01] Darmani: Radar: Question, should I seed the database with a comment? Or use the console and manually create it?
[00:05:10] Radar: Darmani: whatever you want to do.
[00:05:26] Darmani: Radar: Ah, okay.
[00:05:28] jeromelanteri: Darmani there is file seeds.rb for that
[00:05:34] eljimador: has joined #RubyOnRails
[00:05:58] Radar: I hate using the children to send messages back and forth...
[00:06:05] pwnd_nsfw`: has joined #RubyOnRails
[00:06:05] jeromelanteri: helpa, and what it tell me ?
[00:06:24] eljimmy: has joined #RubyOnRails
[00:06:29] hive-mind: has joined #RubyOnRails
[00:07:06] jeromelanteri: helpa, i don't know how to do that on hexchat... i'm searching for see if it should be friendly.
[00:07:54] arathald: has joined #RubyOnRails
[00:08:09] jeromelanteri: ok Radar... normally, i should be able to read you.
[00:08:57] pawnbox: has joined #RubyOnRails
[00:08:58] jeromelanteri: helpa, i done it... lol
[00:09:01] Cervajz_: has joined #RubyOnRails
[00:09:19] Radar: oh well, no help then
[00:09:19] helpa: Next question, please!
[00:09:39] Radar: jeromelanteri: patience?
[00:09:54] Radar: jeromelanteri: Great. You should set it up as a has_many and has_many :through association. You can have dependent: :destroy on these associations.
[00:10:00] Radar: You can't have them on habtm associations
[00:10:03] Radar: !associations this guide covers it
[00:10:03] helpa: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[00:10:40] ksoze_: has joined #RubyOnRails
[00:10:59] jeromelanteri: Radar, and if i have a middle table (no model, i follow the Rails API guide for that), it could not be possible this way ? (i don't know why, but by through, i was not work...
[00:11:06] Klumben: has joined #RubyOnRails
[00:11:14] Radar: jeromelanteri: Create a model for the middle table.
[00:11:18] jeromelanteri: helpa, Radar, ok, i'm going to read it closer. thank you.
[00:11:24] roamingdog: has joined #RubyOnRails
[00:13:15] tgeeky: has joined #RubyOnRails
[00:13:19] roamingdog: has joined #RubyOnRails
[00:13:23] Darmani: Radar: So... the Binding pry even says that there is an author attached to the comment...
[00:13:49] Darmani: If you call comment.author.email within the binding.pry it shows the author clearly.
[00:13:49] Radar: Darmani: How many comments are there? You might only be checking for the first comment.
[00:13:56] Radar: Darmani: "exit" in the Pry prompt will go to the next comment.
[00:14:08] Darmani: Radar: There is only one. I deleted all the rest.
[00:14:42] Radar: Darmani: What does @topic.comments.count return in the Pry prompt?
[00:14:48] barhum2013: has joined #RubyOnRails
[00:15:22] Radar: Then I don't know how it's happening.
[00:15:40] Darmani: Radar: But me neither D:
[00:16:04] jeromelanteri: Radar, helpa, ok, if i well understand, the idea for this have to works is to remove has_and_belongs_to_many association tag, and use has_many :photos, :through :albums_photos, then create the albums_photo model for this table and put belongs_to :photos, etc... ok.
[00:16:14] Radar: jeromelanteri: yes
[00:16:22] jeromelanteri: Radar, thank you
[00:19:38] hive-mind: has joined #RubyOnRails
[00:19:59] jeromelanteri: something in my mind i'm not sure, do i need to create model by rails g model, or simply add the model file (because my table exist allready) ?
[00:20:38] arBmind: has joined #RubyOnRails
[00:22:09] Radar: jeromelanteri: !try
[00:22:09] helpa: jeromelanteri: Why don't you try it and find out for yourself?
[00:22:54] jeromelanteri: helpa, Radar, i'm afraid to do something wrong and loose hours for repair in fact... that is why. I think ask people who know is a good way for learn something.
[00:23:07] Radar: You can add the model file. It'll be fine.
[00:23:26] Radar: I'd rather people be critical about the actions they're thinking of taking rather than relying on strangers for advice.
[00:23:26] jeromelanteri: Radar, thank you
[00:26:35] allcentury: has joined #RubyOnRails
[00:27:00] SteenJobs: has joined #RubyOnRails
[00:28:34] jeromelanteri: Radar, i'm not sure to well understand the interest of motivation of this friendly kind of reflexion... but ok... i hope you feel better after write this friendly relation ship morality sentence. thank you again for teach/help on Rails, and also teach the life (it is a joke friendly sentence back in reaction)
[00:29:03] jeromelanteri: hope you will also appreciate the return
[00:30:54] Radar: Uh, thanks? I think.
[00:31:05] jhbs: Radar on Rails
[00:31:19] jhbs: Radar: I think he was incrementing you. Consider it a compliment
[00:31:46] Radar: jhbs: that was pontiki and pontiki is not a man
[00:31:51] hive-mind: has joined #RubyOnRails
[00:32:14] jhbs: I think she'll forgive the presumption...
[00:33:01] jancel: has joined #RubyOnRails
[00:38:00] Ropeney: has joined #RubyOnRails
[00:38:16] EasyCo: has joined #RubyOnRails
[00:42:18] paradisaeidae_: has joined #RubyOnRails
[00:42:40] jhbs: thoughts on rails for zombies?
[00:42:49] Radar: It's pretty good :)
[00:43:23] jhbs: i did the codecademy ruby
[00:43:32] jhbs: do you think that's sufficient preparation
[00:43:41] jhbs: to begin rails for zombies by envy labs
[00:43:43] trolin: has joined #RubyOnRails
[00:44:45] pawnbox: has joined #RubyOnRails
[00:46:04] hive-mind: has joined #RubyOnRails
[00:46:21] trolin: I have a URL structure which includes '/properties' and '/properties/%area%'. Is there a way to dynamically set a translation name based on the area variable? E.g., t('properties.%area%', area: ..., default: ...)
[00:48:12] context: trans = dynamic_something(params[:area])
[00:48:21] context: trolin: change your route to /properties/:area
[00:48:35] context: then just before_filter to fetch your translation
[01:05:40] hive-mind: has joined #RubyOnRails
[01:06:20] Darmani: Radar: Okay so when I call "each" on @topic.comments for some reason it comes up nil. If you just call @topic.comments you can see all the comments listed though.
[01:06:34] Radar: Darmani: Can you show me the code for this?
[01:07:01] Darmani: Radar: Sure, can I just show you the log from my binding.pry?
[01:07:05] jancel: has joined #RubyOnRails
[01:08:26] Darmani: Radar: https://gist.github.com/mfifth/194a9464839f56387bd1158d699af91e
[01:08:29] weaksauce: has joined #RubyOnRails
[01:08:47] Darmani: I have a feeling I'm not passing the correct variables to my controller and my view. The associations seem to be correct...
[01:09:01] Radar: Darmani: @comment and comment are different.
[01:09:21] Radar: Darmani: My guess is that this comment is being included in @topic.comments: https://gist.github.com/mfifth/194a9464839f56387bd1158d699af91e#file-topic-controller-L16
[01:09:59] Darmani: Radar: What does that mean? o,o
[01:10:17] Radar: Darmani: @topic.comments is also including that one that comes from @topic.comments.build
[01:10:23] Radar: Pretty sure we cover this in Rails 4 in Action. Hold.
[01:11:05] Darmani: ACTION holding
[01:11:05] Radar: Page 337, where we're doing @ticket.comments.persisted.any?
[01:11:28] Darmani: ACTION flips through pages
[01:11:32] Darmani: Radar: What chapter is that?
[01:11:38] Radar: Chapter 10.
[01:12:12] Darmani: Radar: Ah okay. I suppose I'll read it again.
[01:12:49] pat: has joined #RubyOnRails
[01:17:51] owenjones: has joined #RubyOnRails
[01:19:14] ferr: has joined #RubyOnRails
[01:21:27] gfvcastro: has joined #RubyOnRails
[01:22:35] thejamespinto: has joined #RubyOnRails
[01:23:31] chintanparikh: has joined #RubyOnRails
[01:26:21] norc_: has joined #RubyOnRails
[01:27:45] jancel: has joined #RubyOnRails
[01:27:46] hive-mind: has joined #RubyOnRails
[01:31:43] Alazoral: has joined #RubyOnRails
[01:32:53] PlasmaStar: has joined #RubyOnRails
[01:33:27] IFrank00: has joined #RubyOnRails
[01:33:28] IFrank004: has joined #RubyOnRails
[01:38:27] barhum2013: has joined #RubyOnRails
[01:39:15] pawnbox: has joined #RubyOnRails
[01:40:45] maxz: has joined #RubyOnRails
[01:41:14] sevenseacat: has joined #RubyOnRails
[01:42:01] roamingdog: has joined #RubyOnRails
[01:42:35] creature: has joined #RubyOnRails
[01:42:35] creature: has joined #RubyOnRails
[01:42:49] owenjones: has joined #RubyOnRails
[01:43:08] SteenJobs: has joined #RubyOnRails
[01:43:35] RegulationD: has joined #RubyOnRails
[01:43:54] Oliphaunte: has joined #RubyOnRails
[01:45:15] crdpink: has joined #RubyOnRails
[01:47:57] sdrew: has joined #RubyOnRails
[01:49:09] DanByc: has joined #RubyOnRails
[01:49:16] arBmind1: has joined #RubyOnRails
[01:50:13] blackmesa: has joined #RubyOnRails
[01:50:33] dkam_: has joined #RubyOnRails
[01:52:54] IFrank004: has joined #RubyOnRails
[01:52:57] IFrank00: has joined #RubyOnRails
[01:54:27] DanByc: has joined #RubyOnRails
[01:54:41] drupald: has joined #RubyOnRails
[01:58:21] Spami_: has joined #RubyOnRails
[02:01:06] Haydos: has joined #RubyOnRails
[02:02:46] barhum2013: has joined #RubyOnRails
[02:06:17] Oliphaunte: has joined #RubyOnRails
[02:07:30] DanByc: has joined #RubyOnRails
[02:07:42] hive-mind: has joined #RubyOnRails
[02:08:43] GriffinHeart: has joined #RubyOnRails
[02:12:50] adgtl: has joined #RubyOnRails
[02:13:06] banister: has joined #RubyOnRails
[02:14:38] one_zero: has joined #RubyOnRails
[02:14:39] gfvcastro: has joined #RubyOnRails
[02:14:57] triptec: has joined #RubyOnRails
[02:19:07] Kilo`byte: has joined #RubyOnRails
[02:19:34] Thouren: has joined #RubyOnRails
[02:20:41] arBmind: has joined #RubyOnRails
[02:21:58] d0nn1e: has joined #RubyOnRails
[02:23:31] Darmani: So I checked my associations, ran through my migrations, etc. And then I ran a binding.pry and saw this -__-
[02:23:36] Darmani: https://gist.github.com/mfifth/194a9464839f56387bd1158d699af91e
[02:24:05] Darmani: Radar: There's a comment object (that I didn't create btw) with no author, text, nothing.
[02:24:18] Radar: Darmani: Yes you created it.
[02:24:24] Radar: https://gist.github.com/mfifth/194a9464839f56387bd1158d699af91e#file-topic-controller-L16
[02:24:24] Radar: Right here
[02:24:34] Radar: Page 337 has the answer.
[02:24:59] Darmani: Radar: I read your book on Github so there aren't really page numbers.. o.o
[02:25:24] cd83x: has joined #RubyOnRails
[02:25:49] Darmani: Radar: As far as fuckups go am I a total loser? Or is that a common mistake? Lol
[02:26:52] GriffinHeart: has joined #RubyOnRails
[02:27:10] Darmani: Radar: Wait I why couldn't I see that comment when I looked through the console? It didn't show up when I did Comment.all
[02:27:32] sevenseacat: why does a simple mistake mean 'omg I'm a total loser'?
[02:28:01] czerasz: has joined #RubyOnRails
[02:29:05] Darmani: sevenseacat: Well that's what I'm asking.
[02:29:12] Darmani: Is it a simple mistake?
[02:29:24] sevenseacat: Darmani: if that was the case there would be no programmers anywhere, they all would have quit
[02:30:01] sevenseacat: a bug doesnt mean 'you fucked up'. it means you have a bug.
[02:30:37] Darmani: sevenseacat: And yet there are small mistakes and things that are obvious to someone who should know them.
[02:30:44] Darmani: There is a difference.
[02:31:03] sevenseacat: be very careful about making such blanket statements
[02:31:17] pawnbox: has joined #RubyOnRails
[02:31:33] sevenseacat: everyone makes silly little 'should have known better' mistakes
[02:32:07] sevenseacat: even for 'things that should be obvious to people who know them'
[02:32:34] sevenseacat: if you're determined to beat yourself up over every little thing you don't know, you will not survive in this industry
[02:34:14] Darmani: sevenseacat: Thank you for that shining tidbit of information.
[02:34:27] Darmani: I'm not actually beating myself up. I was over exaggerating.
[02:34:33] Radar: Darmani: Look in ch10 for the persisted scope
[02:34:34] Radar: bbl lunch
[02:34:55] sevenseacat: remember that nuances in communication don't come through in text
[02:35:30] Darmani: sevenseacat: Then isn't that something you should consider? After all I was talking to Radar whom I know a little better.
[02:35:48] sevenseacat: and surprise, he agreed with me
[02:38:11] sevenseacat: also do remember this is a public chat room.
[02:40:24] Radar: The constant beating yourself up does nobody favours.
[02:44:29] jhbs: It makes me sad when you beat yourself up, not sympathetic just very sad
[02:44:57] jhbs: Well, maybe a little sympathetic. But I don't know if it's a good way of asking for assistance
[02:46:36] GriffinHeart: has joined #RubyOnRails
[02:47:48] DanByc: has joined #RubyOnRails
[02:51:36] blackmesa: has joined #RubyOnRails
[02:52:45] ensyde__: has joined #RubyOnRails
[02:53:04] datanoise: has joined #RubyOnRails
[02:59:34] Pwnna: has left #RubyOnRails: ("Leaving")
[03:07:20] pawnbox: has joined #RubyOnRails
[03:07:45] hahuang65: has joined #RubyOnRails
[03:08:19] jancel: has joined #RubyOnRails
[03:12:05] braincrash: has joined #RubyOnRails
[03:13:33] stardiviner: has joined #RubyOnRails
[03:14:34] allcentury: has joined #RubyOnRails
[03:21:42] Oliphaunte: has joined #RubyOnRails
[03:21:43] k3rn31: has joined #RubyOnRails
[03:23:59] moeabdol1: has joined #RubyOnRails
[03:29:35] DanByc: has joined #RubyOnRails
[03:30:15] triptec: has joined #RubyOnRails
[03:32:34] tvon: has joined #RubyOnRails
[03:32:48] jancel: has joined #RubyOnRails
[03:33:51] tvon: has joined #RubyOnRails
[03:34:30] zave: has joined #RubyOnRails
[03:35:11] jenrzzz: has joined #RubyOnRails
[03:35:39] SteenJobs: has joined #RubyOnRails
[03:36:50] DanByc: has joined #RubyOnRails
[03:39:13] Guest38693: has joined #RubyOnRails
[03:45:38] Radar: WOE IS ME
[03:45:48] DanByc: has joined #RubyOnRails
[03:45:53] Radar: It's like a modern O Fortuna
[03:51:21] kgrz: has joined #RubyOnRails
[03:53:02] blackmesa: has joined #RubyOnRails
[04:02:15] Radar: Is there a way to limit datagrid reports to a specific row count?
[04:02:22] pawnbox: has joined #RubyOnRails
[04:02:44] k3rn31: has joined #RubyOnRails
[04:05:47] jancel: has joined #RubyOnRails
[04:06:07] GriffinHeart: has joined #RubyOnRails
[04:07:20] DanByc: has joined #RubyOnRails
[04:09:00] DanByc: has joined #RubyOnRails
[04:10:06] Inside: has joined #RubyOnRails
[04:10:06] Inside: has joined #RubyOnRails
[04:11:22] greenride: has left #RubyOnRails: ()
[04:11:32] upsell5: has joined #RubyOnRails
[04:11:54] dkam_: has joined #RubyOnRails
[04:14:03] jancel: has joined #RubyOnRails
[04:14:25] GriffinHeart: has joined #RubyOnRails
[04:18:42] ksoze: has joined #RubyOnRails
[04:19:39] bzb: has joined #RubyOnRails
[04:21:12] arBmind: has joined #RubyOnRails
[04:22:20] jancel: has joined #RubyOnRails
[04:23:13] allcentury: has joined #RubyOnRails
[04:24:26] DanByc: has joined #RubyOnRails
[04:26:10] DanByc: has joined #RubyOnRails
[04:31:05] Guest38693: has joined #RubyOnRails
[04:32:18] DanByc: has joined #RubyOnRails
[04:32:43] sypheren: has joined #RubyOnRails
[04:34:41] DanByc: has joined #RubyOnRails
[04:40:27] kdough: has joined #RubyOnRails
[04:41:08] sdrew: has joined #RubyOnRails
[04:42:19] DanByc: has joined #RubyOnRails
[04:52:12] DanByc: has joined #RubyOnRails
[04:53:00] pawnbox: has joined #RubyOnRails
[04:54:03] blackmesa: has joined #RubyOnRails
[04:54:56] emilkarl: has joined #RubyOnRails
[04:59:13] lxsameer: has joined #RubyOnRails
[05:02:14] DanByc: has joined #RubyOnRails
[05:03:46] Guest14270: has joined #RubyOnRails
[05:09:47] hahuang65: has joined #RubyOnRails
[05:11:04] chipotle: has joined #RubyOnRails
[05:11:08] DoctorMonocular: has joined #RubyOnRails
[05:12:07] GriffinHeart: has joined #RubyOnRails
[05:12:35] Cohedrin: has joined #RubyOnRails
[05:14:38] dionysus69: has joined #RubyOnRails
[05:14:45] DanByc: has joined #RubyOnRails
[05:15:52] rickmasta: has joined #RubyOnRails
[05:17:04] DanByc: has joined #RubyOnRails
[05:18:06] ferr: has joined #RubyOnRails
[05:19:53] pawnbox: has joined #RubyOnRails
[05:21:00] kgrz: has joined #RubyOnRails
[05:21:19] emilkarl: has joined #RubyOnRails
[05:23:38] jenrzzz: has joined #RubyOnRails
[05:23:54] jenrzzz: has joined #RubyOnRails
[05:25:07] DanByc: has joined #RubyOnRails
[05:29:11] pawnbox_: has joined #RubyOnRails
[05:30:23] DanByc: has joined #RubyOnRails
[05:32:12] SPYGAME: has joined #RubyOnRails
[05:34:25] netzfisch: has joined #RubyOnRails
[05:34:36] DanByc: has joined #RubyOnRails
[05:36:24] DanByc: has joined #RubyOnRails
[05:39:06] SPYGAME: hey guys, i'm trying to install ruby 2.3.0-dev via rbenv and i'm getting this error https://gist.github.com/anonymous/c14211b723639a2a66ec9ccbd70660f2
[05:40:20] Radar: spygame: Did you install build-essential first?
[05:41:23] SPYGAME: Radar: i already have it installed, i've been using 2.1.2 and 2.2.1
[05:41:30] Radar: ok, I have no idea.
[05:41:49] Radar: My suggestion at this point would be to nuke rbenv completely and to follow my no-frills guide
[05:41:55] Radar: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
[05:42:04] Radar: uh, the other link: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you//
[05:42:42] moeabdol: has joined #RubyOnRails
[05:44:05] hahuang65: has joined #RubyOnRails
[05:51:14] SPYGAME: thanks Radar will check that
[05:55:08] jenrzzz: has joined #RubyOnRails
[05:55:26] blackmesa: has joined #RubyOnRails
[05:57:25] DanByc: has joined #RubyOnRails
[05:58:46] syndikate: has joined #RubyOnRails
[06:02:00] syndikate: Hello people, will rails migrate automatically once it is deployed?
[06:02:31] syndikate: I mean, I generatea migration in my dev environment, do rake db:migrate, then test it out and deploy
[06:03:05] syndikate: Ohkay, I get it. So what am pushing is the updated code...okay, sorry for the dumb question
[06:03:08] syndikate: Time to get a duck
[06:09:53] syndikate: how are you doing sevenseacat ?
[06:10:01] sevenseacat: syndikate: not bad, and yourself?
[06:10:25] syndikate: bit tired, just feel like taking the day off and having a good sleep and get some massage :P
[06:10:46] JesseH: has joined #RubyOnRails
[06:10:52] syndikate: but yeah, not bad..
[06:11:00] dandaman: has joined #RubyOnRails
[06:11:08] dandaman: hey there, anyone awake?
[06:11:19] syndikate: not realy, but yeah go on :D
[06:11:47] dandaman: got a question that might have more to do with ruby
[06:12:10] sevenseacat: mmm sleeping and massage
[06:12:18] sevenseacat: nope, the work must go on!
[06:12:36] dandaman: so i've got this code
[06:12:36] dandaman: https://gist.github.com/dsauerbrun/e9449bc897e67c6da21ddc8d4c530bba
[06:12:53] dandaman: sometimes page_end is greater than the length of the array
[06:13:08] dandaman: which causes an error
[06:13:15] syndikate: sevenseacat, heavenly combination it is, I might have spoke about in the wrong order though...but yeah work must go on :\
[06:13:40] dandaman: I'm not entirely sure what the best way of doing this in ruby is, but i want that iterator to stop once it maxes out
[06:13:55] sevenseacat: and the error is?
[06:14:11] dandaman: undefined method `each' for nil:NilClass
[06:14:19] phredus: has joined #RubyOnRails
[06:14:37] scepticulous: has joined #RubyOnRails
[06:14:43] dandaman: i suppose it really means "array out of bounds" or something liek that
[06:14:46] Radar: what is location_filter
[06:14:55] Radar: dandaman: [1,2,3][4] returns what
[06:15:08] sevenseacat: dandaman: no, it means the location_filter[] is giving you nils
[06:15:08] dandaman: Radar: a collection of things from active record
[06:15:19] Radar: dandaman: No, this has nothing to do with active record
[06:15:26] Radar: dandaman: What does [1,2,3][4] return?
[06:15:32] sevenseacat: I think the filtering would be best done at the DB level if it is indeed an AR object
[06:15:41] Radar: dandaman: also, what does { name: "Dan" }[:age] return?
[06:16:11] syndikate: I guess he need to limit the index to -1 of the page_end
[06:16:13] dandaman: sevenseacat: yeah, i need the unpaginated list as well as the paginated list though
[06:16:30] dandaman: Radar: not familiar with that syntax :\
[06:16:49] sevenseacat: and why are we reinventing pagination instead of using existing libraries
[06:17:10] dandaman: because i want to learn how to do it
[06:17:29] dandaman: I'm still trying to become proficient with ruby
[06:17:54] sevenseacat: then I think you should learn what { name: "Dan"}[:age] syntax is
[06:18:38] dandaman: sevenseacat: you're creating an object with name dan and then trying to access the age attribute
[06:18:44] dandaman: but the age attribute doens't exist in the object
[06:18:52] Radar: close enough
[06:19:03] sevenseacat: so what does it return?
[06:19:04] Radar: dandaman: So what does it return?
[06:19:08] Radar: sevenseacat: SNAP
[06:19:50] Radar: dandaman: no, that's JS.
[06:20:01] Radar: What does it return in Ruby? Try running that code we just gave you in IRB
[06:20:04] Radar: { name: "Dan"}[:age]
[06:21:00] dandaman: i mean, i know that accessing index 20 in an array with 15 items wont work, i know that the issue is
[06:21:19] dandaman: im just wondering what the best way, syntactically, is to handle the issue in ruby
[06:21:41] syndikate: just put a check if the next index is out of range
[06:21:44] arBmind: has joined #RubyOnRails
[06:21:56] dandaman: syndikate: i know, but where? look at the gist
[06:22:13] Radar: dandaman: Don't call .each if the thing you're calling .each on is going to be ni]\
[06:22:17] dandaman: is there some checker I can user with .each where i check that it isn't nil?
[06:22:19] yfeldblum: has joined #RubyOnRails
[06:22:46] syndikate: that is a method which checks if it is nil
[06:23:16] syndikate: object.nil? r
[06:23:20] syndikate: object.nil? *
[06:23:23] syndikate: returns boolean
[06:23:26] dandaman: *sigh* I'm just going to make page_end = page_end > location_filter.length ? location_filter.length:page_end
[06:23:40] dandaman: i just was hoping there was a better way
[06:23:59] Radar: dandaman: Store location_filter[page_start..page_end] in a variable.
[06:24:10] Radar: If that is nil, then don't set locations_json or locations_return.
[06:24:20] Radar: Again: it'd be really nice to see what location_filter is.
[06:24:38] baweaver: nil || sane_default_value
[06:25:01] baweaver: or Array(nil)
[06:25:04] sevenseacat: don't think thats a good idea in context of pagination
[06:25:09] dandaman: Radar: https://gist.github.com/dsauerbrun/78455f7a85a7bf4dc0479738ad07c1f5
[06:25:44] sevenseacat: so its an array?
[06:26:21] Radar: My bad, I had thought it was a hash for some stupid reason. Probably because it's past 4pm and my brain turns to mush.
[06:26:39] dandaman: correct sevenseacat
[06:26:44] sevenseacat: dandaman: no, incorrect.
[06:26:57] DoctorMonocular: has joined #RubyOnRails
[06:27:00] sevenseacat: it's an ActiveRecord::Relation.
[06:27:29] Radar: dandaman: What does [1,2,3,4][8..10] return?
[06:27:51] srinidhi: has joined #RubyOnRails
[06:28:26] syndikate: He needs to control the index I believe
[06:28:34] syndikate: which relies on the length of location filter
[06:29:20] datanoise: has joined #RubyOnRails
[06:29:59] dandaman: syndikate: correct
[06:30:09] dandaman: any tips on the best way to handle that?
[06:30:33] Radar: [16:24:35] <Radar> dandaman: Store location_filter[page_start..page_end] in a variable.
[06:30:35] Radar: [16:24:46] <Radar> If that is nil, then don't set locations_json or locations_return.
[06:31:06] jeromelanteri: from gem closure_tree, how to choose only some columns instead of all columns ? for example, if i do @album.descendants.to_json, i have all columns name... imagine i would like only column "id" and column "title" ?
[06:31:19] dandaman: Radar: sorry, its late here… brain is mush as well :\
[06:32:47] idefine: has joined #RubyOnRails
[06:38:28] jeromelanteri: i try to do preselection by vselected_var = Travail.select('title', 'id').where(:id params[:id]) and on this, @my_tree = selected_var.descendants.to_json
[06:39:01] jeromelanteri: then i have an answer who is an array of array. if i just not use selection, i have an harray of hash
[06:39:34] jeromelanteri: i would like answer is an arrays of hash in json format, with 'titl' and 'id' column contents. Possible ?
[06:40:09] Pazician: has joined #RubyOnRails
[06:40:22] jeromelanteri: https://mceachen.github.io/closure_tree/#nested-hashes
[06:44:02] mark_66: has joined #RubyOnRails
[06:44:46] jeromelanteri: hey there, anyone awake?
[06:45:54] ddv: not yet
[06:46:14] jeromelanteri: ddv, thank you for your answer, i appreciate.
[06:46:19] ddv: no problem
[06:46:31] Radar: jeromelanteri: If you want to customise the response of to_json then I would recommend looking at jbuilder.
[06:46:31] jeromelanteri: yes i have a problem.
[06:46:45] jeromelanteri: ok Radar, thank you
[06:47:00] jeromelanteri: sevencat, thank you to...
[06:47:17] jeromelanteri: sevenseacat, sorry... thank you to.
[06:49:01] Wingar: has joined #RubyOnRails
[06:49:04] conta: has joined #RubyOnRails
[06:49:28] DoubleMalt: has joined #RubyOnRails
[06:49:36] conta: Hi, is it still advised to use has_many :through over has_and_belongs_to_many
[06:49:58] ur5us: has joined #RubyOnRails
[06:50:02] jeromelanteri: conta, loks like not 'over'
[06:50:07] sevenseacat: it was never advised to use one over the other. use what is appropriate for your requirements.
[06:50:08] conta: I have Page model and Document model, and I wanna many to many
[06:50:40] conta: I see many articles on net where they say: "never use HABTM"
[06:50:48] sevenseacat: I would disregard those articles.
[06:51:09] jeromelanteri: conta, i have same, and use for have delete cascading the model for intermediate table, and then do has_many and belogns_to...
[06:52:36] jeromelanteri: conta, for example: A has_many :C through: :B B belongs_to :A B belongs_to C C has_many A, through :B
[06:53:06] jeromelanteri: conta i don't know if this help and be clear...
[06:53:06] hahuang65: has joined #RubyOnRails
[06:53:27] conta: I think I should use HABTM, I only wanna know what file is to be with what page
[06:53:51] sevenseacat: then go for it
[06:54:13] duncannz: has joined #RubyOnRails
[06:54:41] jeromelanteri: conta or directly A has_and_belongs_to_many B (no need model for table C if no special things... but also cascading things should woks on database side also... maybe)
[06:54:45] artto: has joined #RubyOnRails
[06:55:03] pawnbox: has joined #RubyOnRails
[06:55:06] duncannz: has joined #RubyOnRails
[06:55:23] conta: Yess, that's for HABTM is, I believe
[06:56:01] duncannz: has joined #RubyOnRails
[06:56:16] jeromelanteri: conta, but i'm not sure to well undersatnd what you want to do at final use. And then my rails experience is little.
[06:56:27] baash05: has joined #RubyOnRails
[06:56:54] baash05: Hey all.. I have a custom validation that hits an external api..
[06:57:06] baash05: To validate a business number is active..
[06:57:41] baash05: I am wondering if I can get a handle on the validation object BusinessNumberValidator in the after valid
[06:57:46] conta: <jeromelanteri> Right now, it's just Page and Documents (files). One Page can have more docs, one docs can be on different pages. Should be has_and_belongs_to_many ;]
[06:58:18] blackmesa: has joined #RubyOnRails
[06:59:01] baash05: The reason I ask is because the external api comes back with some data that could be useful.
[06:59:07] jeromelanteri: conta: no, just page has_many :docs should work. and for other model (said for example articles) artcile has_many docs...
[06:59:41] jeromelanteri: conta that's all normally.
[06:59:59] conta: It's just these 2 models
[07:00:24] universa1: conta: so: one doc can belong to many pages, and one page can have many docs...
[07:00:50] jeromelanteri: baash05, i don't know
[07:00:56] universa1: conta: so you need an n-to-m association
[07:01:16] universa1: conta: a many to many one, there are two options in rails, habtm and has_many, through
[07:01:34] baash05: I don't want to hit the end point more than once, but at the same time it's really a validation step..
[07:01:58] conta: universal yes, that was my first question: which one to use, because I read articles saying never to use HABTM
[07:02:17] baash05: Checking a business number also returns if they support GST. and that's handy when I have to decide to show that business number to other people.
[07:02:22] universa1: conta: if you were never to use it, it would not be in.
[07:02:33] conta: I guess :D
[07:02:33] czerasz2: has joined #RubyOnRails
[07:02:41] universa1: conta: does your association have attributes? like a rank/order ?
[07:03:13] conta: Right now it has nothing, so I am going with HABTM
[07:03:13] jeromelanteri: conta, maybe you truncate a part of the article ? maybe there is some special situation to "never" use it. wich article (i'm interested to learn things) ?
[07:04:26] conta: http://jeffthomas.xyz/many-to-many-relationships-in-rails http://blog.flatironschool.com/why-you-dont-need-has-and-belongs-to-many/
[07:04:27] baash05: I'm thinking that the after_validation would be a great place to set the values gst_enabled_business_number... because I've just gone out to the end point
[07:05:55] comrad: has joined #RubyOnRails
[07:06:48] GriffinH_: has joined #RubyOnRails
[07:06:49] jeromelanteri: conbta, yes, first link said HMT is more flexible. Then "advise against' is maybe a wrong formulation (i can not see any reason for that, but the sentence after is maybe the reason invoqued)... so maybe the man write the article is someone like me who don't know to write english well...
[07:07:31] rbr: has joined #RubyOnRails
[07:08:05] jeromelanteri: conta, the second article is like "extremist" way of thinking maybe... or a joke i don't know, i not really understand the style of sentence. Maybe there is some "Guru people style" sometimes.
[07:08:30] conta: People have opinions ;]
[07:08:55] jeromelanteri: conta, sure... i think so
[07:09:24] jeromelanteri: conta, but many times, some other "who know every thing" doens't like opinions...
[07:09:55] universa1: conta: second article: o0 ... one can easily transform a habtm into a has many through if need be.
[07:12:15] jeromelanteri: conta, maybe by 'don't need' is a sentence like in french vocabulary for said that: you do not really absolutly need... it is a feature... or something like that. ("to need" seems to be, in french translation for example, a way by the fact "you absolutly have to go by")
[07:13:17] jeromelanteri: so yu do not need is that "you can do by other way". But i'm nbot english, many times i not really sure to well understand the sentences constructions.
[07:13:24] DriesS: has joined #RubyOnRails
[07:13:33] conta: could be ;]
[07:14:48] jeromelanteri: jbuilder is a gem included in rails framework or need to add the gem ? i'm not sure...
[07:15:09] aganov: has joined #RubyOnRails
[07:16:00] jeromelanteri: it is maybe a stupid question but... json is constructed in rails by the jbuilder or an other tool ?
[07:16:32] w09x: has joined #RubyOnRails
[07:18:05] Radar: You need to add the jbuilder gem.
[07:18:08] Radar: to your Gemfile
[07:18:09] emilkarl: has joined #RubyOnRails
[07:18:31] artto: has joined #RubyOnRails
[07:22:17] darutoko: has joined #RubyOnRails
[07:24:04] jeromelanteri: Radar, ho ok, that is why... it doesn't work lol. and method (for example i try to def to_tree should be construct on model i think ?
[07:24:47] artto: has joined #RubyOnRails
[07:26:38] Radar: hometime, byebye
[07:26:45] norc: has joined #RubyOnRails
[07:26:53] artto: has joined #RubyOnRails
[07:28:05] DanByc: has joined #RubyOnRails
[07:29:36] gingray: has joined #RubyOnRails
[07:30:44] edwinvdgraaf: has joined #RubyOnRails
[07:35:18] GriffinHeart: has joined #RubyOnRails
[07:35:31] artto: has joined #RubyOnRails
[07:37:16] DanByc: has joined #RubyOnRails
[07:39:08] TvL2386: has joined #RubyOnRails
[07:39:58] jeromelanteri: i make running Jbuilder from a model member, then i have selected columns output, but i'm steal unable to find how to make array of hash instead of have array of array... then the gem doc show many views codes, and only one class side code... so i'm confuse. If someone know and also want to share his know on that... i would be very happy. Thank you
[07:41:12] yfeldblum: has joined #RubyOnRails
[07:41:22] jeromelanteri: i try to do that for be able to show a tree view inside a jquery tree viewer (jqtree)
[07:44:46] DanByc: has joined #RubyOnRails
[07:44:59] snowy: has joined #RubyOnRails
[07:45:58] universa1: jeromelanteri: !code
[07:45:58] helpa: jeromelanteri: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[07:46:39] pabloh: has joined #RubyOnRails
[07:47:51] DanByc: has joined #RubyOnRails
[07:53:37] artto: has joined #RubyOnRails
[07:53:47] jeromelanteri: universa1, https://gist.github.com/jerome-diver/190111b99cb40b42f0cb5d269eb52aa8
[07:54:31] jeromelanteri: universal (line 26 has to be commented...)
[07:54:43] universa1: jeromelanteri: https://gist.github.com/universal/00cfb818a10b505d554dba7958e4867c
[07:54:50] universa1: jeromelanteri: full code!
[07:54:54] ql6wlld: has joined #RubyOnRails
[07:55:06] pLaToOn: has joined #RubyOnRails
[07:55:24] jeromelanteri: universa1, very nice !
[07:55:33] GriffinHeart: has joined #RubyOnRails
[07:55:42] jeromelanteri: universa1, you want the full code ? that is ?
[07:56:07] kies: has joined #RubyOnRails
[07:56:25] universa1: jeromelanteri: https://github.com/rails/jbuilder -- see the comments exampole at the top
[07:57:16] jeromelanteri: universal, i read it yes... but it is view side code...
[07:58:04] universa1: jeromelanteri: substitute json with build and i'm fairly certain it would work the same!
[07:58:28] jeromelanteri: universal, i'm going to try it...
[07:59:02] universa1: jeromelanteri: You can either use Jbuilder stand-alone or directly as an ActionView template language. When required in Rails, you can create views ala show.json.jbuilder (the json is already yielded):
[07:59:02] universa1: # Any helpers available to views are available to the builder
[07:59:18] universa1: ohh nm, wrong context...
[07:59:40] blackmesa: has joined #RubyOnRails
[08:00:13] jeromelanteri: universa1, i trying it but no luck... build instead of json. failed, build. instead of json. failed to.
[08:00:25] Ergo: has joined #RubyOnRails
[08:00:29] universa1: show what you tried, how it failed...
[08:02:38] adre: has joined #RubyOnRails
[08:03:29] yottanami: has joined #RubyOnRails
[08:03:49] sevenseacat: has joined #RubyOnRails
[08:04:20] jsrn: has joined #RubyOnRails
[08:05:14] yottanami: I am using Rails 4.0.0 and I tried to require a file in lib/ext/string using `require 'ext/string` in config/application but I got `require': cannot load such file -- ext/string` error
[08:05:52] lightt: has joined #RubyOnRails
[08:05:54] jeromelanteri: universa1, https://gist.github.com/jerome-diver/0f90cf42eda8816c294c61f355e76566
[08:05:56] yottanami: How can I require that file, my Rails version is 4.0.5
[08:06:36] universa1: jeromelanteri: https://gist.github.com/jerome-diver/0f90cf42eda8816c294c61f355e76566#file-console-view-error-message-L9
[08:06:45] universa1: jeromelanteri: where is line 16?! full files!
[08:07:05] Guest14270: has joined #RubyOnRails
[08:07:33] Guest82080: has joined #RubyOnRails
[08:07:47] jeromelanteri: universa1, bah it is the line 8 in file travails_controller.rb... the line is commented has failed
[08:07:58] universa1: jeromelanteri: gist the actual file!
[08:08:16] jeromelanteri: in the file travils_controller.rb... in the same gist github... just scroll down
[08:08:26] universa1: ok, i asked 3 times... ...i'm out.
[08:08:38] jeromelanteri: universa1, i follow your teach on nivce file separate gist...
[08:08:56] jeromelanteri: universa1, sorry ? i not undersatnd what's happen... what's wrong ?
[08:08:59] paradisaeidae_: has joined #RubyOnRails
[08:09:03] lightt: i thought this room was about model train sets
[08:09:49] TvL2386: has joined #RubyOnRails
[08:11:04] jeromelanteri: lightt, if you undersatnd what's happen, please tell me... it is very strange, i'm confuse.
[08:11:55] lightt: jeromelanteri: hello
[08:12:29] jeromelanteri: lightt, yes i'm fine. thank you.... and you ?
[08:12:45] lightt: fine ty how are u
[08:13:14] AimlessRAven: has joined #RubyOnRails
[08:13:16] AimlessRAven: @admins.accessible_by(current_ability).collect{|u| [u.name, u.id]}
[08:13:20] AimlessRAven: whats here is a query?
[08:14:16] jeromelanteri: AimlessRaven, maybe inside the member "accessible_by there is query ?
[08:14:46] AimlessRAven: jeromelanteri: tnx
[08:14:59] jeromelanteri: AimlessRaven, nice to help you
[08:16:08] artto: has joined #RubyOnRails
[08:16:55] jeromelanteri: ok... if someone able and really want to help...
[08:16:56] jeromelanteri: https://gist.github.com/jerome-diver/0f90cf42eda8816c294c61f355e76566#file-console-view-error-message-L9
[08:18:38] Guest82080: Hello, looking for some help with AR scopes.
[08:18:39] jeromelanteri: (please, don't hurt me because of strong whims or requirements... it is not an obligation to be tight as a nun's ass... lol)
[08:18:54] yottanami: How can I require a file in lib/ in application.rb in Rails 4.0 ?
[08:19:30] Guest82080: I'm getting data with `mongoid` and wonder how to build complex chained queries.
[08:20:30] czerasz: has joined #RubyOnRails
[08:20:32] universa1: jeromelanteri: !rules
[08:20:32] helpa: jeromelanteri: https://gist.github.com/996779
[08:20:40] jeromelanteri: yottanami, i think you maybe need to go by relative indication from the source file who require the other one (like../../../lib/ext/blablabla"
[08:20:41] universa1: jeromelanteri: i asked you to gist the actual, full file 3 times...
[08:21:04] universa1: jeromelanteri: since you are unable to do that, i'm not going to spend my time anymore on solving your problems.
[08:21:30] universa1: jeromelanteri: and your stupid pm just made you a member of my ignore list.
[08:21:36] yottanami: jeromelanteri, `require File.expand_path('../../lib/ext/string', __FILE__)` helpe
[08:21:39] jeromelanteri: universa1, actual file is the full file ? because i send the actual file where is the problem line... if you wxant the FULL source file, i'm sorry, i not understand this... kepop calm down.
[08:21:52] jenrzzz: has joined #RubyOnRails
[08:22:26] jeromelanteri: universa1, my pm tell you to hope you will fell better... why be so agressive and stupid ? serve what ? you are seek my friend, go see doctor.
[08:23:24] mark_66: has joined #RubyOnRails
[08:23:39] jeromelanteri: wtf... some people crazy here... just open your fucking eyes... the line error was inside and commented... crazy fucking pretentiu=ous guru.
[08:24:23] tvw: has joined #RubyOnRails
[08:25:02] sevenseacat: jeromelanteri: settle down.
[08:25:24] jeromelanteri: sevenseacat, yes, sorry... i'm just shoked by this kind of relations...
[08:25:39] jeromelanteri: sorry every body for be nervous back to.
[08:25:47] sevenseacat: jeromelanteri: if you were following the channel rules, you would not be shocked.
[08:25:59] jeromelanteri: sevenseacat, why ?
[08:26:10] sevenseacat: because you wouldnt be pissing people off.
[08:26:29] jeromelanteri: sevenseacat, "pissing people off" ? you see that on writing sentences ?
[08:26:39] jeromelanteri: you feel it like that really ?
[08:26:46] sevenseacat: jeromelanteri: I've asked you to settle down. I won't do it again.
[08:27:11] qejk: has joined #RubyOnRails
[08:27:12] jeromelanteri: i just try to understand, i'm settle down now.
[08:27:23] sevenseacat: good. you've been warned.
[08:27:36] tildes: jeromelanteri: not sure if you should call build in the controller, also jbuilder examples here mention to_builder method instead of to_tree https://github.com/rails/jbuilder
[08:28:25] jeromelanteri: but i really want to understand, maybe my english sentence construction is wrong... but when and why ? i'm french guy... try to show me what's wrong, i don't want to hurt people, i really not understand what's happened.
[08:28:49] tildes: even with with my 0,1% jbuilder knowledge I'm tempted to ask, if you are using it right
[08:28:58] jeromelanteri: tildes, ho yes, i just try to learn this...
[08:29:51] tildes: jeromelanteri: maybe read the docs and find a good tutorial?
[08:30:00] jeromelanteri: tildes, i followed this code about "to_build" and do my own "to_tree" from there... that's it.
[08:30:27] jeromelanteri: tildes, yes i read the doc 5 times... also, universal had problem too...
[08:30:41] tildes: jeromelanteri: so you know for fact that jbuilder knows how to hook with to_tree?
[08:30:47] ferr: has joined #RubyOnRails
[08:30:57] tildes: my first guess, again with 0,1% jbuilder knowledge is, that it assumes a to_build hook
[08:30:59] tildes: and builds on that
[08:31:05] tildes: ^fromt that
[08:31:13] jeromelanteri: syes, if you click on my gist github pasted codes, you would see the code targeted by this...
[08:31:44] jeromelanteri: tildes, build from the indications share by the doc yes. Look at the gist file in the model.
[08:32:01] jeromelanteri: tildes, https://gist.github.com/jerome-diver/0f90cf42eda8816c294c61f355e76566#file-console-view-error-message-L9
[08:32:16] tildes: what I want to say, is try to get some standard way of using it work first
[08:32:18] Guest82080: Hello, is nested scopes supposed to work with 'mongoid' please?
[08:32:19] jeromelanteri: tildes, the model part of ile concerned is inside file traail.rb
[08:32:31] jeromelanteri: tildes, hooo... ok...
[08:32:47] tildes: jeromelanteri: yes, I took a look, but again I haven't used jbuilder myself, so I can only do guesswork
[08:32:58] tildes: and the first thing I notice, is that you try to do something different from the docs
[08:33:13] triptec: has joined #RubyOnRails
[08:33:14] tildes: while it may work, it might not be the smoothest way to a working solution, when you are just trying out
[08:33:24] jeromelanteri: tildes, yes, i done it allready, but the way i try (need) to use it has no model example shown by the doc. I think it is intented to allready have some basic knowledge on Rails framework CoC sentences.
[08:33:43] tildes: CoC sentences?
[08:34:00] jeromelanteri: tildes, but to_tree, when pass after @travil, justr work has intended also.
[08:34:23] jeromelanteri: tildes, yes, conventions of coding and understand links in code construction
[08:34:56] tildes: jeromelanteri: if you just need json, the simplest thing is to start with http://guides.rubyonrails.org/layouts_and_rendering.html#using-render, see render json, and specify a to_json method for Travail
[08:34:58] lightt: hello everyone! how are u? fine ty
[08:34:59] jeromelanteri: so the def to_tree member function is working, but for the use i need it is not the good way. that is my problem.
[08:35:11] tildes: the second simplest thing, in my opinion, is active model serializer
[08:35:49] jeromelanteri: tildes, in fact, as i said, i need it for use with jquery tree viewer... who is inside the gist i pasted... on travails.coffee
[08:36:17] jeromelanteri: tildes, model serializer ? ho maybe... what is that ?
[08:36:33] tildes: jeromelanteri: ok, that I know even less of. have no idea how you will integrate all that, or even why
[08:36:43] jeromelanteri: tildes, http://mbraak.github.io/jqTree/
[08:37:29] jeromelanteri: tildes, yes sure... it is for render a nice tree view of model structured tree (structured tree by gem closure_tree)
[08:37:30] weckl: has joined #RubyOnRails
[08:37:47] jeromelanteri: with this jquery tree viewer
[08:38:36] blackmesa: has joined #RubyOnRails
[08:38:53] jeromelanteri: i can give him (with gem gon for go easy share variable) datas, but he wants array of hash json datas, instead of my array of array that ruby make by default. And i pain for just change format of variable.
[08:38:59] weckl: has joined #RubyOnRails
[08:39:53] weckl: has joined #RubyOnRails
[08:40:44] weckl: has joined #RubyOnRails
[08:41:51] jeromelanteri: Guest82080, i don't know, i looking quickly on duckduckgo (like you done i think), but informations i read was old... and use a gem for that, so...
[08:41:55] Ergo^: has joined #RubyOnRails
[08:42:25] jeromelanteri: Guest82080, maybe ask on rails devs directly should be a good idea ?
[08:43:36] Guest82080: jeromelanteri: just came from #ruby :) Looking into mongoid docs. Found some answers on chained/nested scopes. Going well so far :) Thanks for reply :+1
[08:43:58] jeromelanteri: sevenseacat, ok then... what was wrong in my sentences ? you said your felling was that i "pissed off". i always in state of currently not undersatnd why this feeling. I would like to understand because i think it is iportant.
[08:44:08] GriffinHeart: has joined #RubyOnRails
[08:44:19] jeromelanteri: Guest82080, happy, enjoy.
[08:44:28] sevenseacat: jeromelanteri: if you ask people for help, and they ask you for information, provide it.
[08:45:20] jeromelanteri: sevenseacat, yes but if i not really understand or have confusion in the communication and the question is allways the same or no answer when i ask precision for be sure to well understand, how is it possible to go ? is it all my fault ?
[08:45:26] sevenseacat: jeromelanteri: if you refuse or get grumpy, then people are going to ignore you and move on.
[08:45:32] lightt: has joined #RubyOnRails
[08:45:55] jeromelanteri: sevenseacat, sure. I try again to understand WHERE i was "grumpy" (a new word for me again)
[08:46:13] sevenseacat: [16:23:39] jeromelanteri: wtf... some people crazy here... just open your fucking eyes... the line error was inside and commented... crazy fucking pretentiu=ous guru.
[08:47:07] jeromelanteri: i think it is difficult when writing, because you not see people and there smile, how much they can be friendly and have humour... that is my feeling, because in my life, i never has this problem all around the world i went... with no one, same in, con,flict area or in holliday or at work.
[08:47:29] sevenseacat: jeromelanteri: I'm not interested in continuing this conversation.
[08:47:36] jeromelanteri: sevenseacat, yes, you show me my last reaction... why choose to cut what show me after the war ?
[08:47:46] AlexJakeGreen: has joined #RubyOnRails
[08:48:49] jeromelanteri: sevenseacat, hooo... thank you, i think i understand the target by your communication: put me all the wrong things on my back and never explain me why or try to understand. bye...
[08:50:52] Spami_: has joined #RubyOnRails
[08:52:18] jeromelanteri: has left #RubyOnRails: ("Leaving")
[08:52:25] ferr: https://gist.github.com/Fercell/db9f190310d15acc0f15a2d8eb85dad1 How do I use ransack? Anything I pass it gives me all records
[08:52:37] syndikate: has joined #RubyOnRails
[08:55:39] DanByc: has joined #RubyOnRails
[08:56:41] triptec: has joined #RubyOnRails
[08:58:20] pawnbox: has joined #RubyOnRails
[08:58:46] artto: has joined #RubyOnRails
[09:01:15] GriffinHeart: has joined #RubyOnRails
[09:02:27] DanByc: has joined #RubyOnRails
[09:04:44] eGGshke: has joined #RubyOnRails
[09:10:00] DanByc: has joined #RubyOnRails
[09:10:34] Guest14270: has joined #RubyOnRails
[09:13:28] lxsameer: has joined #RubyOnRails
[09:15:20] GriffinHeart: has joined #RubyOnRails
[09:16:18] norc: has joined #RubyOnRails
[09:16:25] sinpai: has joined #RubyOnRails
[09:19:02] workmad3: has joined #RubyOnRails
[09:19:46] AntiSpamMeta: has joined #RubyOnRails
[09:24:02] Circuit8: has joined #RubyOnRails
[09:25:15] DanByc: has joined #RubyOnRails
[09:26:34] acosonic_: has joined #RubyOnRails
[09:27:21] acosonic_: hi, is there something like this http://stackoverflow.com/questions/4223980/the-ultimate-clean-secure-function for rails? or Ruby?
[09:28:16] sevenseacat: first line of the first answer - "The idea of a generic sanitation function is a broken concept."
[09:29:36] acosonic_: sevenseacat: yes, but then, how to solve this problem http://www.redmine.org/issues/22897#change-71193
[09:30:26] sevenseacat: i stay far away from redmine, so i cant answer that.
[09:31:28] sevenseacat: Gregor Schmidt's comment seems to imply there is no problem
[09:31:41] sevenseacat: because you just shouldnt include html inside that block in the first place
[09:36:03] arBmind: has joined #RubyOnRails
[09:40:01] artto: has joined #RubyOnRails
[09:40:26] allcentury: has joined #RubyOnRails
[09:40:47] w09x: has joined #RubyOnRails
[09:42:00] DanByc: has joined #RubyOnRails
[09:42:40] acosonic_: has joined #RubyOnRails
[09:43:01] arup_r: has joined #RubyOnRails
[09:44:21] arup_r: I have config.cache_classes = false in my development.rb file, still I need to restart the webserver to reflect the changes whenever I change any model/controller/views etc code. Why any idea?
[09:44:26] arup_r: I am Rails 4.2.6
[09:46:12] norc: arup_r: Verify that your server has that configuration set.
[09:46:35] norc: By that I mean Rails.application.config
[09:46:57] norc: (Who knows how many config files and initializers you load that might change that setting later on)
[09:47:27] arup_r: yes it is `false`
[09:47:33] norc: Do you have spring running?
[09:47:54] Guest683: has joined #RubyOnRails
[09:48:03] ksmutthu: has joined #RubyOnRails
[09:49:34] arup_r: I am not using spring ..
[09:49:51] arup_r: I don't have included that in Gemfile
[09:50:11] universa1: do you use any other preloader?
[09:50:24] universa1: how did you verify that it is false? ;;)
[09:50:39] universa1: is your server running in dev mode? ;)
[09:51:01] arup_r: universa1: 1.9.3-p551 :001 > Rails.application.config.cache_classes # flase
[09:51:14] arup_r: yes it is in dev mode
[09:51:14] norc: arup_r: Perhaps your web server is running in a different environment?
[09:51:31] norc: arup_r: Also note. 1.9.3 is grossly outdated.
[09:52:02] arup_r: I know, they asked me, we will in 1.9.3 .. they don't to upgrade ruby right now
[09:52:37] norc: arup_r: The issue is that if you have an issue, we cannot even say whether it might be because of your Ruby version, considering the huge chunk of gems and native extensions flying around.
[09:52:47] universa1: well, i'd close all terminals and restart the server and check if the behaviour persists. if it does, restart the computer and check again, if it still persists there is something weird going on.
[09:52:58] norc: Restarting the computer seems a bit extreme.
[09:53:06] norc: arup_r: You didn't answer universa1's question.
[09:53:10] norc: Do you have any other preloader running?
[09:53:13] norc: Zeus? Something else?
[09:53:15] arup_r: I have 1 terminal open universa1
[09:53:29] arup_r: norc: no there is no preloader
[09:53:29] norc: arup_r: And the lack of "spring" in your Gemfile means nothing by the way.
[09:53:31] universa1: and also triple check, that the server on startup announces it is running in dev mode ;;)
[09:54:17] norc: arup_r: Unless you prove to me that you use "bundle exec" for *every* rails/rake command.
[09:54:26] Ergo: has joined #RubyOnRails
[09:54:35] arup_r: universa1: => Rails 4.2.6 application starting in development on http://localhost:3000
[09:54:51] arup_r: I used *rails s*
[09:55:00] universa1: arup_r: ok, try spring status
[09:55:12] norc: arup_r: Let this be the last day you ever do that. From now on you will only invoke rails and rake with "bundle exec"
[09:55:13] norc: Seriously.
[09:55:15] arup_r: -bash: spring: command not found
[09:55:19] srinidhi: has joined #RubyOnRails
[09:55:22] arup_r: universa1: ^ I don't have it, I know
[09:55:28] norc: arup_r: If that is too much to type, use a bash alias be=bundle exec
[09:55:47] norc: arup_r: Restart the server with bundle, see if the problem persists.
[09:56:03] universa1: arup_r: ok, so if you open localhost:3000 now, and add a raise to your index action, do you see the error?
[09:56:12] universa1: and what norc said first ;)
[09:56:32] GreekFreak: has joined #RubyOnRails
[09:56:37] antgel: has joined #RubyOnRails
[09:56:42] norc: Hello GreekFreak!
[09:56:44] arup_r: No I don't see the error
[09:57:11] norc: arup_r: You still haven't answered the question about a preloader.
[09:57:15] universa1: arup_r: you added it to the action the log says it rendered? just making sure
[09:57:17] norc: Do you have another preloader running, like Zeus?
[09:57:23] GreekFreak: I have recently updated MySQL and I keep getting an error with sql_mode=only_full_group_by Is there a rails way in solving this? Should I disable it in MySQL directly?
[09:57:26] universa1: norc: he has, there is none ;)
[09:57:37] norc: universa1: Oh my bad!
[09:58:04] norc: GreekFreak: https://github.com/rails/rails/issues/17370
[09:58:21] arup_r: universa1: I see `rails s` boots thing, not Webrick .. Any chance this is the issue?
[09:58:57] norc: That should be unrelated I think.
[09:59:58] RegulationD: has joined #RubyOnRails
[10:00:16] norc: arup_r: gist your config/application.rb, config/environment.rb and config/environments/development.rb
[10:01:10] universa1: arup_r: to check if it related to thin: bundle exec rails s webrick
[10:01:13] GreekFreak: norc, I've read that and tried adding "strict: default" to my adapter and it still throws that error (and yes, I did restart the server)
[10:01:28] GreekFreak: I meant "strict: :default"
[10:02:11] norc: GreekFreak: The idea is to turn strict off, not on. ;)
[10:02:28] arup_r: universa1: ok, trying. norc https://gist.github.com/aruprakshit/09086b1a318e7254a7b54f354750abef
[10:02:40] norc: GreekFreak: Though I think you might have to configure MySQL accordingly.
[10:03:41] arup_r: universa1: nah, it is not webrice or thin .. it is something else, I dunno.
[10:04:02] GreekFreak: norc, I just tried with "strict: false" and it still didn't work
[10:04:30] universa1: arup_r: try adding the output Rails.application.config.cache_classes to your layout, maybe something is overwriting it there...
[10:04:32] tvw: has joined #RubyOnRails
[10:04:46] GreekFreak: norc, I read some stuff about changing the global configuration of MySQL but I wanted to check here first before I messed with that
[10:05:22] datanoise: has joined #RubyOnRails
[10:06:04] arup_r: it is false.
[10:06:36] norc: GreekFreak: show us your exact error message and the code that provoked it.
[10:06:37] universa1: arup_r: tried a different browser? ;) somewhat clueless right now
[10:06:46] arup_r: no.. doing now
[10:07:23] antgel: has joined #RubyOnRails
[10:07:32] norc: arup_r: So if you modify actions of existing controllers for example, the change is not immediate?
[10:07:37] GreekFreak: norc, Mysql2::Error: In aggregated query without GROUP BY, expression #2 of SELECT list contains nonaggregated column 'bluverve_development.address_book_associations.id'; this is incompatible with sql_mode=only_full_group_by: [AND THEN THE SQL CODE]
[10:07:42] arup_r: norc: yes
[10:08:02] arup_r: I had to restart everytime the webserver..
[10:08:15] norc: GreekFreak: Show the entire SQL query and the ActiveRecord code that provoked it.
[10:08:21] arup_r: which is not the case in development env, by defauly AFAIK
[10:08:31] alaing: has joined #RubyOnRails
[10:08:54] alaing: has joined #RubyOnRails
[10:09:08] norc: arup_r: Also gist your Gemfile please.
[10:09:17] norc: Perhaps you have some funky middleware in Rack.
[10:09:32] idefine: has joined #RubyOnRails
[10:09:36] GriffinHeart: has joined #RubyOnRails
[10:09:58] arup_r: added https://gist.github.com/aruprakshit/09086b1a318e7254a7b54f354750abef#file-gemfile
[10:10:06] alaing: hi where is good place to store temporary uploaded files? I'm using Paperclip gem and thinking of storing them temporary on the server until the user creates the final record and then upload that file to S3
[10:11:11] norc: arup_r: tell me, am I seeing things like actionpack-action_caching there?
[10:11:28] norc: arup_r: show me your rails log for a request after modifying an action.
[10:12:09] norc: I want to find out whether you are hitting another cache mechanism that prevents the action altogether.
[10:12:26] GreekFreak: norc, this is the class and the error: https://gist.github.com/tscholiadis/5d515ff086f1b102139485c12b2d54a0
[10:13:19] arup_r: https://gist.github.com/aruprakshit/09086b1a318e7254a7b54f354750abef#file-server-log
[10:13:24] norc: GreekFreak: You sir by the way, are introducing SQL injection attacks like there is no tomorrow.
[10:13:50] norc: GreekFreak: http://api.rubyonrails.org/classes/ActiveRecord/Sanitization/ClassMethods.html
[10:14:19] norc: GreekFreak: But if you do manual SQL like that and your MySQL server configuration is changed, then you need to modify either your query or your MySQL configuration. Your problem is not Rails related. Try #mysql.
[10:14:33] srinidhi: has joined #RubyOnRails
[10:14:48] norc: arup_r: That was emitted when you hit a reload?
[10:15:58] arup_r: norc: yes
[10:16:47] arup_r: I had this raise Rails.application.config.cache_classes.inspect in view, and now I commented this like, and reloading the page,, but the error remains. Because it is waiting me to restart the server
[10:17:13] GreekFreak: norc, I didn't think I was since the only variable in that query is a variable that I control from the code. What am I missing? Or how could I change the query to be safer? (and just as fast as running the query on MySQL instead of ruby)?
[10:17:23] GreekFreak: I'm asking #mysql now as well
[10:20:01] DanByc: has joined #RubyOnRails
[10:20:16] bbrowning__: has joined #RubyOnRails
[10:22:04] DanByc: has joined #RubyOnRails
[10:23:12] w09x: has joined #RubyOnRails
[10:25:07] rbr: GreekFreak: the solution to the injection-question is already being used elsewhere in that query; placeholders (:company_id)
[10:25:37] rbr: queries*
[10:25:52] c355E3B: has joined #RubyOnRails
[10:27:05] DanByc: has joined #RubyOnRails
[10:28:22] idefine: has joined #RubyOnRails
[10:29:00] lxsameer: has joined #RubyOnRails
[10:30:12] DanByc: has joined #RubyOnRails
[10:34:39] DanByc: has joined #RubyOnRails
[10:36:10] artto: has joined #RubyOnRails
[10:41:56] Ergo: has joined #RubyOnRails
[10:43:15] armyriad: has joined #RubyOnRails
[10:44:27] DanByc: has joined #RubyOnRails
[10:44:40] rodfersou: has joined #RubyOnRails
[10:46:44] Bacta: has joined #RubyOnRails
[10:47:15] Bacta: Is it possible to run rspec controller tests without requiring the rails full stack?
[10:49:12] allcentury: has joined #RubyOnRails
[10:50:25] DanByc: has joined #RubyOnRails
[10:51:57] defsdoor: has joined #RubyOnRails
[10:53:40] srinidhi: has joined #RubyOnRails
[10:54:52] DanByc: has joined #RubyOnRails
[10:55:14] emilkarl: has joined #RubyOnRails
[10:55:36] artto: has joined #RubyOnRails
[10:56:49] DanByc: has joined #RubyOnRails
[10:57:38] ur5us: has joined #RubyOnRails
[10:58:49] DanByc: has joined #RubyOnRails
[11:04:56] tvw: has joined #RubyOnRails
[11:07:40] GreekFreak: norc, the problem could indeed by fixed with better SQL. They helped me out. Thanks for your help
[11:07:44] DriesS: has joined #RubyOnRails
[11:08:57] DanByc: has joined #RubyOnRails
[11:13:39] janebootydoe: has joined #RubyOnRails
[11:16:00] Fernando-Basso: has joined #RubyOnRails
[11:17:12] DanByc: has joined #RubyOnRails
[11:19:53] DanByc: has joined #RubyOnRails
[11:21:35] triptec: has joined #RubyOnRails
[11:22:50] GodFather: has joined #RubyOnRails
[11:23:13] DriesS: has joined #RubyOnRails
[11:25:13] Ropeney: has joined #RubyOnRails
[11:25:27] artto: has joined #RubyOnRails
[11:25:55] emilkarl: has joined #RubyOnRails
[11:26:07] GodFather: has joined #RubyOnRails
[11:28:24] bzi: has joined #RubyOnRails
[11:28:41] artto: has joined #RubyOnRails
[11:28:55] norc: Bacta: Depends on your controller I would say.
[11:28:57] k3rn31: has joined #RubyOnRails
[11:29:32] Bjoern_: has joined #RubyOnRails
[11:29:52] Bjoern_: Hi there, I'm not sure if this is possible. We have a lot of pdfs in the public uploads folder which now need to be dynamically recreated on each request using Prawn. Because all files are already indexed in Google the paths of the documents should not change. By using a custom route I tried to redirect the requests to a controller.
[11:29:59] Bjoern_: Match "/uploads/preview/public_file/:id/:basename.:extension", :controller => "previews", :action => "download", :conditions => { :method => :get }
[11:30:08] Bjoern_: The problem is that if the file exists it gets rendered directly without using the controller
[11:30:16] Bjoern_: I think this is a feature of the middleware to reduce request times
[11:30:21] Bjoern_: Is there a way to get this request passed to my controller?
[11:31:15] norc: Bjoern_: Which rack middleware do you think would be responsible for that?
[11:31:27] King_Rex: has joined #RubyOnRails
[11:32:43] norc: Bjoern_: Easiest solution that comes to mind is not keeping them inside the public folder anymore.
[11:33:02] norc: That will for sure force the dispatch to your controller.
[11:33:56] sergey_makagon: has joined #RubyOnRails
[11:34:15] Bjoern_: norc: Thanks for the tip! this really seems to be the easiest solution. Then I will simply write a rake task which updates the paths to the new folder
[11:35:39] mikecmpbll: has joined #RubyOnRails
[11:37:38] artto: has joined #RubyOnRails
[11:37:49] kies: has joined #RubyOnRails
[11:38:35] ur5us: has joined #RubyOnRails
[11:39:17] ldnunes: has joined #RubyOnRails
[11:39:34] solars: quick question, can anyone tell me how this can cause an endless loop: https://gist.github.com/solars/6cb1e846d61eee845a451faf7e4f9461 I don't have any callbacks that could result in that
[11:40:57] GodFather: has joined #RubyOnRails
[11:41:29] norc: solars: byebug
[11:41:50] norc: Learn it. Learn to love it. Love it.
[11:42:20] solars: how can I detect infinite loops with it?
[11:43:05] norc: solars: using breakpoints, steps, whatever approach suits you best.
[11:43:39] blackmesa: has joined #RubyOnRails
[11:43:41] solars: I don't know where to start stepping
[11:43:51] solars: but I also don't understand why this code can cause an infinite loop
[11:44:01] norc: solars: start inside the method.
[11:44:18] norc: solars: set a breakpoint inside the same method, continue. If it recurses you can see it in the call stack.
[11:46:10] solars: hmm I think it is because AR accesses the attribute to check if it's dirty
[11:47:33] norc: solars: Do you think or does byebug indicate this?
[11:48:28] solars: there is so much output in show-stack that I'm not spotting it at the moment
[11:48:59] tildes: solars: so you have an attribute called used_budget, but also a method for it?
[11:49:26] solars: tildes, yes
[11:49:28] workmaster2n: has joined #RubyOnRails
[11:49:36] tildes: what do you want to achieve with read_attribute(:used_budget)
[11:49:45] solars: tildes, that's the common way to override getters
[11:49:57] solars: or what do you mean?
[11:50:08] tildes: so are you in fact calling the method again, on the last line?
[11:50:19] tildes: there is no exit condition from that
[11:50:31] tildes: and why do you want to override a getter in rails?
[11:50:51] norc: solars: the idea is to force a recursion, and find the frame from inside the same method.
[11:51:06] norc: solars: that frame will tell you a line number, indicating which method starts the recursion. Follow that stack frame.
[11:51:43] solars: tildes, no I'm not calling it again, the purpose is that if used_budget was updated in the last (instead of current) month, it has to be refreshed
[11:51:51] ImmoveableOne: has joined #RubyOnRails
[11:52:37] ImmoveableOne: Is there any way to access a ruby object in a js file?
[11:52:38] tildes: solars: and what happens, if you comment that very line?
[11:53:04] tildes: ImmobeableOne: https://github.com/gazay/gon
[11:53:14] solars: norc, I'm using pry-byebug and I've set the breakpoint in that method, what I get is the trace here: https://gist.github.com/solars/6cb1e846d61eee845a451faf7e4f9461
[11:53:14] cabinB: has joined #RubyOnRails
[11:53:36] solars: tildes, it does not cause the recursion, do you know how to override attributes in rails models?
[11:54:01] cabinB: I have a view using fields_for. I only want to conditionally display the nested records that have a start_date year of 2016.
[11:54:04] cabinB: <%= f.fields_for :planning_events do |pe| %>
[11:54:25] tildes: solars: overriding attributes sounds strange, hope you don't mind me asking, why you must override attributes?
[11:54:38] tildes: solars: also, how do you know, it does not cause the recursion?
[11:54:45] ImmoveableOne: When I click a certain button a certain number on my page updates, I want to show that number changing without reloading the whole page, I suppose tis can be done by using ajax?
[11:54:52] diegoaguilar: has joined #RubyOnRails
[11:55:09] qejk: has joined #RubyOnRails
[11:55:33] maucar: has joined #RubyOnRails
[11:55:57] norc: solars: I would use plain byebug, I have no experience with pry-byebug.
[11:55:57] triptec: has joined #RubyOnRails
[11:55:59] tildes: ImmoveableOne: with ajax if you need something from the server. if you just count and display clicks, that can be done in the browser itself
[11:56:30] norc: solars: There you immediately see line numbers and source files on each stack frame.
[11:56:33] maucar: has joined #RubyOnRails
[11:56:54] solars: tildes, check http://stackoverflow.com/questions/21835116/how-can-i-overwrite-a-getter-method-in-an-activerecord-model
[11:57:37] Ropeney: has joined #RubyOnRails
[11:58:00] hcnewsom: has joined #RubyOnRails
[11:58:07] solars: norc, I assume 'byebug' in the gemfile.. could you quickly what lines you are using for the breakpoints so I can do it in the same way please?
[11:58:26] tildes: solars: is last_calculated an association?
[11:58:36] solars: tildes, it's an attribute
[11:58:44] norc: solars: I think it would be enough to just place a "byebug" at the beginning of the method, run once, and continue until byebug interrupts again
[11:58:50] tildes: solars: is it a belongs_to / has_one attribute?
[11:58:53] norc: solars: Then inspect the backtrace (bt)
[11:58:55] ImmoveableOne: no I'm not counting clicks, a quantity of sort.
[11:58:58] solars: tildes, no
[11:59:02] solars: norc, alright let me try
[11:59:36] ImmoveableOne: tildes: can you point me to an example of something like this being done?
[11:59:42] norc: solars: to reduce headaches set nofullpath before you look at the backtrace.
[12:00:28] solars: norc, thanks :) how do I display the trace?
[12:00:50] norc: solars: "bt" or "where"
[12:00:50] DriesS: has joined #RubyOnRails
[12:00:59] norc: solars: Read up on this by the way : https://github.com/deivid-rodriguez/byebug/blob/master/GUIDE.md
[12:01:04] RegulationD: has joined #RubyOnRails
[12:02:42] solars: norc, thanks will do .. I need to fix this fast so excuse the hurry :) I've added the trace here: https://gist.github.com/solars/6cb1e846d61eee845a451faf7e4f9461 it seems to be similar to the pry output and I have no idea how to avoid that
[12:03:03] norc: solars: #19 ArBudget.used_budget at .../app/models/ar_budget.rb:158
[12:03:11] norc: That is the offending line that forces the recursion.
[12:03:53] norc: solars: by the way, you are doing a common rookie mistake in your assignment there.
[12:04:09] norc: solars: "used_budget = 10" probably does not what you think it does.
[12:04:45] weckl: has joined #RubyOnRails
[12:05:25] solars: but line 158 is the save
[12:05:54] solars: norc, that line is accessing the setter, and I have overridden the getter.. or what did you mean above?
[12:06:41] norc: solars: Are you sure? :)
[12:06:45] tildes: ImmoveableOne: not sure exactly what you are trying too do
[12:06:48] norc: solars: Which setter is that?
[12:06:51] GodFather: has joined #RubyOnRails
[12:07:06] tildes: ImmoveableOne: good starting point http://guides.rubyonrails.org/working_with_javascript_in_rails.html
[12:07:11] norc: solars: Ruby will always interpret (a = 1) as an assignment to a local variable.
[12:07:21] solars: norc, how do you mean? with def used_budget I'm targetting the getter, right? and used_budget = will use the setter
[12:07:31] solars: norc, you mean add self.used_budget?
[12:07:33] tildes: solars: self.used_budget = 10 ?
[12:07:36] norc: solars: nope. Do not think in terms of setter, think in terms of methods.
[12:08:08] norc: solars: either you have to use send(:"used_budged=", 10), or what tildes wrote.
[12:08:18] norc: Your solution will just create a local variable.
[12:08:25] norc: It is a common mistake in Rails, do not feel bad about it.
[12:08:42] kgrz: has joined #RubyOnRails
[12:08:44] solars: wait, let me understand that
[12:09:32] ImmoveableOne: tildes: I click a button, if valid it increases a quantity, I am displaying this quantity on the same page, now the tricky part is I want to see that number being updated without the page reloading, how can I do this?
[12:09:41] artto: has joined #RubyOnRails
[12:10:00] solars: norc, if I do not override that getter, used_budget=10 anywhere in the model is calling the setter, right?
[12:10:11] norc: solars: Nope.
[12:10:13] tildes: ImmoveableOne: what does valid mean, and what is a quantity in your case?
[12:10:16] norc: solars: This is syntax!
[12:10:39] solars: norc, damn then I was mistaken
[12:10:39] norc: solars: If Ruby sees anything that looks like: identifer = 1 - Ruby will *always* create a local variable, and shadow "identifier" with that variable for the duration of the scope.
[12:11:00] norc: solars: and to make things worse, this happens when Ruby lexes the code, which can lead to some surprising behaviour:
[12:11:02] norc: For example:
[12:11:21] norc: solars: def a; puts 1; end; if false; a = 0; end; p a
[12:11:26] norc: put that into irb and be surprised.
[12:11:44] solars: norc, but where does it then call the method, if used as a local var?
[12:11:49] solars: I didn't get that connection
[12:11:55] norc: solars: the method is never called!
[12:12:02] norc: That is my entire point.
[12:12:29] solars: how does it cause the loop then?
[12:12:41] norc: solars: That is what the stack trace can tell you.
[12:12:46] norc: solars: lets look at it together.
[12:12:59] ImmoveableOne: tildes: http://imgur.com/JlPwcxB
[12:13:12] ImmoveableOne: This is an image of the page.
[12:13:13] solars: norc, first let me tell you that if I call it with self.used_budget = it does not loop
[12:13:29] norc: solars: :)
[12:13:34] norc: solars: stack frame 19 attempts to save, which eventually leads ActiveRecord to recognize that your model is dirty.
[12:13:56] Alazoral: has joined #RubyOnRails
[12:14:12] ImmoveableOne: I enter a number a number and click + button, I should see the quantity displayed change.
[12:14:14] srinidhi: has joined #RubyOnRails
[12:14:35] lxsameer: has joined #RubyOnRails
[12:14:47] AntiSpamMeta: has joined #RubyOnRails
[12:14:49] kgrz: has joined #RubyOnRails
[12:15:55] norc: solars: I think what you are trying to do may not be safe.
[12:16:08] solars: norc, ok in the example it is probably because I don't set the calculated timestamp there, so if the dirty check accesses the field, it's entering the loop
[12:16:35] solars: norc, ok no, if I remove setting the timestamp it also finishes
[12:16:41] solars: damn I'm confused now
[12:17:01] GodFather: has joined #RubyOnRails
[12:17:13] norc: solars: I think turning your model dirty and saving it inside an accessor that responds to an attribute is a bad idea.
[12:17:25] norc: solars: Have another method for it.
[12:18:25] blackmesa: has joined #RubyOnRails
[12:18:43] solars: norc, yeah it seems
[12:19:38] norc: solars: the issue is that save will end up calling these exact accessors if the model is dirty, to indicate that these attributes have been changed.
[12:20:44] solars: norc, yeah I understood.. which complicates things a lot because the workaround for this is quite nasty
[12:21:08] tildes: ImmoveableOne: as a user I would be quite confused to see one field for increasing quantity and another field for decreasing quantity. I would expect just one field for the quantity, and then - and + buttons next to it
[12:21:09] solars: I mean, not very clean as you basically need to create a second method and substitute all calls
[12:21:23] norc: solars: just have a refresh_budget method and call it whenever you need to.
[12:21:50] tildes: ImmoveableOne: I think you would do well to read the guide first on this topic, and then come back with actual code and errors, in case any
[12:21:52] norc: solars: or perhaps move the logic into a service even.
[12:22:45] solars: I have to check how to fix this.. it all seems quite dirty now :)
[12:22:54] tildes: ImmoveableOne: but to give you some background, your buttons will need to have event listeners, that will then change the number in the field, and if needed, communicate the new quantity to server with ajax
[12:22:57] refinerysource: has joined #RubyOnRails
[12:23:30] maucar: has joined #RubyOnRails
[12:23:33] solars: norc, it's a cached variable that has to be recalculated each month .. it's in generall a bit messy
[12:24:17] norc: solars: all the more reason it does not belong into your model.
[12:25:20] solars: norc, the question is where to put it.. I could hook into initialization somehow, so it is refreshed and saved when the object is loaded, not sure if that makes sense though
[12:25:35] maucar: has joined #RubyOnRails
[12:26:05] tildes: solars: if it's something you do once a month, the right place to update the value is a background job
[12:26:32] tildes: (my 2 out-of-the-context cents :) )
[12:26:36] solars: tildes, the background job would run 1 hour, so I would risk getting out of sync
[12:26:47] grios: has joined #RubyOnRails
[12:26:51] tildes: solars: I am scared of your app already :)
[12:27:01] solars: I think the best way is to substitute the calls to .used_budget with a service method that does the check, updates, saves and returns it
[12:27:06] solars: tildes, haha
[12:27:45] tildes: ACTION is somehow still not fully comfortable with the idea of overriding attribute getters. I mean what is the use case, where this is the best solution?
[12:28:38] solars: tildes, it's really something common, simplest case being some kind of transformations when saving/loading
[12:30:01] DanByc: has joined #RubyOnRails
[12:31:57] tildes: solars: checking the month in the initializer, updating attribute if needed and reloading the object if needed might work
[12:32:24] solars: tildes, yeah something like that, not sure though where to hook in, have to check that
[12:32:38] tildes: ActiveRecord#initialize ?
[12:33:47] solars: I think I could use after_initialize
[12:34:11] ImmoveableOne: tildes: I just need to know how can I access the updated value of the inventory_items object, which has the attribute quantity.
[12:34:49] solars: however, then the problem is that it is very transparent.. e.g. if someone sees I'm calling the attribute directly, he is not aware of the check and might just do something like: Model.where().sum(:used_budget) which leads to wrong results
[12:35:49] ImmoveableOne: I did the two fields thing because the submit button of the form has only a single functionality, that is submit the form.
[12:35:49] tildes: solars: I feel the problem is modeled in a funky way. if used_budget is a monthly budget, overwriting the previous one each month just feels off
[12:36:00] tildes: solars: if it's a legacy app perhaps you just need to live with it
[12:36:05] tildes: but I'm scared of your app :D
[12:36:42] solars: tildes, yeah it's not optimal, the best way would be the calculate it on the fly of course, but right now that's a performance issue unfortunately
[12:37:04] fmcgeough: has joined #RubyOnRails
[12:37:35] roelof: has joined #RubyOnRails
[12:37:45] roelof: How can I make this work :
[12:37:47] roelof: <label for="input-1" class="stacked-label"><i class="pe-7f-user"></i></label> <input type="text" class="stacked-input" id="Naam" placeholder="Naam">
[12:38:19] roelof: with simple_form . Both have different classes and a <i classs >
[12:40:23] hcnewsom: has joined #RubyOnRails
[12:40:27] pawnbox: has joined #RubyOnRails
[12:40:54] jmignault: has joined #RubyOnRails
[12:43:04] upsell5: has joined #RubyOnRails
[12:43:32] artto: has joined #RubyOnRails
[12:45:06] Ergo: has joined #RubyOnRails
[12:45:42] artto: has joined #RubyOnRails
[12:46:56] chipotle_: has joined #RubyOnRails
[12:47:32] Circuit8: Hey guys. Just wondering how I would only include a module on certain controller actions?
[12:49:58] IFrank00: has joined #RubyOnRails
[12:50:19] IFrank004: has joined #RubyOnRails
[12:52:16] DanByc: has joined #RubyOnRails
[12:54:03] Circuit8: For example I would like to only have a module included on :create :update and :destroy. Is this possible?
[12:54:22] nettoweb: has joined #RubyOnRails
[12:54:38] artto: has joined #RubyOnRails
[12:55:40] ramortegui: has joined #RubyOnRails
[12:56:40] hcnewsom: has joined #RubyOnRails
[12:56:57] futilegames: has joined #RubyOnRails
[12:57:37] hcnewsom: http://www.sciencealert.com/europe-announces-that-all-scientific-articles-should-be-freely-accessible-by-2020
[12:58:22] futilegames: has joined #RubyOnRails
[12:58:24] marchelzo: has joined #RubyOnRails
[12:58:51] tildes: Circuit8: first, including a module on specific controller actions sounds fishy, you would rather use the modules on model level, and even there be cautious, preferring composition whenever you can
[12:59:56] tildes: Circuit8: I do not know of a direct way to do it, but if you must do something like that, you might have a module, which you then my_object.extend(:my_module) inside the controller action, to alter functionality
[13:00:21] tildes: per action
[13:01:01] tildes: Circuit8: or perhaps, use different models inside the controller actions to keep the code nice and clean
[13:02:22] Circuit8: tildes: Thanks for that. The module I was including was registering a before_action hook which was being performed on all my actions. What I did was just write skip_before_action, :only => [....]
[13:02:30] nettoweb: has joined #RubyOnRails
[13:02:33] Circuit8: tildes: which did the trick, but thanks for your suggestion
[13:03:01] allcentury: has joined #RubyOnRails
[13:04:13] GodFather: has joined #RubyOnRails
[13:04:13] tildes: Circuit8: good to know you got a working solution
[13:04:44] dandaman: has joined #RubyOnRails
[13:05:34] tknz: has joined #RubyOnRails
[13:05:55] stardiviner: has joined #RubyOnRails
[13:06:14] norc: Circuit8: No. If you need different classes for different actions, then use separate controllers.
[13:06:34] norc: Circuit8: Nothing forces you to toss actions that need different modules included into the same class.
[13:09:09] DanByc: has joined #RubyOnRails
[13:09:39] Pazician: has joined #RubyOnRails
[13:10:34] lightt: has joined #RubyOnRails
[13:10:59] lightt: has joined #RubyOnRails
[13:11:59] roelof: anyone who can help me ?
[13:17:36] pwnd_nsfw`: roelof, do you have to use simple_form
[13:18:23] pwnd_nsfw`: https://github.com/plataformatec/simple_form/wiki/Adding-custom-components
[13:18:54] thejamespinto: has joined #RubyOnRails
[13:19:00] roelof: pwnd_nsfw`: nope, I can also use another form maker or just use <=% form_for .... %>
[13:19:41] sevenseacat: has joined #RubyOnRails
[13:20:00] pwnd_nsfw`: simple_form is awesome, but for simplicity, I would probably skip using it for your particular case.
[13:20:27] dandaman: has joined #RubyOnRails
[13:20:41] roelof: öke, im now looking at <%= form_for ... %>
[13:21:03] roelof: just thinking how I can make the <i .... > part working
[13:22:08] pwnd_nsfw`: f.label :element, "<i class=.....>"
[13:22:09] pwnd_nsfw`: or something
[13:22:43] artto: has joined #RubyOnRails
[13:22:55] Malgorath: has joined #RubyOnRails
[13:23:24] Malgorath: Anyone have a url or tut on how to create a simple app from scratch not using ANY generators?
[13:23:41] norc: Malgorath: Use generators and look at what files are generated.
[13:23:54] norc: Malgorath: And then decide which parts you want or dont need.
[13:24:31] norc: Malgorath: Until you are comfortable not using generators. :)
[13:24:46] pwnd_nsfw`: I don't understand
[13:24:49] pwnd_nsfw`: why you wouldnn't use genators
[13:24:57] pwnd_nsfw`: besies scaffold
[13:25:09] Malgorath: norc: the reason for asking this in the exact manner I did was due to the fact that I do not have access to rails g in this messed up plugin creation I'm going through
[13:25:47] norc: pwnd_nsfw`: For trivial things generators are fine, but as soon as you start something serious you end up modifying every single class and template anyway.
[13:26:26] norc: Malgorath: Set up another rails installation and try out the generators?
[13:26:34] cabinB: if have a datetime object... in erb, how do i extract the year value for a comparison operator? (what's the syntax?)
[13:26:46] Malgorath: norc: I have, I have spent days on this, I just need to generate evreything from hand.
[13:26:47] aegis3121: has joined #RubyOnRails
[13:26:54] norc: cabinB: #year
[13:27:10] pwnd_nsfw`: rails g model
[13:27:16] pwnd_nsfw`: That's what I was referring to
[13:27:18] pwnd_nsfw`: Also, you could
[13:27:28] pwnd_nsfw`: create new app outside of your plugin
[13:27:37] norc: Malgorath: I do not see your problem. If you have a rails application you can test out what each generator does.
[13:27:45] felltir: has joined #RubyOnRails
[13:28:14] norc: Malgorath: And since you use git (you use right right?), you have no need to work in your castrated environment.
[13:28:19] Malgorath: norc: testing generators does absoultely nothing for explaining to me how I should name files and classes since things are GENERATED
[13:28:42] norc: Malgorath: http://guides.rubyonrails.org/autoloading_and_reloading_constants.html
[13:28:44] norc: For class names
[13:28:50] tildes: Malgorath: no reason for caps, really
[13:28:54] cabinB: norc: date_time#year ?
[13:29:20] tildes: Malgorath: pick another repo, without your plugin stuff. do git init, and then, with each generation action, you can git diff exactly what has changed and how
[13:29:41] tildes: Malgorath: norc is really trying to help you, and well, I might add
[13:29:46] Malgorath: tildes: I felt is was necessary since the whole part of my question is to not generate anything and it seemed that part was getting over looked. it wasnt like i capped the entire sentence.
[13:30:05] Circuit8: norc: OK thanks, will do that in future
[13:30:08] srinidhi: has joined #RubyOnRails
[13:30:22] tildes: Malgorath: well, to learn how not to generate anything, you need to learn that first?
[13:30:35] ZeroeSparticus: has joined #RubyOnRails
[13:30:43] pwnd_nsfw`: Learning the docs would prove helpful
[13:30:55] lightt: has joined #RubyOnRails
[13:31:04] norc: Malgorath: The link I gave you is the only relevant bit that Rails cares about.
[13:31:24] norc: Malgorath: Once you understand that concept it becomes immediately apparent that 90% of the things in rails are just named by some random convention.
[13:31:29] tildes: has anyone read https://dan.chak.org/enterprise-rails/ and how did you find it?
[13:31:59] darutoko-: has joined #RubyOnRails
[13:33:17] Malgorath: norc: just to help you and other understand this is what I have to work with: https://github.com/malgorath/openproject_todolist
[13:34:20] tildes: Malgorath: I took a look last time, and I cannot see just how norc's advice has not been relevant
[13:35:08] Malgorath: tildes: its not a factor if its good or bad, I'm not sure how to apply it is the issue hence why I am looking for a tut on how to do something similar so I can apply it to this project
[13:35:43] norc: Malgorath: You asked about naming files and classes. I gave you the one authoritative documentation on it. What more do you want?
[13:36:32] tildes: Malgorath: I tried explaining the process at 4:29:19. I notice instead of "pick another repo" I should have said, create a new rails instance. other than that, which part you have trouble with?
[13:36:43] Malgorath: norc: mostly due to the fact its just theory to me, I need to see a stepped through example to understand whats going on.
[13:37:07] norc: Malgorath: Read it again. It lists many examples that you can try out.
[13:37:40] norc: Malgorath: And this time spend more than 6 minutes on it before you decide you don't know what to do with it.
[13:37:55] ZeroeSparticus: Its getting hot in here
[13:38:17] pwnd_nsfw`: you know what that means
[13:38:18] tildes: it was much hotter, when the french guy was still here
[13:38:20] norc: Malgorath: If you have specific questions regarding that document, feel free to ask.
[13:40:27] eljimmy: has joined #RubyOnRails
[13:40:27] Malgorath: norc: the problem is for me because I have a learning disability reading reems of just words does not work for me, I am very much procedural in that I learn by steps not just random jumping around documentation. Question 1: Do I need to name migrations files in any special method? If so, what would the pattern be? is is YYYYMMDDHHMMSS_soemthing.rb
[13:41:28] ZeroeSparticus: Missed the beginning of this. What are you trying to do Malgorath?
[13:41:39] datanoise: has joined #RubyOnRails
[13:41:58] norc: Malgorath: If you are working as a software developer and are tasked with the development of rails, it is not too much to ask you to read the documentation of the framework you are using
[13:42:05] tildes: ZeroeSparticus: logs.ryanbigg.com
[13:42:34] norc: Malgorath: If you need someone to teach you, feel free to hire a consultant.
[13:43:08] norc: Malgorath: If you have a disability that prevents you from reading, then perhaps you have picked the wrong profession.
[13:43:49] Malgorath: Wonders where the SJWs are right now that seem to live here when people say "hi guys" but its okay to pick on someone with a learning disability.
[13:43:52] eljimmy: has joined #RubyOnRails
[13:43:53] norc: Malgorath: http://edgeguides.rubyonrails.org/active_record_migrations.html#running-migrations
[13:43:56] norc: By the way, regarding migrations
[13:44:32] norc: Malgorath: I do not mind people with disabilities. But I find your intentions questionable.
[13:44:52] tildes: Malgorath: I have never picked on you. But I remember I have asked about your goals regarding ruby/rails, because I thought it might be possible to help you, understanding your goals better.
[13:45:06] tildes: Malgorath: I didn't see you respond.
[13:45:43] Malgorath: tildes: its not always easy to respond when I'm swapping between a lot of screens to search for answers. I apologize if you asked me something and I missed it
[13:45:56] Circuit8: Hey guys. I have model A and B which have a many to many relationship through joining model C. I also want to have a JSON request sent to my server which contains the ID of a model A, and I want the server to return all B's that are associated with A. My question is what route / controller would it be best practise to have this API endpoint at? Surely it would be for an index action, but Im deliberating between controller A or
[13:46:03] k3rn31: has joined #RubyOnRails
[13:46:04] tildes: Malgorath: no worries. so what are your goals? :)
[13:46:12] norc: Malgorath: What really sucks is the fact that you are tasked to do a job without having the qualification. Note that is not meant as criticism towards you.
[13:46:23] tildes: Malgorath: what do you want to achieve? why do you want to learn this?
[13:46:23] Circuit8: a controller for C? Thanks in advance
[13:46:38] ZeroeSparticus: Malgorath: why don’t you use video tutorials?
[13:46:41] Circuit8: (sorry my question got split over two lines there)
[13:46:45] fryguy: Circuit8: you could consider nested resources /a/1/bs
[13:46:52] tildes: ZeroeSparticus: good point
[13:47:03] Malgorath: norc: when I was hired it was just to 'look' at RoR things, supposedly I'd have mentors and shit, so far in 3 months I have been doing 5 other people's jobs for them(network admin thru software development)
[13:47:09] norc: fryguy: that is just the route, does not solve the problem of which controller#action its mounted on
[13:47:36] fryguy: norc: if you are using restful routes, that route defines a specific controller and action
[13:47:42] tbuehlmann: Circuit8, either have a controller for A and having some kind of GET param to filter the ones you want or have a controller C having some kind of GET param to filter the ones you want
[13:47:42] norc: Malgorath: As I said. Perhaps you have picked the wrong job. ;-)
[13:47:49] Malgorath: tildes: reason I want to learn it is because my boss wants to have the ability to create plugin(engines) for Openproject
[13:48:32] ZeroeSparticus: Malgorath: firs thing you need to do is set up an environment to see what rails g does.
[13:48:36] Malgorath: norc: Where I live jobs are extremely scarce and I can not afford to just up and move as I'm aslo trying to go through a divorce and deal with a father that has alzhemir's and a mother that has physical issues.
[13:48:37] xalupeao: has joined #RubyOnRails
[13:48:52] ZeroeSparticus: Oh boy. This is getting real
[13:48:58] Malgorath: ZeroeSparticus: I've got that, I've created rails apps before no problem.
[13:49:24] tbuehlmann: Circuit8, woopsie, totally missed the option fryguy mentioned. that's the first one I'd suggest
[13:49:34] Circuit8: tbuehlmann: Thanks
[13:49:47] Circuit8: fryguy: So I would have a nested resource A/1/B
[13:49:49] qejk: has joined #RubyOnRails
[13:49:57] Circuit8: fryguy: So that would hit my B controller?
[13:50:04] Circuit8: fryguy: With params including A
[13:50:32] Circuit8: fryguy: Cool that sounds great. I completely forgot about nested routes!
[13:50:52] idefine: has joined #RubyOnRails
[13:51:30] cabinB: has joined #RubyOnRails
[13:53:54] Malgorath: The alternative is if anyone can help me figure out how to get binstubs to generate and work. I did a bunch of reading on that this weekend but couldn't seem to get anything that was functional. rake rails:update:bin inside the plugin directory, it complains about no Rakefile
[13:54:17] gremly: has joined #RubyOnRails
[13:55:02] Jasaka: has joined #RubyOnRails
[13:57:12] AimlessRAven: has joined #RubyOnRails
[13:57:58] sami: has joined #RubyOnRails
[13:58:17] roelof: has joined #RubyOnRails
[13:58:25] AimlessRAven: hi all, if i have fot example test.csv file in my public folder
[13:58:29] AimlessRAven: how to make link_to download him
[13:59:27] arBmind: has joined #RubyOnRails
[13:59:31] roelof: hello, im doing this to load my stylesheets :
[13:59:33] roelof: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
[13:59:50] tildes: Malgorath: why not just follow the advice already given?
[13:59:57] roelof: but now bootstrap.css is before the main.css and now my layout is messed up
[14:00:23] roelof: is there is way I can tell that main.css must be loaded before the bootstrap.css ?
[14:00:38] pwnd_nsfw`: roelof, what does your application css look like?
[14:00:45] pwnd_nsfw`: gist.github.com please
[14:00:52] norc: roelof: yes. require it first.
[14:01:19] pwnd_nsfw`: AimlessRaven, http://stackoverflow.com/questions/16804715/rails-link-to-file-in-public-folder
[14:01:27] norc: roelof: For stylesheets you should avoid using /* require directives. Just use @import directives from sprockets - that gives you the control
[14:01:51] sevenseacat: require directives also give you the control.
[14:01:51] norc: Err sorry, I meant sass import directives of course.
[14:01:57] norc: sevenseacat: they do?
[14:01:58] pawnbox: has joined #RubyOnRails
[14:02:06] roelof: my application.css looks now like this : https://gist.github.com/rwobben/efbd493476c6eec054042496bc1e5d5e
[14:02:13] sevenseacat: of course. specify the files in the order you want them loaded.
[14:02:19] potbelly: has joined #RubyOnRails
[14:02:28] Malgorath: tildes: I was just trying to give an alternative idea as to approach this issue, if I can get a working bin/rails then I'd not have to worry with manual creation issues for this
[14:02:29] sevenseacat: don't use blanket requires like require_tree
[14:02:33] ZeroeSparticus: has joined #RubyOnRails
[14:02:44] hcnewsom: has joined #RubyOnRails
[14:03:26] norc: sevenseacat: Okay. Something in the past had led me to drop sprockets requires and use @import instead - honestly I do not recall the line of thought behind it.
[14:03:30] roelof: so the best way is too use the bootstrap gem and use @imports in the way I want. Right ?
[14:03:52] norc: sevenseacat: I suppose at the core just the require_tree is the problem (since it gives no control over the order), right?
[14:03:58] sevenseacat: thats correct.
[14:06:58] macsteps: has joined #RubyOnRails
[14:07:13] duderonomy: has joined #RubyOnRails
[14:07:17] matthewd: norc: Also @import allows you to refer to sass variables across files; require not so much
[14:07:39] idefine_: has joined #RubyOnRails
[14:07:50] agent_white: has joined #RubyOnRails
[14:08:01] norc: matthewd: That must be it then.
[14:08:07] kgrz: has joined #RubyOnRails
[14:08:51] idefine_: has joined #RubyOnRails
[14:10:17] roelof: pfff , I changed application.scss to this : @import "bootstrap-sprockets"; @import "bootstrap";
[14:10:33] roelof: but now bootstrap is not used at all
[14:11:00] weckl: has joined #RubyOnRails
[14:11:31] ZeroeSparticus: roelof: I’d recommend using the sass version of bootstrap if you’ll make use of sass imports.
[14:12:09] ZeroeSparticus: Ideally if you kept custom styles separate from the source this shouldnt be too difficult to do.
[14:12:29] roelof: ZeroeSparticus: I did , I added this to the gem file : gem 'bootstrap-sass', '3.2.0.0' and did bundle install after it
[14:12:51] ZeroeSparticus: Did you restart the server?
[14:13:07] Malgorath: Norc tildes and ZeroeSparticus thanks for the links and such I'll continue to review them see they can help me with doing this. Sorry if I am hard to talk to.
[14:13:32] roelof: yep. I did
[14:14:15] cabinB: in erb, how do I get the first 4 characters of a string (in this case, a property, if it matters)
[14:14:33] defsdoor: has joined #RubyOnRails
[14:14:51] roelof: cabinB: string[0..3] ??
[14:15:52] cabinB: roelof: <%= pe.object.start_date.to_s[0,3] %>
[14:16:24] cabinB: roelof: got it, thanks!
[14:16:34] ZeroeSparticus: roelof: some housekeeping to debug why its not working. Remove the *= require_self and *= require_tree .
[14:16:37] roelof: cabinB: YW
[14:16:54] ZeroeSparticus: And make sure you required the javascripts
[14:17:02] sevenseacat: cabinB: I'd really recommend using date formatting, not substrings, for date fields
[14:17:30] roelof: ZeroeSparticus: there are not there . I have only @import "bootstrap-sprockets"; @import "bootstrap"; in my application.scss
[14:17:31] cabinB: i agree sevenseacat. this is temporary test
[14:18:05] roelof: aha, I did not change the application.js file
[14:18:12] norc: sevenseacat: Mind my asking, what do you do professionally?
[14:18:21] sevenseacat: norc: I'm a web developer.
[14:18:32] sevenseacat: working with Rails is my day job :P
[14:19:56] ZeroeSparticus: roelof: I had similar issues when I used sass bootstrap. Although I imported it manually haha.
[14:20:11] clandry94: has joined #RubyOnRails
[14:20:31] roelof: hmm, I changed application.js to : //= require jquery //= require bootstrap-sprockets
[14:20:40] roelof: and still no bootstrap :(
[14:21:05] cabinB: ok... here's my issue: I have nested attributes. But when editing in a view, I only want to show the attributes that have a start_date of 2016
[14:21:27] cabinB: <%= f.fields_for :planning_events do |pe|, f.object.planning_events.where( ??? ) %>
[14:21:40] norc: sevenseacat: Fair enough. :)
[14:22:02] roelof: ZeroeSparticus: it looks like to my that the imports are not imported some way
[14:22:27] norc: cabinB: It makes more sense to move this logic into a decorator or helper.
[14:22:32] ZeroeSparticus: Could you actually look at the source of your application.css file in the browser.
[14:22:55] cabinB: norc, I'd want to do that to, but I first just want to have a quick test to see what the output it
[14:23:00] triptec: has joined #RubyOnRails
[14:23:30] ZeroeSparticus: Just to make sure they are loading and it might be some placement issue roelof
[14:23:38] norc: cabinB: Any SQL way is specific to your RDBMS. If the dataset is trivially small you can .select the entire set.
[14:24:23] ZeroeSparticus: Also. I should ask. When you say no bootstrap. Do you mean absolutely no styling at all? Or partial styling?
[14:25:12] roelof: oke, I think I have to tell that main.scss must be included too
[14:25:41] cabinB: norc, is there a way just with inline ERB as a quick workaround? I don't yet know decorators or helpers, but want to do this without them for now, if there's a way.
[14:25:50] norc: cabinB: I just told you. :)
[14:25:50] vedu: Hello. I am getting this error while trying to run raw SQL: https://gist.github.com/vedant1811/f2c5d5943f5608055cfea393fc9b83c6 probably more of an SQL question
[14:25:57] vedu: Any ideas?
[14:26:42] norc: vedu: semicolons are your friends.
[14:26:43] norc: And you have none.
[14:26:49] norc: Was that harsh? :S
[14:27:23] ZeroeSparticus: It was funny norc
[14:27:26] roelof: ZeroeSparticus: if I want to import custom.scss, can I just do @import "custom" ??
[14:27:45] ZeroeSparticus: Yessir. But I believe it has to be a sass partial.
[14:27:48] norc: roelof: with a semicolon at the end.
[14:28:11] vedu: norc: no. :)
[14:29:40] sergey_makagon: has joined #RubyOnRails
[14:29:44] chouhoulis: has joined #RubyOnRails
[14:29:48] roelof: Everyone thanks, that was the trick. adding custom.scss as first item in application.scss
[14:30:36] arup_r: has joined #RubyOnRails
[14:31:35] chouhoulis: has joined #RubyOnRails
[14:32:13] arup_r: I am upgrading an old project to Rails 4.2.6. And doing so, I found 1 migration file syntax is wrong as per the current Rails API. So I fixed it, and now I am able to do migration. My question is, my edit to migration can be harmful? I think no, but would like to review it by you people once.
[14:32:15] frem_: has joined #RubyOnRails
[14:32:20] arup_r: https://gist.github.com/aruprakshit/1e177f3eaaf22436bbf8357fc1412f8a
[14:32:48] arup_r: migration_before.rb is what the project had, and now I changed it migration_after.rb
[14:33:21] arup_r: error came when it was like migration_before.rb
[14:33:30] defsdoor: I dont know why you needed to do that change :o
[14:33:32] arup_r: now after my edit, all is fine.
[14:33:49] defsdoor: aah well yeah migration before looks wrong
[14:33:49] arup_r: defsdoor: what do u mean?
[14:33:51] nickenchuggets: has joined #RubyOnRails
[14:34:00] defsdoor: sorry i was reading wrong way round
[14:34:10] defsdoor: was that ever valid syntax ?
[14:34:10] arup_r: no problem. :)
[14:34:20] arup_r: may be, don't know
[14:34:30] defsdoor: what previous rails version ?
[14:35:07] arup_r: previous version was Rails 4.0 .. but people here take db dump from prod/stage and import it to local db. I doubt they ran migration since long
[14:35:20] arup_r: but this project is like 3-4 years old.
[14:35:44] defsdoor: the 2nd param is a condition isnt it ?
[14:35:48] defsdoor: not an update
[14:36:14] simmer: has joined #RubyOnRails
[14:36:18] defsdoor: i.e. thats settings header to Arts where the full path is .../arts ?
[14:36:31] defsdoor: whereas your new migration isnt doing that
[14:36:31] arup_r: no idea.. I never saw this syntax
[14:36:57] arup_r: Are you sure, the old migration was doing update conditionally?
[14:37:00] defsdoor: your new migration is changing all to both the new values
[14:37:11] defsdoor: rails 2 - 2 arg is condition
[14:37:21] defsdoor: if you look at it it makes sense
[14:37:36] defsdoor: it's saying if the full_path is .../arts make the header Arts
[14:37:40] idefine: has joined #RubyOnRails
[14:38:31] defsdoor: so you should be doing IxPages::Page.where(full_path: 'grant-programs/arts').update_all( header: 'Arts')
[14:38:39] arup_r: good catch, so writing like IxPages::Page.where(full_path: 'grant-programs/arts' ).update_all(header: 'Arts' )
[14:38:48] fedexo: has joined #RubyOnRails
[14:39:01] eljimmy: has joined #RubyOnRails
[14:39:43] arup_r: thanks defsdoor, I knew my catch was wrong
[14:41:37] defsdoor: I wonder if I will be unbanned from here now ?
[14:42:10] triptec: has joined #RubyOnRails
[14:43:33] defsdoor: over zealous ops imho
[14:43:37] dionysus69: has joined #RubyOnRails
[14:43:45] defsdoor: was 2 months ago at least
[14:43:49] croberts: has joined #RubyOnRails
[14:44:06] defsdoor: you can't have an ego and be a channel op
[14:47:55] mdw: has joined #RubyOnRails
[14:48:26] DriesS: has joined #RubyOnRails
[14:50:05] xalupeao: has joined #RubyOnRails
[14:51:09] xalupeao: has joined #RubyOnRails
[14:51:27] allcentury: has joined #RubyOnRails
[14:51:41] triangles2: has joined #RubyOnRails
[14:51:45] iwada: has joined #RubyOnRails
[14:54:02] idefine: has joined #RubyOnRails
[14:54:59] JakFrist: has joined #RubyOnRails
[14:58:17] eGGshke: has joined #RubyOnRails
[14:58:50] scepticulous: has joined #RubyOnRails
[14:59:04] njero: has joined #RubyOnRails
[14:59:42] njero: has left #RubyOnRails: ()
[15:00:04] jhack: has joined #RubyOnRails
[15:01:33] idefine: has joined #RubyOnRails
[15:01:44] xardion: has joined #RubyOnRails
[15:04:33] idefine_: has joined #RubyOnRails
[15:06:35] polishdub: has joined #RubyOnRails
[15:07:09] Malgorath: has left #RubyOnRails: ()
[15:08:35] disgrntld: has joined #RubyOnRails
[15:11:04] beingjohnm: has joined #RubyOnRails
[15:11:54] beingjohnm: has joined #RubyOnRails
[15:12:18] aegis3121: has joined #RubyOnRails
[15:13:05] desnudopenguino: has joined #RubyOnRails
[15:15:59] DanByc: has joined #RubyOnRails
[15:18:00] DanByc: has joined #RubyOnRails
[15:18:24] pawnbox_: has joined #RubyOnRails
[15:18:51] jhack: has joined #RubyOnRails
[15:20:31] tildes_: has joined #RubyOnRails
[15:23:06] ksmutthu: has joined #RubyOnRails
[15:25:47] openstruct: has joined #RubyOnRails
[15:26:03] DanByc: has joined #RubyOnRails
[15:27:44] techsethi: has joined #RubyOnRails
[15:27:54] DanByc: has joined #RubyOnRails
[15:28:49] kies: has joined #RubyOnRails
[15:30:00] DanByc: has joined #RubyOnRails
[15:30:20] idefine: has joined #RubyOnRails
[15:31:00] idefine: has joined #RubyOnRails
[15:31:35] Devalo: has joined #RubyOnRails
[15:34:00] AzaToth: has joined #RubyOnRails
[15:34:17] mikecmpbll: has joined #RubyOnRails
[15:34:40] rbr: has joined #RubyOnRails
[15:35:33] Ropeney: has joined #RubyOnRails
[15:39:04] Dimik: has joined #RubyOnRails
[15:40:10] iwada: has joined #RubyOnRails
[15:40:11] xalupeao: has joined #RubyOnRails
[15:40:56] davidw: has joined #RubyOnRails
[15:43:04] idefine: has joined #RubyOnRails
[15:43:35] xalupeao: has joined #RubyOnRails
[15:44:46] moeabdol: has joined #RubyOnRails
[15:46:12] jocuman: has joined #RubyOnRails
[15:46:15] dangerou_: has joined #RubyOnRails
[15:46:37] felltir: has joined #RubyOnRails
[15:46:46] yfeldblum: has joined #RubyOnRails
[15:47:24] PaulePanter: Hi. With Rails (3.2), after doing a migration (`rake db:migrate`) does the application need to be restarted, when it was already running the right source?
[15:47:37] felltir: has joined #RubyOnRails
[15:47:56] yfeldblum: has joined #RubyOnRails
[15:49:34] RegulationD: has joined #RubyOnRails
[15:49:42] diegoaguilar: has joined #RubyOnRails
[15:49:48] macsteps: has joined #RubyOnRails
[15:52:05] emachnic: has joined #RubyOnRails
[15:55:27] emachnic_: has joined #RubyOnRails
[15:58:08] conta: has joined #RubyOnRails
[15:59:19] silverdust: How can I change action dispatch's X-Frame-Options header and what are the options?
[15:59:51] silverdust: I want a mobile app loading it in an iframe within webview
[16:00:01] PaulePanter: jhass: Understood. Thank you.
[16:00:09] Cohedrin: has joined #RubyOnRails
[16:00:11] silverdust: defualt is SAMEORIGIN but I can't find any other option I can set to it
[16:00:50] ZeroeSparticus: has joined #RubyOnRails
[16:03:57] xalupeao: has joined #RubyOnRails
[16:04:01] njero: has joined #RubyOnRails
[16:04:04] aegis3121: has joined #RubyOnRails
[16:05:05] dfockler: has joined #RubyOnRails
[16:05:16] Devalo: has joined #RubyOnRails
[16:07:55] kdough: has joined #RubyOnRails
[16:08:31] zave: has joined #RubyOnRails
[16:08:32] blackmesa: has joined #RubyOnRails
[16:10:52] douglascorrea: has joined #RubyOnRails
[16:10:54] silverdust: It's a wrong thing to do but I'm being told to do it. Now I'm told to take out X-FrameoOptions entirely exposing the web app to csrf vulnerabilityies
[16:11:17] silverdust: I'd just ignore the request I guess
[16:11:28] DoctorMonocular: has joined #RubyOnRails
[16:12:57] workmad3: silverdust: this is because some other team wants to embed this site in a frame?
[16:13:48] silverdust: for the mobile
[16:13:53] workmad3: silverdust: https://developer.mozilla.org/en/docs/Web/Security/CSP/CSP_policy_directives#frame-ancestors
[16:14:26] smathy: has joined #RubyOnRails
[16:14:29] SPYGAME: has joined #RubyOnRails
[16:14:31] gloscombe: has joined #RubyOnRails
[16:14:52] njero: has joined #RubyOnRails
[16:16:33] silverdust: workmad3: It doesn't say where frame-ancestors should be set. It just says it's not supported in the meta
[16:17:37] rueben_: has joined #RubyOnRails
[16:18:24] artto: has joined #RubyOnRails
[16:19:33] workmad3: silverdust: the entire page is about the Content-Security-Policy header... so care to take a guess? ;)
[16:20:25] silverdust: It's in fact an experimental feature and not recommended for production
[16:20:51] smathy: has joined #RubyOnRails
[16:22:06] workmad3: silverdust: and yet it's supported by android webview and chrome for android... which is the target you're aiming for ;)
[16:23:08] mrchris: has joined #RubyOnRails
[16:23:54] flashpoint9: has joined #RubyOnRails
[16:24:37] workmad3: silverdust: btw, X-Frame-Options has zero support on mobile devices according to MDN
[16:25:09] moei: has joined #RubyOnRails
[16:25:14] flashpoint9: Im getting this error "No such file or directory @ rb_sysopen". Where should I place my static files on a rails app and how do I access them? Im using File.read to access the file.
[16:25:51] yellow5: has joined #RubyOnRails
[16:25:54] lxsameer: has joined #RubyOnRails
[16:26:25] mrchris: Hello. How do I set an additional property on a has_many through. Here is the code I'm working with http://pastie.org/private/duscjmr4rd8p2l62mel2zg
[16:27:04] mrchris: is it possible to do "offer.vips << User.find(1)" and have the vip property set automatically?
[16:28:09] BlackHatJack: has joined #RubyOnRails
[16:32:32] meoblast001: has joined #RubyOnRails
[16:33:19] gambl0re: has joined #RubyOnRails
[16:34:29] silverdust: Thanks workmade. Do I do this with actionDispatch or the response object in the controller?
[16:34:32] DanByc: has joined #RubyOnRails
[16:35:11] Coldblackice: has joined #RubyOnRails
[16:38:01] silverdust: I guess action_dispatch
[16:38:41] epochwolf: I'm having an issue with getting ssl certificates to verify... https://gist.github.com/epochwolf/560ad2d29ada149afde1df65df4709ed
[16:39:22] epochwolf: I tried disabling ssl verification but that doesn't seem to work.
[16:39:47] epochwolf: It skips verification for getting the source index only to die when it tries to grab a gem
[16:40:04] epochwolf: Trying http instead of https didn't work. It only used http for source index.
[16:42:59] thejamespinto: hey guys, what is that latest way to write concerns in Rails? it was slightly simpler than the other way...
[16:45:20] manfrin: has joined #RubyOnRails
[16:47:06] JesseH2: has joined #RubyOnRails
[16:47:17] shinnya: has joined #RubyOnRails
[16:47:46] youch: has joined #RubyOnRails
[16:49:47] mikecmpbll: has joined #RubyOnRails
[16:50:36] flashpoint9: Can anyone describe the process for creating an index of json data being pulled from a CSV? THe CSV is huge with ove a million lines of data so I can't query it on each request. I need to somehow get the whole thing in a database but im really really confused on just what the rntire process will look like
[16:50:43] cd83x: has joined #RubyOnRails
[16:52:36] DriesS: has joined #RubyOnRails
[16:54:22] havenwood: flashpoint9: iterate over the csv rows and save each to the db
[16:54:50] flashpoint9: havenwood: so if I do that where should I place the code for that?
[16:55:35] havenwood: flashpoint9: hmm. maybe a rake task?
[16:55:42] rogue_koder: has joined #RubyOnRails
[16:55:54] flashpoint9: havenwood: over my head, i dont understand how to create a rake task
[16:56:11] havenwood: flashpoint9: others here may have more advice on where to properly put things
[16:56:18] flashpoint9: ive only created some simple crud apps before
[16:56:39] workmad3: flashpoint9: where is the CSV coming from and how often will it be updated?
[16:56:59] havenwood: flashpoint9: http://guides.rubyonrails.org/command_line.html#rake
[16:57:30] havenwood: http://guides.rubyonrails.org/command_line.html#custom-rake-tasks
[16:57:39] flashpoint9: workmad3: It's just a file a buddy gave to me to practice with, he got it from a job interview and was testing where I am in relation to some interview tests. Of which I now realize I am pretty far behind and suck
[16:58:28] flashpoint9: It really looks like I just need to go through all the rails guides...
[16:58:40] havenwood: flashpoint9: the guides are good
[16:59:09] havenwood: flashpoint9: maybe first try a one-off script in your rails console
[16:59:47] flashpoint9: k, thanks guys (sorry if my language is so negative, just realized I suck at rails way more than I thought)
[17:00:21] workmad3: flashpoint9: don't assume that just because an interview coding challenge stumped you
[17:00:36] flashpoint9: hmmmm, yea I guess that presumptious
[17:01:13] workmad3: flashpoint9: all it really means is that you're not particularly familiar with what you'd need to do to seed an app with a large amount of CSV data
[17:01:21] epochwolf: flashpoint9: interview coding challenges suck :)
[17:04:37] aegis3121: has joined #RubyOnRails
[17:05:56] cabinB: has joined #RubyOnRails
[17:10:09] arup_r: has joined #RubyOnRails
[17:11:26] quazimodo: has joined #RubyOnRails
[17:11:28] arup_r: Can I use pry gem to debug in local machine without putting it to Gemfile? People I work with here use Rubymine, and they don't want me to put this in Gemfile. So I need to find out some otherway.
[17:13:33] BlackHatJack: has joined #RubyOnRails
[17:13:36] idefine: has joined #RubyOnRails
[17:14:45] djbkd: has joined #RubyOnRails
[17:14:55] ZeroeSparticus: has joined #RubyOnRails
[17:16:29] quazimod1: has joined #RubyOnRails
[17:16:37] jhack: has joined #RubyOnRails
[17:16:37] idefine_: has joined #RubyOnRails
[17:16:57] fryguy: arup_r: put it in gemfile but don't commit it?
[17:17:06] fryguy: or figure out more specifically why they don't want pry installed
[17:17:43] datanoise: has joined #RubyOnRails
[17:18:47] arup_r: they said Rubymin has everything needed for rails dev work. I thought of adding Gemfile and the delete it, but that is like everytime I will start work I need to donbload it... and they have very strong list of gems in gemfile and it takes for me to install like 10 mins.. so wandering if any other ways.
[17:19:08] fryguy: you only need to install the gem once
[17:20:46] arup_r: ok, if I put in Gemfile, Gemfile.lock will be updated also.. so before end of the day when I will leave my computer, before I need to remove it also..
[17:20:51] arup_r: let me google more
[17:20:59] mdw: has joined #RubyOnRails
[17:21:00] fryguy: you should really just convince your coworkers to do things right
[17:21:07] fryguy: there's no good reason to force exclusion of pry
[17:21:24] fryguy: stock rails4 gemfiles include a similar thing now (that's worse IMO), byebug.
[17:21:32] fryguy: it's default in rails
[17:22:19] arup_r: I tried, they are not listening me, and I wouldn't tell them any more. I added byebug and spring gems, and they asked me to remove those unwanted gems also..
[17:23:12] barhum2013: has joined #RubyOnRails
[17:23:31] fryguy: doesn't sound like a good job to keep for career progression
[17:23:33] sypheren: has joined #RubyOnRails
[17:23:49] edwinvdgraaf: has joined #RubyOnRails
[17:25:11] arup_r: You are right! But now I have no other ways.
[17:26:20] flashpoint9: fryguy: couldn't they be asking for the removal of spring because it might be an ember app? I think removing spring is needed for single page apps
[17:26:55] arup_r: flashpoint9: it is a plain rails app.
[17:27:01] fryguy: flashpoint9: that doesn't seem right to me, but i've been referring specifically to pry, not spring
[17:27:02] arup_r: they are like that..
[17:27:28] flashpoint9: ah, well maybe the company just sucks :)
[17:27:56] arup_r: I upgraded 4 rails projects to 4.2.6. And as per the guide, I added spring and byebug. And I had to remove them at last. Then my pr got accepted
[17:28:18] macsteps: has joined #RubyOnRails
[17:29:19] arup_r: anyway, I am googling still. So if anybody knows any trick/hack let me know.
[17:30:18] t4nkD: has joined #RubyOnRails
[17:30:32] chouhoul_: has joined #RubyOnRails
[17:31:48] manfrin: has joined #RubyOnRails
[17:32:16] dandaman: has joined #RubyOnRails
[17:32:21] chouhoul_: has joined #RubyOnRails
[17:32:27] hahuang65: has joined #RubyOnRails
[17:33:05] arup_r: https://github.com/bundler/bundler/issues/183#issuecomment-595008 :)
[17:33:43] mikecmpbll: has joined #RubyOnRails
[17:34:29] chouhoulis: has joined #RubyOnRails
[17:34:49] SteenJobs: has joined #RubyOnRails
[17:35:26] roelof: has joined #RubyOnRails
[17:36:00] triptec: has joined #RubyOnRails
[17:36:08] kgrz: has joined #RubyOnRails
[17:36:08] roelof: a maybe off-topic question : which awesome font icon can I use the best if I want to make a link to something new ?
[17:37:21] artto: has joined #RubyOnRails
[17:37:28] t4nkD: roelof: search for "link" and choose one
[17:40:51] idefine: has joined #RubyOnRails
[17:41:21] tbuehlmann: roelof: what about "plus"?
[17:42:18] roelof: That could be a good one. It's now for adding financial accounts like bank or cash on hands
[17:47:17] roelof: no, euros , I live in Europe :)
[17:49:03] cabinB: date question: I have a nested record with a "start_date" property. I can output the property with <%= pe.object.start_date %>
[17:49:24] cabinB: but when I try <%= pe.object.start_date.year %> then I get undefined method `year' for nil:NilClass
[17:50:05] d0nn1e: has joined #RubyOnRails
[17:52:38] thejamespinto: cabinB: that's because start_date is nil
[17:52:44] idefine_: has joined #RubyOnRails
[17:52:53] hcnewsom: has joined #RubyOnRails
[17:54:47] cabinB: thejamespinto, I put in a conditional and it worked. <% if pe.object.start_date.present? %> ....
[17:54:53] thejamespinto: cabinB: go to the migration and set that column to null: false here http://guides.rubyonrails.org/active_record_migrations.html#column-modifiers
[17:55:43] thejamespinto: cabinB: you should be reviewing all 10 guides pages for MVC *at least* once a month
[17:56:27] dandaman: has joined #RubyOnRails
[17:56:31] cabinB: thejamespinto: what are those pages?
[17:56:48] idefine: has joined #RubyOnRails
[17:56:58] chouhoul_: has joined #RubyOnRails
[17:59:08] neanderslob: has joined #RubyOnRails
[18:02:38] jtdowney: has joined #RubyOnRails
[18:02:38] jtdowney: has joined #RubyOnRails
[18:02:51] marchelzo: has joined #RubyOnRails
[18:03:41] acetoxy: has joined #RubyOnRails
[18:04:24] thejamespinto: cabinB: click on the menu, the ones on the left
[18:05:45] arup_r: has joined #RubyOnRails
[18:06:13] cabinB: thanks thejamespinto, but I'm still lost. if you're referring to the url you sent (http://guides.rubyonrails.org/active_record_migrations.html#column-modifiers) ... there's no menu on left
[18:07:26] tildes_: has joined #RubyOnRails
[18:07:55] nurey: has joined #RubyOnRails
[18:09:10] thejamespinto: cabinB: how old are you?
[18:09:45] adre: has joined #RubyOnRails
[18:09:47] thejamespinto: and how many times have you been to the guides website before?
[18:10:36] cabinB: thejamespinto, I'm not sure. "Guides website" = guides.rubyonrails.org?
[18:10:51] thejamespinto: cabinB: I mean these 10 pages http://cl.ly/2H3J1X0n3i0v
[18:12:56] cabinB: thejamespinto: I appreciate you trying to help me, and if I'm trying your patience I apologize. My age here isn't relevant. yes, I'm a newbie, so I was uncertain what you were referring to. I know now, and I'll review them. Thanks.
[18:13:27] jmignault: has joined #RubyOnRails
[18:13:56] thejamespinto: cabinB: I'm sorry, but there is a really strong culture here of emphasizing that people should read the guides website more often
[18:14:49] thejamespinto: t.date :starts_on, null: false
[18:14:55] thejamespinto: that's what you need
[18:15:16] thejamespinto: there is no better way to ensure a column will never be null
[18:16:00] akshat: has joined #RubyOnRails
[18:16:06] thejamespinto: initializers, overriding, readers, decorators... they all bow to that tweak in the migration
[18:16:16] macsteps: has joined #RubyOnRails
[18:17:11] infinitone: has joined #RubyOnRails
[18:17:47] darkxploit: has joined #RubyOnRails
[18:18:05] jmignault: has joined #RubyOnRails
[18:18:08] thejamespinto: cabinB: do you understand now?
[18:19:00] thejamespinto: read those pages once a month, get yourself in a local study group where people do that, if you don't have one around you, start one :)
[18:19:21] jhack: has joined #RubyOnRails
[18:19:48] thejamespinto: you also may want to read all the methods for String, Hash and Array, you'll be surprised at how much you'll learn there
[18:19:50] thejamespinto: http://ruby-doc.org/core-2.3.1/String.html
[18:19:58] infinito_: has joined #RubyOnRails
[18:20:07] thejamespinto: also, reading Object doesn't add much
[18:20:23] jhack_: has joined #RubyOnRails
[18:20:41] cabinB: Got it, thejamespinto. Thanks again. I haven't visited "the guides" but I'll start.
[18:21:38] thejamespinto: knowing how many people are out there using Rails but haven't heard about that website brings tears to my eyes
[18:22:30] jhack_: has joined #RubyOnRails
[18:24:00] jhack32: has joined #RubyOnRails
[18:24:10] edwinvdgraaf: has joined #RubyOnRails
[18:24:30] chouhoulis: has joined #RubyOnRails
[18:24:36] et09: has joined #RubyOnRails
[18:25:25] et09: i have an activerecord model with attributes foo and bar - how do i query it and get a result which is grouped into this - foo=1 [record1, record2...], foo=2[record10,record11...]
[18:25:44] et09: this is some part of sql i've apparently forgotten (postgres in this case)
[18:26:02] techandy1: has joined #RubyOnRails
[18:26:07] et09: i do not want aggregate measures as in GROUP BY...
[18:26:10] yellow5: has joined #RubyOnRails
[18:26:26] techandy1: has left #RubyOnRails: ()
[18:27:13] artto: has joined #RubyOnRails
[18:27:22] thejamespinto: et09: my recommendation is that you create a custom method that does what you want manually with queries
[18:28:39] infinitone: has joined #RubyOnRails
[18:29:01] thejamespinto: instead of active_record `group` method, you may use the ruby `group_by` method instead (1..6).group_by { |i| i%3 } #=> {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}
[18:29:26] barhum2013: has joined #RubyOnRails
[18:29:56] thejamespinto: Model.all.group_by(&:category)
[18:30:34] jhbs: Hi James
[18:30:58] mrichman: has joined #RubyOnRails
[18:31:45] futilegames: has joined #RubyOnRails
[18:32:08] arup_r: has joined #RubyOnRails
[18:32:34] flashpoint9: has joined #RubyOnRails
[18:32:48] nurey: has joined #RubyOnRails
[18:34:26] jmignault: has joined #RubyOnRails
[18:35:27] IFrank00: has joined #RubyOnRails
[18:35:28] IFrank004: has joined #RubyOnRails
[18:38:32] DriesS: has joined #RubyOnRails
[18:39:21] jenrzzz: has joined #RubyOnRails
[18:39:29] jmignault: has joined #RubyOnRails
[18:39:37] rubyonrails634: has joined #RubyOnRails
[18:40:09] barhum2013: has joined #RubyOnRails
[18:42:12] hahuang65: has joined #RubyOnRails
[18:42:53] Regulati_: has joined #RubyOnRails
[18:43:17] sneakerhax: has joined #RubyOnRails
[18:47:54] gingray: has joined #RubyOnRails
[18:48:41] manfrin: has joined #RubyOnRails
[18:54:10] manfrin_: has joined #RubyOnRails
[18:56:26] ksoze: has joined #RubyOnRails
[18:57:53] SteenJobs: has joined #RubyOnRails
[18:59:11] DoctorMonocular: has joined #RubyOnRails
[19:01:01] idefine: has joined #RubyOnRails
[19:02:20] srinidhi: has joined #RubyOnRails
[19:03:39] mac10: has joined #RubyOnRails
[19:04:04] mac10: hey can someone help me with using a weather api on Heroku?
[19:04:17] mac10: it works on my local host, but when it’s not showing up on heroku
[19:04:36] havenwood: mac10: What do the logs say when it doesn't work?
[19:04:37] mac10: it is a static rack website. except i’m not sure how to work with APIs w/ heroku
[19:05:31] havenwood: mac10: Please say in both channels when you crosspost.
[19:06:21] mac10: havenwood: i think it’s more of how I never called the API than it’s not working. I can’t find an example of how to use it
[19:06:34] mac10: havenwood: I never used the openweathermap API key.
[19:07:23] mac10: havenwood: May I pm you my repo? it’s a very basic app
[19:08:06] jstransky: has joined #RubyOnRails
[19:08:24] jhbs: hi hi hi hi hi hi hi hi hi hi
[19:08:55] havenwood: mac10: If it's a public repo just post it publicly so others can answer.
[19:09:17] havenwood: mac10: If it's not a Rails app then #ruby is probably a better channel.
[19:09:25] hcnewsom: has joined #RubyOnRails
[19:09:31] mac10: havenwood: ok
[19:10:38] idefine: has joined #RubyOnRails
[19:11:23] DoctorMonocular: has joined #RubyOnRails
[19:14:46] tubbo: mac10: making outbound connections on heroku is identical to making outbound connections on your workstation. you're talking to the same service, anyway.
[19:15:34] aegis3121: has joined #RubyOnRails
[19:17:23] lacrosse: has joined #RubyOnRails
[19:17:32] yellow5: has joined #RubyOnRails
[19:18:59] felipecvo: has joined #RubyOnRails
[19:18:59] idefine: has joined #RubyOnRails
[19:23:20] |meta: has joined #RubyOnRails
[19:26:00] replay: has joined #RubyOnRails
[19:26:29] bool_: has joined #RubyOnRails
[19:27:16] ksoze: has joined #RubyOnRails
[19:28:20] arup_r: has joined #RubyOnRails
[19:28:39] arup_r: I have a question. I am getting output as 0, because I am using build? https://gist.github.com/aruprakshit/aaa727e59a429962c5d1ee7f021a5521
[19:28:59] arup_r: output of `puts dynamic_form.dynamic_form_field_module_implementations.count`
[19:29:00] Vlat-: has joined #RubyOnRails
[19:29:52] idefine: has joined #RubyOnRails
[19:30:17] wtiger: has joined #RubyOnRails
[19:31:17] mrchris: how do you get a parent association from a has_many through? Here is my example
[19:31:17] mrchris: http://pastie.org/private/z3yuhrbzdv0wj37emsgudq
[19:31:58] wtiger: I have a (devise)model which belongs_to another model, and I'm trying to sign it up and create that object, but the other model has no objects (yet)
[19:32:00] mrchris: oops, i forgot to include the AudiencesMember model in my example there.
[19:32:06] wtiger: how to solve this conundrum?
[19:32:24] DanByc: has joined #RubyOnRails
[19:32:25] Vlat-: Hi! I'd like to have a question, about Rails idiomacy. I learn RoR (1231203-th time) from Michael Hartl book. In that book he puts very large amount of user authorization methods into helper (SessionHelper to be precise). I feel very strange about it, since always supposed, that Helpers are more about Views, than business logic. If someoune read that book - could you react to my fears?
[19:32:34] norc_: __chris, has_many does not indicate a parent relationship.
[19:33:17] norc_: Vlat-, indeed you would be correct.
[19:33:44] thejamespinto: I'd like to have a question too, with ice please
[19:33:50] norc_: Vlat-, session management is something that probably belongs into the controller level.
[19:33:58] Vlat-: or, at last, where's the right place for logged_in? current_user, authorize, remember! ...so on methods in MVC paradigm? (i suppose method names are self-describing)
[19:34:16] hcnewsom: has joined #RubyOnRails
[19:34:28] norc_: Vlat-, or at the least that is where the common framework expose it at.
[19:34:35] norc_: *frameworks.
[19:34:36] thejamespinto: Vlat-: he is just being agnostic, he is teaching you what you can do with what rails gives you, instead of creating custom classes or using gems
[19:34:37] Vlat-: norc_: thx, i supposed so
[19:35:06] arup_r: thejamespinto: +1
[19:35:46] markkraemer: has joined #RubyOnRails
[19:36:12] thejamespinto: Vlat-: he's teaching you how to use the helpers folder, if he were to write software using what he actually believes, 1. novices would not understand, 2. pros would disagree with his choices
[19:36:19] jenrzzz: has joined #RubyOnRails
[19:36:19] jenrzzz: has joined #RubyOnRails
[19:36:23] marchelzo: has joined #RubyOnRails
[19:36:46] Vlat-: i meant no offence for Mr. Hartl, guys! :)
[19:36:47] norc_: thejamespinto, the best way to teach about the helpers folder is to avoid it unless you really need some random helper method in lots of views.
[19:36:53] thejamespinto: Vlat-: so he uses that as a way to teach you what you can do with Rails, it's your responsibility to grow out of those
[19:38:00] thejamespinto: norc_: I agree with you, helpers are a measure of last resort, they should be externalized into a gem "rails-helpers"
[19:38:20] skroon: has joined #RubyOnRails
[19:38:44] null__: how would I use a select() to only use an object instead of an object and method? I'd like to just have the param as [:object] instead of [:object][:method].
[19:38:54] skroon: does config.logger use the format of config.log_formatter ? or are the two completely seperate things?
[19:39:10] tubbo: skroon: it does.
[19:39:22] tubbo: null__: no idea what you're asking.
[19:39:49] thejamespinto: null__: can you please say that out loud so you can get as confused as we are?
[19:40:59] _djbkd: has joined #RubyOnRails
[19:41:09] norc_: null__, I would like to pass an argument, but I get a bus error 10. What does it mean?
[19:41:35] norc_: That might give an indication of the level of confusion your question might have provoked.
[19:41:48] skroon: tubbo: oke, because when an error/exception happens I would like to write the exception to disk in .json format... but if I make my own log_formatter, then everything will be json?
[19:42:08] idefine: has joined #RubyOnRails
[19:42:38] Vlat-: If i'm already there, I'd like to ask another question (about idiomacy). What's the most correct place for a sort-of-global things, like check_authorization method for :before_filter-s around the app ?
[19:42:40] null__: a select() in a rails form appends a &object[method]=value to a get request
[19:42:41] tubbo: skroon: well that's not what i would use a log formatter for...it's easier/better for monitoring to catch those exceptions globally like the way Airbrake works.
[19:42:57] norc_: skroon, I think you might have to insert or replace the appropriate rack middleware
[19:43:26] Vlat-: (keeping in mind, that polluting ApplicationController isn't nice
[19:43:27] skroon: tubbo: right, I wanted to use it for somethingl ike Airbrake, Google Stackdriver Error Reporting
[19:43:30] norc_: null__, say what?
[19:43:30] tubbo: Vlat-: probably better if you just describe what you want to do and we can give you the best practice response.
[19:43:34] skroon: norc_: ah right
[19:43:39] dandaman: has joined #RubyOnRails
[19:43:48] tubbo: null__: f.select does, yeah :) but there's also ActiveRecordModel.select
[19:43:56] tubbo: we weren't sure which one you were referring to
[19:43:56] iwada: has joined #RubyOnRails
[19:44:23] null__: http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#method-i-select this one
[19:44:24] tubbo: null__: can you make a f.select :whatever tag actually put a hash of attributes into the query params? i really have no idea. doesn't seem like that would work, though.
[19:44:25] norc_: tubbo, care to clarify?
[19:44:39] tubbo: about what
[19:46:10] markkraemer: Has any had issues with a CST being used in a view and CDT being used in the controller?
[19:46:20] markkraemer: I created a gist of what this looks like: https://git.io/vr6Il
[19:46:33] null__: I don't see that in the documentation
[19:46:44] Vlat-: tubbo: well... I have relatively strong background in OS X programming (I have to use MVC pattern everywhere), and now I'm learning RoR. Since I'm trying to be as pedantic, as it possible - I have lot of question, about refactoring my user authentication code, i wrote last couple of days. It's based on Michael Hartl book, but with several differences, like fear of Helper methods. So, in short - authorization made idiomatically.
[19:46:47] null__: (also I'm using form_tag)
[19:46:59] macsteps: has joined #RubyOnRails
[19:47:34] triptec: has joined #RubyOnRails
[19:47:45] Vlat-: My largest problem is about 'religion'. I still dunno, what (and where) to put in Rails MVC. It's a bit different from my past world.
[19:48:23] Vlat-: the most simple way is to put everything to helpers, like Mike did, but ...it's too lame :)
[19:49:04] norc_: Vlat-, the important bit is to understand autoloading
[19:49:18] norc_: Vlat-, everything in /app is just convention and could be named whatever you wanted it to.
[19:49:28] thejamespinto: Vlat-: in religion, you pick the pieces you like and ignore the ones you don't like :)
[19:49:55] Vlat-: it's hard to be pedantic :)
[19:52:01] tildes_: has joined #RubyOnRails
[19:52:24] thejamespinto: Vlat-: let me tell you something that makes Rails awesome, it doesn't use a lot of namespaces... both models and controllers are always associated to the top level namespace, that's not common in other MVC frameworks, so when you expose that to other people, they think it's User is easier than Rails::App::Models::User, you see?
[19:52:24] Vlat-: however, there're several gotchas in rails. For example. If i put auth logic to Model - i won't have access to sessions and cookies. Will have to pass them as hash, or parameters. Very ugly way. :)
[19:52:53] tubbo: Vlat-: if you want to see how authentication could be made "idiomatically", check out devise.
[19:53:44] thejamespinto: Vlat-: here are your best options for authentication https://www.ruby-toolbox.com/categories/rails_authentication
[19:54:20] thejamespinto: and here are the ones for authorization
[19:54:21] thejamespinto: https://www.ruby-toolbox.com/categories/rails_authorization
[19:55:23] Vlat-: thejamespinto: thx!
[19:56:26] Vlat-: i know these, but as tubbo suggested - will definitely take a look into Devise (however, I found it a bit overbloated at first sight)
[19:56:56] thejamespinto: Vlat-: you are just learning to manipulate the elements... remember, all the methods you get inside a controller can also be reached by calling it thru self, so instead of session, you can say self.session or self.params or self.cookies, that's how you know "what belongs where"
[19:57:37] thejamespinto: Vlat-: I'm about to release my own authenticator for Rails, I've been working on it for a long time :)
[19:58:08] null__: eh I think I should use select_tag instead of select :>
[19:58:15] null__: that works a lot better
[19:58:26] Vlat-: thejamespinto: once I read Metaprogramming Ruby (2-nd edition). When I finished the book, I supposed I do understand scope of self. Using Rails - i completely lost with it. :)
[19:59:36] tubbo: Vlat-: i question why you think it was bloated
[19:59:47] thejamespinto: Vlat-: it's a big world, the general advise is to read books and find a mentor, usually somebody you work for
[19:59:56] HenriettaSalt: has joined #RubyOnRails
[20:00:17] tubbo: i find it to be pretty complete with regards to what most people want/need out of user auth. sends emails, resets passwords, confirms emails, locks accounts when too many bad passwords are typed in..
[20:00:22] flashpoint9: I love devise for authentication, way easier than doing it by hand for a nub at least. I did authentication from hand using railscast
[20:00:25] tubbo: i typically don't need much more than that
[20:00:37] flashpoint9: devise was easier by far
[20:01:12] yellow5: has joined #RubyOnRails
[20:01:46] DoctorMonocular: has joined #RubyOnRails
[20:03:13] triptec: has joined #RubyOnRails
[20:03:21] Vlat-: tubbo: answering your question. It's a working solution for everything you can imagine. However, my oppinion can't be relevant, since, as I mentioned, I'm newbie yet.
[20:04:36] Vlat-: tubbo: in fact, Devise is so cool, so you might consider it as framework upon RoR, like RoR is framework upon Ruby. :)
[20:05:13] tubbo: Vlat-: but you know how to write OS X applications, so it's not like you have zero experience. you can tell when software does things that it's not supposed to do.
[20:05:22] tubbo: Vlat-: for example, systemd.
[20:06:19] futilegames: has joined #RubyOnRails
[20:06:22] Vlat-: hm...it's offtopic, but what's wrong with systemd? :))
[20:07:46] Devalo: has joined #RubyOnRails
[20:08:29] mdw: has joined #RubyOnRails
[20:08:38] cnk: has joined #RubyOnRails
[20:10:02] tubbo: haha it was just a joke, there are flame wars going on regarding how much it imposes itself upon the linux ecosystem
[20:11:03] Vlat-: guys, thank you a lot for a help! really appertiate it!
[20:11:24] Vlat-: and tubbo...
[20:11:42] xibalba: has joined #RubyOnRails
[20:11:43] ferr: has joined #RubyOnRails
[20:12:04] man: has joined #RubyOnRails
[20:12:07] Vlat-: tubbo: linux "ecosystem"... SysV vs systemd... - take look at our brand cool BSD init!
[20:12:12] djbkd: has joined #RubyOnRails
[20:12:31] Vlat-: tubbo: nah, this is a flame! :))))
[20:12:35] Criten: has left #RubyOnRails: ()
[20:13:00] Guest26047: Did u use IDE for ror dev?
[20:13:11] tubbo: Guest26047: no
[20:13:20] Guest26047: vim or emacs
[20:13:36] GodFather: has joined #RubyOnRails
[20:14:11] Vlat-: I used vim (properly configured, since I'm vim maniac), then SublimeText (properly configured).
[20:14:55] Vlat-: Then I found RubyMine and IDEA engine became my favorite toy
[20:15:12] Guest26047: I use rubymine before, because It's some fun, like local history
[20:15:22] Vlat-: real-time static-analyzis and code introspection is awesome
[20:15:32] Guest26047: Do vim or sublime can do this?
[20:15:44] tubbo: Guest26047: i use vim
[20:15:48] tubbo: i used sublime before
[20:15:52] tubbo: Guest26047: define "local history"
[20:16:13] Vlat-: no. static analysis in fact is like you have your code always loaded in interperter
[20:16:27] tubbo: Vlat-: lies
[20:16:33] Vlat-: and every time you push a button on keyboard the code state changes
[20:16:34] tubbo: syntastic.vim + rubocop
[20:17:02] tvw: has joined #RubyOnRails
[20:17:14] Vlat-: tubbo: eeeeeeer... it's rather like wrap-around, or something like that
[20:17:18] idefine: has joined #RubyOnRails
[20:18:33] tubbo: syntastic runs, or can run, linter tools as well as `ruby -S` to keep you warned when you break convention
[20:18:33] Vlat-: tubbo: you change something in model, then go back to controller, and start typing. Do the auto-completion assertions will change, according to changes issued to a model ?
[20:18:39] Guest26047: I have not found vim/emacs/subl have powerful local history like rubymine. It's hard to choice ,may be I am not good at vim/emacs
[20:19:56] tubbo: Vlat-: oh, static analysis != auto-completion :) no, that doesn't change automatically. i have to manually run `ctags -R .` or something. but i frankly don't move around my code like that. rails has a strict "file -> code identifier" rule most of the time.
[20:20:15] srinidhi: has joined #RubyOnRails
[20:20:23] Vlat-: tubbo: auto completion was just an example, in case of my answer
[20:20:25] tubbo: app/controllers/admin/application_controller.rb points to Admin::ApplicationController
[20:20:27] jhack: has joined #RubyOnRails
[20:20:39] tubbo: so i don't really need to have an IDE knowing which method is defined where
[20:20:50] tubbo: Guest26047: define "local history"
[20:20:53] tubbo: Guest26047: define "local history"
[20:20:57] tubbo: in case you didn't see it because i already said it :D
[20:21:14] Vlat-: tubbo: man, i really fan of vim, there's no need to advocate it to my hubmle one :D
[20:21:44] tubbo: Vlat-: i was moreso advocating rails' conventions :) with OS X apps it just makes no sense to write code outside of Xcode, right? but with Rails, i feel like one of the benefits is that you don't actually need an IDE to work with it.
[20:22:17] marr: has joined #RubyOnRails
[20:22:24] tubbo: i frankly don't need any kind of history in my editor (except Undo for the current session i suppose) because of GIt
[20:22:27] Vlat-: just there're couple of things, IDEA do better. When I need fast and reliable editor - I use vim. When I have to deeply debug to some deeply nested method - i'd prefer IDEA
[20:23:06] gambl0re: has joined #RubyOnRails
[20:23:53] Vlat-: tubbo: minitest or RSpec ? :))
[20:24:13] tubbo: i use rspec on my own projects
[20:24:39] jhack: has joined #RubyOnRails
[20:24:58] Guest26047: @Viat I aggre with you,Everything can not be too extreme
[20:25:27] Vlat-: tubbo: I knew. :) we're orthogonal. I preferer minitest :)
[20:25:38] djbkd: has joined #RubyOnRails
[20:26:08] tubbo: Vlat-: i find it interesting that you call yourself a newbie but also have a bunch of opinions about tools
[20:26:16] idefine: has joined #RubyOnRails
[20:26:54] idefine: has joined #RubyOnRails
[20:27:31] Vlat-: tubbo: erm... I use
[20:28:24] Vlat-: rails since 2005 in fact, since Ryan started his famous RailsCasts. But rails always was on second-, or even third line for me.
[20:29:12] Vlat-: I know this-or-that, I know pretty lot about Rails itself. But now, since i decided to learn it _really_ well, i found, that i know very few, about methodology
[20:29:45] Vlat-: so all my questions are rather about "where to put such piece of code", rather that for "how to do this or that"
[20:29:58] darkxploit: has joined #RubyOnRails
[20:30:23] Vlat-: but, enough about me :)
[20:31:00] cnk: has joined #RubyOnRails
[20:31:31] lightt: has joined #RubyOnRails
[20:32:07] tubbo: yeah so i remember minitest back in the day and having to constantly juggle all of its BS plugins just to get test output to look nice
[20:32:12] tubbo: or minitest to play nice with my toolchain
[20:32:25] Vlat-: really, it's a shame to pollute the channel with discussion of humble myself %)
[20:32:29] tubbo: whereas with rspec, it "just worked"...even though its actual implementation is a lot more complicated
[20:32:45] tubbo: but i frankly don't care, as long as there are tests i'm ok with it
[20:33:05] Vlat-: rspec is a bit of natural language IMHO, while minitest is simple ruby
[20:33:37] Vlat-: why should we use another DSL, if we can test the things natural way
[20:34:46] epochwolf: ACTION is a minitest fan
[20:34:55] Vlat-: IMHO natural language is good for integration tests. Suppose "When user visit / it should get http response 200 and page should contain this and that". Like cucumber does
[20:35:34] epochwolf: I'm going to be my grumpy crotchety self and hate on cucumber.
[20:36:36] universa1: cucumber *rolleyes* ;)
[20:37:11] Guest26047: I remember someone said 'don't use cucumber'
[20:37:41] Vlat-: well, minitest ActionDispatch::IntegrationTest - has almost the same functionality as cucumber
[20:38:27] emachnic: has joined #RubyOnRails
[20:38:29] Guest26047: https://www.jimmycuadra.com/posts/please-don-t-use-cucumber/
[20:38:41] Vlat-: i used to LOVE cucumber, but SimpleCov sucks with it
[20:38:49] Vlat-: so i use minitest :)
[20:39:16] Guest26047: why not rspec
[20:40:00] arBmind: has joined #RubyOnRails
[20:40:13] codergeek: has joined #RubyOnRails
[20:41:00] Vlat-: Guest20497: I prefer programmer-way in testing, than natural-language-alike DSL
[20:41:25] chouhoul_: has joined #RubyOnRails
[20:41:34] triptec: has joined #RubyOnRails
[20:41:51] Guest26047: rails is DSL.
[20:41:59] DoctorMonocular: has joined #RubyOnRails
[20:42:12] Terens: has joined #RubyOnRails
[20:42:26] Terens: is there a gem that helps with seo 301?
[20:42:52] universa1: how is seo 301 different from a 301?
[20:44:25] Terens: Maybe because it rewrites old links to new
[20:44:53] Vlat-: Guest20497: i prefer to consider it like microsoft MFC, or stuff like that
[20:45:21] tubbo: Terens: there's a gem that helps with seo 3001 A SPACE ODYSSEYYYYYYYY
[20:45:46] Vlat-: Guest20497: framework, but not DSL.
[20:45:48] tubbo: Guest26047: i remember someone said "eat shit, suck a dick, and sell drugs".
[20:46:04] tubbo: but hey, who cares what people say
[20:46:11] Guest26047: http://stackoverflow.com/questions/2822002/why-is-ruby-on-rails-called-a-domain-specific-language
[20:46:37] tubbo: Guest26047: haha what an idiot
[20:46:51] tubbo: i'm gonna start asking troll questions on SO
[20:46:58] davidw: has joined #RubyOnRails
[20:47:10] tubbo: "Why is Go called a 'systems programming' language if you can't program with it?"
[20:47:20] Vlat-: Guest20497: well, in that case, according your link - only assembler is not a DSL
[20:47:33] Vlat-: but wait...
[20:48:48] Vlat-: mov ax, 13h - "mov" is a shortcut to "move a parameter to register"
[20:48:57] Vlat-: so everything is DSL :)
[20:49:24] jsrn: has joined #RubyOnRails
[20:50:04] tubbo: !offtopic
[20:50:04] helpa: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Rails related topics. Thanks!
[20:50:35] tubbo: Vlat-: i hated cucumber, it was such a waste of time and energy
[20:50:43] Vlat-: yep, sorry guys. That DSL thing insulted me a bit
[20:50:46] tubbo: it was a solution to a problem that never existed
[20:50:58] emachnic: has joined #RubyOnRails
[20:51:14] Vlat-: tubbo: even Bytes used to love Cucumber, AFAIK
[20:51:27] tubbo: like unless you actually had stakeholders of your app writing gherkin and you were just implementing what they wanted, there's no actual use case for it.
[20:51:44] tubbo: and since that never happened, i stand by my assertion that cucumber was totally useless. the only good thing that came out of cucumber was rspec.
[20:51:53] Vlat-: tubbo: however, Cucumber is a bit outdated now, since it can be _completely_ replaced by minitest
[20:52:07] tubbo: it can be replaced by literally anything because it was useless haha
[20:52:37] wmoxam: tubbo: that's a big "only"
[20:52:44] Vlat-: well, i disagree with "useless". It was a cool tool to write REAL tests :)
[20:52:54] Vlat-: at first stage parsing
[20:53:47] tubbo: something being a cool tool doesn't necessarily mean it's not useless.
[20:53:53] tubbo: there are plenty of cool things that are fundamentally useless.
[20:54:06] datanoise: has joined #RubyOnRails
[20:54:19] tubbo: when you are building projects that count hours, you don't want to be wasting your time maintaining code you don't need to maintain
[20:54:40] tubbo: and afaict, cucumber just means "i have to write this test twice"
[20:55:16] art-solopov: has joined #RubyOnRails
[20:56:58] RegulationD: has joined #RubyOnRails
[20:58:19] Guest26047: has joined #RubyOnRails
[21:02:53] emachnic: has joined #RubyOnRails
[21:03:26] blackmesa: has joined #RubyOnRails
[21:04:13] hcnewsom: has joined #RubyOnRails
[21:05:46] ur5us: has joined #RubyOnRails
[21:07:41] eljimmy: has joined #RubyOnRails
[21:08:31] SteenJobs: has joined #RubyOnRails
[21:12:36] Laos: has joined #RubyOnRails
[21:12:47] gambl0re: has joined #RubyOnRails
[21:12:47] gambl0re: has joined #RubyOnRails
[21:14:22] smathy: has joined #RubyOnRails
[21:19:17] Devalo: has joined #RubyOnRails
[21:25:54] workmad3: has joined #RubyOnRails
[21:28:36] Jasaka: has joined #RubyOnRails
[21:29:12] djbkd: has joined #RubyOnRails
[21:29:29] Laos: has joined #RubyOnRails
[21:31:33] lightt: has joined #RubyOnRails
[21:32:01] barhum2013: has joined #RubyOnRails
[21:33:07] jhack: has joined #RubyOnRails
[21:38:38] DoctorMonocular: has joined #RubyOnRails
[21:39:08] theod: has joined #RubyOnRails
[21:40:11] pipework: tubbo: Not if you make your cucumber call your other test.
[21:40:13] helpa: Cucumber - Successor to stories for rspec http://github.com/aslakhellesoy/cucumber/tree/master
[21:40:21] helpa: Regex Driven Development. See cucumber.
[21:42:53] Radar: GOOD MORNING
[21:43:07] tvw: has joined #RubyOnRails
[21:48:19] pramsky: has joined #RubyOnRails
[21:49:11] rabbo: has joined #RubyOnRails
[21:50:25] macsteps: has joined #RubyOnRails
[21:55:13] edwinvdgraaf: has joined #RubyOnRails
[21:55:39] sid_fules: has joined #RubyOnRails
[21:59:04] solars: has joined #RubyOnRails
[21:59:14] nickenchuggets: has joined #RubyOnRails
[21:59:17] rabbo: Hi I have a GET form which points to request.original_fullpath and it doesn't seem to be preserving the existing params. It looks like request.original_fullpath is escaping the params, specifically with &amp;, but I'm not sure if that's why it's not working.
[22:01:07] rabbo: I'd like to just merge the params I'm sending with the existing ones
[22:01:35] mac10: has joined #RubyOnRails
[22:02:05] sypheren: has joined #RubyOnRails
[22:05:23] upsell5: has joined #RubyOnRails
[22:05:29] der-landgraf: has joined #RubyOnRails
[22:06:21] marchelzo: has joined #RubyOnRails
[22:07:56] jancel: has joined #RubyOnRails
[22:10:59] deadhound: has joined #RubyOnRails
[22:12:59] infinitone: has joined #RubyOnRails
[22:13:10] sid_fules: has joined #RubyOnRails
[22:13:15] diegoviola: has joined #RubyOnRails
[22:14:30] diegoaguilar: has joined #RubyOnRails
[22:15:34] diegoaguilar: has joined #RubyOnRails
[22:15:35] jancel: has joined #RubyOnRails
[22:16:58] diegoaguilar: has joined #RubyOnRails
[22:17:24] sypheren: has joined #RubyOnRails
[22:17:45] diegoaguilar: has joined #RubyOnRails
[22:18:21] macsteps: has joined #RubyOnRails
[22:18:56] diegoaguilar: has joined #RubyOnRails
[22:19:56] dandaman: has joined #RubyOnRails
[22:20:07] diegoaguilar: has joined #RubyOnRails
[22:21:09] diegoaguilar: has joined #RubyOnRails
[22:28:20] smathy: rabbo, !gist your view code
[22:28:20] helpa: rabbo: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:31:01] lightt: has joined #RubyOnRails
[22:42:02] rabbo: I think I came up with a workaround https://gist.github.com/anonymous/97138ac1de20acab871d95304be2b2c4
[22:42:35] DoctorMonocular: has joined #RubyOnRails
[22:44:03] rabbo: kind of unrelated, but is there a difference between 'get' and :get in the context of form tags?
[22:44:45] pipework: rabbo: not really, iirc.
[22:47:21] ZeroeSparticus_: has joined #RubyOnRails
[22:47:46] zeitue: has joined #RubyOnRails
[22:49:05] SteenJobs: has joined #RubyOnRails
[22:50:57] timdotrb: has joined #RubyOnRails
[22:51:03] m_antis: has joined #RubyOnRails
[22:52:09] jancel: has joined #RubyOnRails
[22:52:30] cnk: has joined #RubyOnRails
[22:54:07] Guest26047: has joined #RubyOnRails
[22:56:04] Jasaka|NA: has joined #RubyOnRails
[22:56:09] triptec: has joined #RubyOnRails
[23:00:33] tildes_: has joined #RubyOnRails
[23:01:21] DoctorMonocular: I'm hoping the thing I need already mostly exists: I have at least 2 separate applications that need a single authentication source. I'd like to set up an authentication app/api that the other 2 rails apps can call into to authenticate users. Is there a working example of something like this? Bonus points if the auth app is set up to take google credentials?
[23:02:01] macsteps: has joined #RubyOnRails
[23:07:42] jstransky: has joined #RubyOnRails
[23:16:26] SteenJobs: hey guys and gals - the creative director/founder (so no, i can’t tell him to just eff himself/do things differently) insisted on having control over designing our home page, but he knows 0 coding…so he created the home page in photoshop and exported the html/css/js and sent me the files asking me to add it to our app
[23:16:48] smathy_: has joined #RubyOnRails
[23:16:55] SteenJobs: is there any way around things like, for example, rewriting all the hrefs to image assets in the html file with image_tags?
[23:17:09] Guest26047: has joined #RubyOnRails
[23:20:48] Devalo: has joined #RubyOnRails
[23:21:08] mikecmpbll: SteenJobs : you don't have to use the asset pipeline.
[23:22:11] SteenJobs: mikecmpbll: that’s what i presumed - so given that’s the case, the current html file which he wants as our home page, references everything as if it’s in the same directory as the html file - in this kind of situation if i’m avoiding the AP, where would you recommend placing the requisite assets?
[23:22:39] ksoze: has joined #RubyOnRails
[23:23:01] mikecmpbll: SteenJobs : how're you loading the "home page" html?
[23:23:56] SteenJobs: mikecmpbll: i decided instead of installing wordpress on our server and having to host the “home page” that way, i’m just replacing the old home.html.erb (in my view folder) with the new html file
[23:24:16] SteenJobs: i guess i can put it into public instead?
[23:25:16] marchelzo: has joined #RubyOnRails
[23:26:01] mikecmpbll: SteenJobs : what's the route to the home page?
[23:27:35] SteenJobs: mikecmpbll: tis the root route, so “/“ (static_pages#home)
[23:27:54] mikecmpbll: you could probably just put the whole thing in public/—just trying to think it through in my head
[23:28:10] mikecmpbll: call it index or whatever.
[23:29:25] SteenJobs: mikecmpbll: right might be easiest, and then just move the CSS/JS assets into the public dir along with it. as for routing, can i route directly to the public folder? i guess i can really just route to home.html.erb, and have a single line “render path_for_index” to render the appropriate html
[23:29:39] barhum2013: has joined #RubyOnRails
[23:29:47] Liothen: has joined #RubyOnRails
[23:29:58] mikecmpbll: an index.html file in public will be loaded automatically on the root path iirc
[23:30:54] phredus: has joined #RubyOnRails
[23:31:10] SteenJobs: oh no kidding, that’s incredibly convenient haha
[23:31:15] SteenJobs: gonna try now
[23:37:28] mikecmpbll: (if you don't configure a root node, i should add)
[23:38:23] flashpoint9: has joined #RubyOnRails
[23:38:32] SteenJobs: mikecmpbll: removed root from routes, and it worked. automatically serves index
[23:38:40] diegoaguilar: has joined #RubyOnRails
[23:38:51] SteenJobs: mikecmpbll: only issue is, it seems that the image references are absolute and not relative paths
[23:39:01] SteenJobs: so /images/my_image is looking in the root dir and not the public dir
[23:39:12] SteenJobs: shit. comp about to die…one sec.
[23:40:28] diegoaguilar: has joined #RubyOnRails
[23:40:32] mikecmpbll: not sure what you mean.
[23:41:11] diegoaguilar: has joined #RubyOnRails
[23:41:59] diegoaguilar: has joined #RubyOnRails
[23:42:23] dandaman: has joined #RubyOnRails
[23:42:47] diegoaguilar: has joined #RubyOnRails
[23:43:35] diegoaguilar: has joined #RubyOnRails
[23:43:57] SteenJobs: has joined #RubyOnRails
[23:44:10] SteenJobs: mikecmpbll: back. was working outside and not paying attention to my battery ha
[23:44:33] SteenJobs: the beauty of tethering. sooo sweet.
[23:44:36] diegoaguilar: has joined #RubyOnRails
[23:44:41] triptec: has joined #RubyOnRails
[23:45:38] Ropeney: has joined #RubyOnRails
[23:46:19] quazimodo: has joined #RubyOnRails
[23:46:21] SteenJobs: mikecmpbll: haha oy. forgot to uncomment the stylesheet links. maybe it’s too hot out...
[23:46:24] quazimod1: has joined #RubyOnRails
[23:46:28] Darmani: Hi there! I have a test that only fails when I try to update a users info. If I visit the page normally the page displays but if I edit a user and click submit I'll be given the nil-class error.
[23:46:29] Darmani: https://gist.github.com/mfifth/a950909f48f334f4d78b938b41e8f205
[23:46:34] SteenJobs: but all seems to be working :)
[23:46:39] Darmani: If someone has any ideas I'd appreciate it ^^
[23:47:52] sypheren: has joined #RubyOnRails
[23:49:43] mikecmpbll: Darmani : are you setting the @forums variable in UsersController#update?
[23:50:19] mikecmpbll: presumably you're just rendering the view
[23:50:21] dalbuschat: has joined #RubyOnRails
[23:50:32] Darmani: mikecmpbll: No, is that what I'm missing?
[23:50:42] SteenJobs: mikecmpbll: although…how would one link to the home page then if no route is being generated?
[23:50:58] mikecmpbll: Darmani : you haven't provided the code for the controller that's actually handling the request, so it's hard to tell what's going on
[23:51:26] Darmani: mikecmpbll: You're right, sorry I should have linked that.
[23:51:59] mikecmpbll: Darmani : you can edit gists. also, a tip for future is to name the files with their correct file extensions and gist will add syntax highlighting :)
[23:52:22] Darmani: mikecmpbll https://gist.github.com/mfifth/a950909f48f334f4d78b938b41e8f205
[23:52:42] SteenJobs: mikecmpbll: nevermind got the answer :) just gotta assign a named route to the static asset
[23:53:09] Radar: Darmani: @forums is not set
[23:53:28] Spami_: probably stupid question, but a sudden spike in mrtg could mean DDOS?
[23:53:54] Darmani: Radar: yeah I saw that.
[23:54:58] Darmani: mikecmpbll: The issue was a bad link. I had a redirect_to admin_users_path (which doesn't exist). Once I changed the helped the error disappeared.
[23:55:24] jancel: has joined #RubyOnRails
[23:55:25] Darmani: @forums still isn't defined in the controller though
[23:56:01] Darmani: mikecmpbll: Well I mean it's not defined in the Users controller but it is in the base admin controller.
[23:56:45] sid_fules: has joined #RubyOnRails
[23:56:49] mikecmpbll: /shrugs. it's unclear how things move from userscontroller#update to the "admin index view"
[23:57:26] Darmani: mikecmpbll: It redirects with a helper. admin_root_path.
[23:57:28] mikecmpbll: there's a redirect to admin_users_path but i don't know what that is and you've just introduced some uncertainty about that.
[23:57:38] y2mq37: has joined #RubyOnRails
[23:57:44] Darmani: mikecmpbll: yeah that was the issue.
[23:57:52] mikecmpbll: oh okay. glad you've got it sorted :)
[23:58:07] Darmani: mikecmpbll: I wouldn't even have looked at it had you not pointed me in the right direction.
[23:58:14] Ropeney: has joined #RubyOnRails
[23:58:19] Darmani: ACTION bows