« Back to channel list

#RubyOnRails - 17 August 2015

« Back 1 day Forward 1 day »
[00:01:15] VeryBewitching: Inside: Yes, in some cases it's best to write SQL. AR performs the update on each so it can run callbacks and validation on each.
[00:02:47] helpa-bot: has joined #RubyOnRails
[00:03:01] VeryBewitching: Inside: Actually, use this: http://apidock.com/rails/ActiveRecord/Base/update_all/class
[00:03:09] Inside: well I was just using something in theory
[00:03:25] Inside: doing the funky AR updates is kind of a pain in the butt
[00:03:57] VeryBewitching: Inside: You're not accustomed to it yet would be my guess.
[00:04:14] Scripore: has joined #RubyOnRails
[00:04:38] helpa: has joined #RubyOnRails
[00:04:42] VeryBewitching: Inside: If you haven't, I really suggest you go over the guides and build by example before trying to make use of a legacy database with your application.
[00:06:14] helpa: has joined #RubyOnRails
[00:06:52] ishahnaz: has joined #RubyOnRails
[00:07:51] gilest: has joined #RubyOnRails
[00:08:23] oscarbr92: has joined #RubyOnRails
[00:08:38] VeryBewitching: I'm trying to insert Warden::Manager after ActionDispatch::Flash, engine code: https://gist.github.com/bewitchingme/1cf1c29b1bdb3772d764 <-- the comment on line 14 is what I want to do, but I get this error: No such middleware to insert after: ActionDispatch::Flash
[00:08:50] nya: has joined #RubyOnRails
[00:09:15] VeryBewitching: Can anyone give me a hint as to what I'm doing wrong?
[00:11:29] oscarbr92: I'm using rails 4.1.8 and I'm trying to edit a user. I insert the date of birth with a text input, but when I populate the inputs in the edit view that field is shown as 3 select for day month and year
[00:11:38] oscarbr92: How can I prevent that?
[00:11:49] Radar: VeryBewitching: Likely that the engine doesn't have that middleware, but the application does.
[00:11:58] Radar: oscarbr92: !rule145
[00:11:59] Radar: oscarbr92: !rule14
[00:11:59] helpa: oscarbr92: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us.
[00:12:15] Aeyrix: Are we up to 145 rules now?
[00:12:38] VeryBewitching: Radar: Oh so ActionDispatch::Flash isn't on the stack at the time the engine is added?
[00:12:47] Radar: VeryBewitching: No, they are different stacks.
[00:12:59] Radar: VeryBewitching: iirc, the engine has its own middleware stack and the application has its own too.
[00:13:01] oscarbr92: Radar: well, I don't think this is the kind of issue that requires stack tracing debuggin, rather some experience with the framework
[00:13:13] Radar: oscarbr92: Are you going to show code or not?
[00:14:00] VeryBewitching: Radar: Ohhh... OK, that makes sense. Is there any way to see the stack for the engine, rake middleware does not show any output.
[00:14:01] oscarbr92: Radar: what code do you need? view's?
[00:14:15] Radar: oscarbr92: Whatever you think is causing the problem. Show us the views to start with.
[00:14:20] Radar: VeryBewitching: that part I don't know :)
[00:14:27] VeryBewitching: Radar: OK, thanks :D
[00:16:28] oscarbr92: Radar: http://pastie.org/10355669
[00:16:51] Radar: oscarbr92: which field should I be looking at here?
[00:16:59] oscarbr92: Radar: fecha_nacimiento field
[00:17:06] oscarbr92: spanish for birth date
[00:17:17] oscarbr92: using simple_form btw
[00:17:29] Radar: And when it re renders it displays as 3 separate fields rather than a text field?
[00:17:37] Radar: Probably because in one instance it gets a date, the other it gets a string
[00:18:00] Radar: Do you want it as text?
[00:18:02] oscarbr92: but i want text field cos Im using a jquery plugin to set the date
[00:18:22] Radar: <%= medico.input :fecha_nacimiento, as: :text, label: 'Fecha de Nacimiento', input_html: { class: 'datepicker' } %>
[00:18:31] Radar: The as option should make it always display as a text field
[00:19:36] oscarbr92: Radar: dude, almost there but it's showing it as a textarea haha
[00:19:59] Radar: try as: :string
[00:20:11] Radar: https://github.com/plataformatec/simple_form#available-input-types-and-defaults-for-each-column-type
[00:20:40] oscarbr92: Radar: thank you that did the trick :D
[00:21:38] axl_: has joined #RubyOnRails
[00:22:59] drale2k: has joined #RubyOnRails
[00:24:15] roolo: has joined #RubyOnRails
[00:27:39] Cache_Money: has joined #RubyOnRails
[00:27:55] Gribo: has joined #RubyOnRails
[00:27:59] djbkd: has joined #RubyOnRails
[00:29:52] darrencauthon: has joined #RubyOnRails
[00:30:11] christiandsg: has joined #RubyOnRails
[00:32:29] Moonlight-Angel: has joined #RubyOnRails
[00:33:52] northfurr: has joined #RubyOnRails
[00:37:10] frzng: has joined #RubyOnRails
[00:37:28] LambdaSource: has joined #RubyOnRails
[00:38:29] LambdaSource: has joined #RubyOnRails
[00:39:27] LambdaSource: has joined #RubyOnRails
[00:40:15] DoctorMonocular: has joined #RubyOnRails
[00:40:28] doodlehaus: has joined #RubyOnRails
[00:41:13] sevenseacat: has joined #RubyOnRails
[00:41:32] LambdaSource: has joined #RubyOnRails
[00:44:53] quazimodo: has joined #RubyOnRails
[00:45:16] quazimodo: has joined #RubyOnRails
[00:54:40] workmad3: has joined #RubyOnRails
[00:55:05] CanTonic: has joined #RubyOnRails
[00:59:21] EminenceHC: has joined #RubyOnRails
[01:00:10] gilest: has joined #RubyOnRails
[01:03:04] havenwood: has joined #RubyOnRails
[01:03:21] RahulT: has joined #RubyOnRails
[01:05:10] Inside: so if I create associations in my models
[01:05:30] Inside: the model MUST have something that it's associated to?
[01:06:06] Guest74305: has joined #RubyOnRails
[01:06:09] Inside: ie: if I have an item model and then a location model, I can't have a null for item.location, eh?
[01:06:36] baweaver: it just means it doesn't have one assigned to it yet.
[01:06:53] Inside: I'd need to assign a presence_of validation to it then huh
[01:06:55] baweaver: unless you make it required.
[01:07:07] baweaver: yeah, or mysql can't be null columns
[01:08:52] Inside: okay so, back to defining my model
[01:09:17] Inside: for my item table, I uhh what.. do I want to do a belongs_to: item ?
[01:09:21] x-light: has joined #RubyOnRails
[01:09:32] Inside: then it has to be indexed?
[01:12:49] Inside: well, I guess t.belongs_to creates an index
[01:14:45] chipotle: has joined #RubyOnRails
[01:17:00] w09x: has joined #RubyOnRails
[01:21:22] charliesome: has joined #RubyOnRails
[01:23:04] erts: has joined #RubyOnRails
[01:25:38] sevenseacat: ACTION waits
[01:26:03] Aeyrix: For what?
[01:26:22] Inside: sevenseacat: back to fiddling with models: If I have an "Item" model and a "Location" model... the table for Item (as declared with a migration) doesn't get a t.reference :location?
[01:26:36] hobodave: has joined #RubyOnRails
[01:26:42] Inside: if I'm going by the association basic tutorial, the location gets a t.belongs_to :item
[01:26:46] sevenseacat: i have no idea what you want your associations to look like, so
[01:26:57] Inside: a location would have many items
[01:28:44] sevenseacat: then a location has no reference to an item, but an item has a reference to a location
[01:28:56] sevenseacat: the item record has the FK to a location
[01:29:09] Inside: ACTION nodnods.
[01:29:34] Inside: sevenseacat: I'd like to be able to look up all items at a certain location
[01:29:46] sevenseacat: @location.items ?
[01:29:58] Inside: sevenseacat: I mean as far as setting up the schema
[01:30:17] bruno-: has joined #RubyOnRails
[01:30:22] Inside: if something has a has_many, does the "other side" of the association also need to have the belongs_to?
[01:30:36] vedu: has joined #RubyOnRails
[01:30:36] sevenseacat: it doesnt *have* to.
[01:30:48] Inside: what are the pros/cons?
[01:30:59] darrencauthon: has joined #RubyOnRails
[01:31:03] sevenseacat: err, if you want to use the association, then you include it?
[01:31:04] Inside: I'm assuming that if location has a has_many :items... then you can do location.items
[01:31:23] Inside: then you can do.. items.location if it has a belongs_to?
[01:31:32] sevenseacat: no, @item.location, not items
[01:31:32] bonhoeffer: has joined #RubyOnRails
[01:31:40] p1k: has joined #RubyOnRails
[01:31:40] Inside: oops, yes
[01:33:15] bonhoeffer: has joined #RubyOnRails
[01:33:23] Inside: and you don't do create_table :locations do |t| t.has_many... because that wouldn't make sense as a column
[01:34:16] sevenseacat: we try not to do things that doesnt make sense
[01:36:02] northfurr: has joined #RubyOnRails
[01:37:00] Inside: and if you do create_table :items do |t| t.belongs_to :location without doing index: true then any Location.items call would be very resource intensive...
[01:37:21] sevenseacat: you should always add indexes to fields you do lookups by.
[01:37:41] Inside: I'm guessing the index that's created is sorted by location?
[01:38:18] Inside: I'm a little fuzzy on how indices work
[01:38:59] sevenseacat: you don't really need to know for now - its fine to know that they speed up lookups when you're looking up by an indexed field
[01:39:21] sevenseacat: unless you're having database performance programs, then you can look into them in more depth
[01:39:33] Inside: I'm not, but it's nice to know how things work
[01:39:38] TheMonster: has joined #RubyOnRails
[01:39:46] Inside: I've been fiddling with raw SQL for a while since it seems to make more sense
[01:39:56] sevenseacat: true, but thats a really big rabbit hole of 'how does X work? well it depends on Y. how does Y work? well it depends on Z...'
[01:40:10] Inside: it's all electrons deep down inside
[01:40:36] sevenseacat: and in the end you'll be looking at interpreter bugs or something instead of looking at your rails app
[01:40:44] sevenseacat: or cpu architecture
[01:40:54] Inside: high energy neutrinos from outerpsace
[01:40:58] Inside: outerspace
[01:42:09] Rubie: has joined #RubyOnRails
[01:42:21] earthquake: has joined #RubyOnRails
[01:42:37] bonhoeffer: assets are not compiling unless i restart . . . any troubleshooting options
[01:42:47] sevenseacat: restart what?
[01:43:08] Inside: are you running in dev mode, bonhoeffer?
[01:43:30] bonhoeffer: sevenseacat: sorry, rails s ??? restart the server
[01:43:51] sevenseacat: do you have cached or precompiled assets somewhere that need to be removed?
[01:44:20] bonhoeffer: https://gist.github.com/tbbooher/bb5dffa8fd3f5aa37b72 ??? i keep clobbering assets
[01:44:52] sevenseacat: that doesnt really answer the question
[01:45:21] sevenseacat: if you run `rake assets:clean` and `rake tmp:clear` and DON"T precompile your assets again, does the problem go away?
[01:48:36] elv: has joined #RubyOnRails
[01:48:55] bonhoeffer: no it doesn???t
[01:49:11] cornerma1: has joined #RubyOnRails
[01:49:21] sevenseacat: okay. so what exactly is the problem? you're making changes to css and they're not coming through in your app?
[01:49:57] bonhoeffer: correct ??? until i restart the server
[01:50:40] andrewx10: has joined #RubyOnRails
[01:50:55] sevenseacat: got an example you can show us or something?
[01:51:08] sevenseacat: its quite hard to debug stuff we only get descriptions of
[01:51:58] ertse: has joined #RubyOnRails
[01:54:12] pontiki: is it a browser cache refresh problem?
[01:54:44] christiandsg: has joined #RubyOnRails
[01:55:06] bonhoeffer: pontiki: good question, i???ll check the caching
[01:55:11] lake: has joined #RubyOnRails
[01:55:45] Inside: I gotta say
[01:55:52] Inside: coffeescript errors are ... hard to diagnose
[01:56:15] earthquake: has joined #RubyOnRails
[01:57:10] erts: has joined #RubyOnRails
[01:57:52] bonhoeffer: yeah ??? and i was just looking for things to check . . . i know you can???t solve this for me
[01:58:01] bonhoeffer: thanks for the good questions
[01:58:14] bonhoeffer: thought something in the rails initializer would be to blame
[01:58:32] pontiki: bonhoeffer: if you happen to be using chrome, you can turn cache-ing off with the dev tools
[01:59:33] bonhoeffer: do you know where/how?
[01:59:33] mwlang: has joined #RubyOnRails
[02:00:31] pontiki: open the console, click on the gear in the top right
[02:00:54] pontiki: "Disable cache while DevTools is open"
[02:03:59] mwlang: how *not* to construct a partial/view: https://gist.github.com/mwlang/c3df6c17d658bf7b442f
[02:04:41] pontiki: or any view
[02:04:42] mwlang: if anyone can actually tell me what that does, I just might be compelled to buy you a coffee/beer. :-)
[02:05:04] mwlang: partial / view = partial (or) view. :-D
[02:05:42] bronson: has joined #RubyOnRails
[02:06:21] mwlang: There???s about five bugs in this???but one started my trip into this deep dark blackhole.
[02:06:40] mwlang: using Time.today and combining it with rescue false
[02:07:13] mwlang: y???all know how long it takes to find the lines of code that???s breaking when all exceptions are swallowed?
[02:08:36] rakm: has joined #RubyOnRails
[02:09:54] arta82: has joined #RubyOnRails
[02:11:35] one_zero: has joined #RubyOnRails
[02:12:21] roolo: has joined #RubyOnRails
[02:12:51] sevenseacat: rescue false is a bad idea, all of the time
[02:17:48] lwu: has joined #RubyOnRails
[02:18:09] Inside: how do I create a constraint that allows for values to be either null or be unique
[02:21:45] Inside: allow_nil: true
[02:21:47] Inside: I guess >_>
[02:23:14] mwlang: sevenseacat: ain???t dat zee truth! It???s miserable because every time something goes wrong, the first thing I do is check the logs.
[02:23:23] mwlang: and of course, there???s no exceptions logged.
[02:24:02] mwlang: but things don???t really go ???wrong??? per se. Things, like discounted pricing fail to calculate but all the end user sees is full prices all the time.
[02:25:37] julienk: has joined #RubyOnRails
[02:26:20] mwlang: it takes someone else to notice ???that ain???t right??? for us to start investigating???.and sadly, rescue nil is used in just about half of all the methods in this app???somebody drank all 24 batches of this Kool aid in one sitting.
[02:31:28] nertzy: has joined #RubyOnRails
[02:32:12] rogue_koder: has joined #RubyOnRails
[02:33:03] KensoDev: has joined #RubyOnRails
[02:33:07] shippy: has joined #RubyOnRails
[02:36:16] darrenca_: has joined #RubyOnRails
[02:41:39] siemprefresco: has joined #RubyOnRails
[02:43:09] MrButh: has joined #RubyOnRails
[02:43:11] bruno-: has joined #RubyOnRails
[02:43:18] workmad3: has joined #RubyOnRails
[02:44:04] jeadr: has joined #RubyOnRails
[02:45:06] michael_mbp: has joined #RubyOnRails
[02:46:20] rakm: has joined #RubyOnRails
[02:47:08] darrencauthon: has joined #RubyOnRails
[02:48:46] christiandsg: has joined #RubyOnRails
[02:50:26] segy: has joined #RubyOnRails
[02:54:18] havenwood: has joined #RubyOnRails
[02:57:05] s2013: has joined #RubyOnRails
[02:58:17] Mia: has joined #RubyOnRails
[03:00:16] bonhoeffer: i need to change the name of my views directory ??? any tips?
[03:00:53] bonhoeffer: prepend_view_path 'app/views/mycustomfolder'
[03:01:12] bonhoeffer: Aeyrix: for glory, and honor, why else?
[03:01:30] baweaver: I think you're missing the point of Rails
[03:01:49] baweaver: most views end up namespaced in controller/model centric folders
[03:01:55] baweaver: then maybe partials inside of them
[03:02:16] baweaver: Problem is, giving a bad answer as to why does not help anyone here.
[03:02:32] baweaver: including yourself if you're expecting anything
[03:02:41] baweaver: give snark, likely to receive snark.
[03:02:46] dpg1: has joined #RubyOnRails
[03:03:21] Aeyrix: I just didn't bother.
[03:03:39] baweaver: Another likely result
[03:03:48] oscarbr92: Hello, I have a model with a has_one relashionship with another model, how can I find a given object with and Id and its nested model and assign it to a variable?
[03:04:07] nya: has joined #RubyOnRails
[03:04:16] Aeyrix: What have you tried?
[03:04:20] baweaver: A given parent with that child?
[03:04:34] oscarbr92: @usuario = Usuario.find(params[:id]).children @medico = @usuario.medico
[03:04:43] oscarbr92: @usuario = Usuario.find(params[:id]).children @medico = @usuario.medico
[03:05:01] Aeyrix: That would work.
[03:05:20] Aeyrix: But why would you bother assigning the child to a variable? It's already an attribute of @usuario.
[03:05:28] oscarbr92: Yes it does
[03:05:34] Aeyrix: @usuario.medico
[03:05:46] oscarbr92: Because I want to update the whole thing in one form
[03:06:06] Aeyrix: You'd just want `Usuario.find(params[:id]).medico` surely
[03:06:24] Aeyrix: I never realised how hard it was to read non-English code until just now.
[03:07:25] oscarbr92: The database tables must be named in spanish, therefore the models are in spanish as well
[03:07:37] oscarbr92: Not so fancy, but its a requirement from the company
[03:09:49] braincrash: has joined #RubyOnRails
[03:11:08] MaxTaxi: has joined #RubyOnRails
[03:11:08] MaxTaxi: has left #RubyOnRails: ()
[03:12:01] baweaver: It's not that bad to read, but then again I have a working knowledge of Spanish and some Portuguese.
[03:12:09] MaxTaxi: has joined #RubyOnRails
[03:12:16] mephistophocles: has joined #RubyOnRails
[03:14:49] cornerma1: has joined #RubyOnRails
[03:15:12] RahulT: has joined #RubyOnRails
[03:18:16] jeadr: has joined #RubyOnRails
[03:18:22] MaxTaxi: has left #RubyOnRails: ()
[03:18:52] sevenseacat: my brain is having so many sql fails today
[03:19:01] sevenseacat: freaking monday
[03:19:27] Creeves: has joined #RubyOnRails
[03:19:32] havenwood: thank goodness i live in the past where it's still Sun
[03:20:07] havenwood: though you get Fri early ;)
[03:20:21] bonhoeffer: anyone know how to do a nested resource with a route like /:name/ instead of /my_resources/:resource_id/?
[03:21:39] bonhoeffer: interesting: http://jasoncodes.com/posts/rails-3-nested-resource-slugs
[03:21:49] Cache_Money: has joined #RubyOnRails
[03:21:57] RahulT: has joined #RubyOnRails
[03:23:19] hololeap: has joined #RubyOnRails
[03:26:52] mblair: has joined #RubyOnRails
[03:27:16] mephistophocles: has joined #RubyOnRails
[03:27:25] diego2: has joined #RubyOnRails
[03:27:45] dopie: has joined #RubyOnRails
[03:33:34] lindii_: im trying to load some tab content. Anything i can improve in this code? https://gist.github.com/anonymous/29b24e8688a016ba163a
[03:34:00] northfurr: has joined #RubyOnRails
[03:37:19] Ropeney: has joined #RubyOnRails
[03:37:53] charliesome: has joined #RubyOnRails
[03:41:43] johntrails: has joined #RubyOnRails
[03:42:00] s2013: has joined #RubyOnRails
[03:45:30] StartupHub: has joined #RubyOnRails
[03:45:34] concernedcitizen: has joined #RubyOnRails
[03:45:34] concernedcitizen: has joined #RubyOnRails
[03:46:36] x-light: sevenseacat: are you past your sql fails..?
[03:46:54] sevenseacat: I hope I never have to look at that part of the code again.
[03:47:07] elv: has joined #RubyOnRails
[03:49:07] jeadr: has joined #RubyOnRails
[03:49:34] christiandsg: has joined #RubyOnRails
[03:56:21] lxsameer: has joined #RubyOnRails
[03:56:21] lxsameer: has joined #RubyOnRails
[03:56:23] fedexo: has joined #RubyOnRails
[03:57:12] bonhoeffer: has joined #RubyOnRails
[03:58:48] djbkd: has joined #RubyOnRails
[03:59:58] kachi8: has joined #RubyOnRails
[04:00:04] jeadr: has joined #RubyOnRails
[04:00:45] roolo: has joined #RubyOnRails
[04:00:55] sinplea: has joined #RubyOnRails
[04:04:05] quazimodo: has joined #RubyOnRails
[04:04:10] kegan_: has joined #RubyOnRails
[04:09:18] Radar: GitHub's not working for me (http://i.imgur.com/vfvkDVu.png) so I guess I can't do any more work today.
[04:10:17] Creeves: cool interrobang github
[04:10:42] Radar: https://twitter.com/ryanbigg/status/633128680206635008
[04:10:47] Radar: Literally cannot do anything right now.
[04:10:52] Radar: sucks to be me
[04:11:07] sarid: i'm not having trouble with it
[04:11:31] Aeyrix: >having your location on your tweets
[04:11:46] Radar: sarid: I think it's just me.
[04:11:49] Radar: Aeyrix: no stalking plzkthx
[04:11:51] Creeves: you got github shadowbanned
[04:12:06] Radar: Creeves: seems that way
[04:12:15] greg: has joined #RubyOnRails
[04:12:29] Aeyrix: I'm genuinely surprised I don't know anyone who works at Github.
[04:12:41] Creeves: oh i didn't see the one about it being due to their rate limit
[04:13:00] Creeves: you actually were essentially shadowbanned
[04:13:39] sarid: wait a few minutes and try again
[04:13:46] braincra-: has joined #RubyOnRails
[04:14:35] Creeves: think of it like the box that stops truck drivers driving 20 hours straight
[04:14:41] Creeves: github wants you to take a break
[04:14:44] Creeves: it cares about you
[04:14:46] Radar: So do I just sit here and twiddle my thumbs or do I need to go sit in the corner with the dunce cap on
[04:14:50] kachi8: has joined #RubyOnRails
[04:15:48] sarid: you could do both
[04:16:00] Aeyrix: Radar: go get coffee imo
[04:16:12] Aeyrix: Coffee patron.
[04:16:24] sarid: ban should only last about 5 minutes
[04:16:34] sarid: negotiate your girlfriend for sex
[04:16:39] sarid: then wait for 4 minutes
[04:16:44] Radar: Radar kicked sarid: thanks
[04:16:45] sarid: has joined #RubyOnRails
[04:17:02] Radar: wife, actually
[04:17:03] Aeyrix: You're a brave person, sarid.
[04:17:34] KensoDev: has joined #RubyOnRails
[04:17:41] VeryBewitching: There's no reason you can't be both.
[04:17:57] Creeves: you didn't factor in the time for 'negotiate your girlfriend'
[04:20:31] CanTonic: has joined #RubyOnRails
[04:20:56] johntrails: Can someone please help me.. I am getting a "ActiveModel::ForbiddenAttributesError"
[04:21:10] johntrails: my controller and html are on this pastie http://pastie.org/10355897#2
[04:21:52] quazimodo: has joined #RubyOnRails
[04:22:05] Radar: johntrails: stacktraceplz
[04:22:19] Radar: @company = Company.new(params[:company])
[04:22:24] Radar: You're not using company_params there
[04:22:27] Radar: you're using params[
[04:22:34] Radar: params[:company] which is different
[04:23:11] The_Phoenix: has joined #RubyOnRails
[04:23:43] tantjatem: has joined #RubyOnRails
[04:26:04] Cache_Money: has joined #RubyOnRails
[04:27:20] baweaver_: has joined #RubyOnRails
[04:27:41] quazimodo: has joined #RubyOnRails
[04:28:48] RahulT: has joined #RubyOnRails
[04:29:39] johntrails: Radar: thanks...
[04:31:57] johntrails: Radar: when i changed my def company_params to def params.. now I get a stack level too deep error
[04:32:05] workmad3: has joined #RubyOnRails
[04:32:38] Dopagod: has joined #RubyOnRails
[04:33:04] jeadr: has joined #RubyOnRails
[04:36:17] Radar: johntrails: That's not what I said to do.
[04:36:32] Radar: @company = Company.new(params[:company]) should be @company = Company.new(company_params)
[04:37:36] johntrails: thank you sir
[04:37:36] shippy: has joined #RubyOnRails
[04:46:10] nya: has joined #RubyOnRails
[04:46:19] ascarter: has joined #RubyOnRails
[04:46:43] RahulT: has joined #RubyOnRails
[04:46:54] stephen_g: has joined #RubyOnRails
[04:46:57] christiandsg: has joined #RubyOnRails
[04:48:26] nyaa: has joined #RubyOnRails
[04:48:50] nyaa: has joined #RubyOnRails
[04:49:52] sarink: has joined #RubyOnRails
[04:50:38] kegan_: using bootstrap-sass
[04:51:50] lethan: has joined #RubyOnRails
[04:52:37] kegan_: how do i render views now
[04:53:16] kegan_: why do those paths no longer work?
[04:55:11] jeadr: has joined #RubyOnRails
[04:55:53] kegan_: oh because that's
[04:55:53] darrencauthon: has joined #RubyOnRails
[04:55:56] kegan_: not configured
[04:56:05] kegan_: wow i have downs
[04:57:04] kp666: has joined #RubyOnRails
[04:59:44] bePolite: has joined #RubyOnRails
[04:59:44] bePolite: has joined #RubyOnRails
[05:00:40] RahulT: has joined #RubyOnRails
[05:01:20] sinkensabe: has joined #RubyOnRails
[05:02:28] htee: has joined #RubyOnRails
[05:02:57] srinidhi: has joined #RubyOnRails
[05:09:03] Aeyrix: Glad you figured it out.
[05:12:19] yardenbar: has joined #RubyOnRails
[05:12:30] dhjondoh: has joined #RubyOnRails
[05:13:34] n008f4g_: has joined #RubyOnRails
[05:15:50] RahulT: has joined #RubyOnRails
[05:17:16] ranchodev: has joined #RubyOnRails
[05:20:32] EminenceHC: has joined #RubyOnRails
[05:22:21] srinidhi: has joined #RubyOnRails
[05:23:05] baweaver_: has left #RubyOnRails: ()
[05:26:12] aganov: has joined #RubyOnRails
[05:27:35] havenwood: has joined #RubyOnRails
[05:29:49] concernedcitizen: has joined #RubyOnRails
[05:32:22] nya: has joined #RubyOnRails
[05:36:28] sinplea: has joined #RubyOnRails
[05:39:26] riotjones: has joined #RubyOnRails
[05:40:46] djbkd: has joined #RubyOnRails
[05:43:17] tantjatem: has joined #RubyOnRails
[05:45:35] kachi8: has joined #RubyOnRails
[05:48:45] roolo: has joined #RubyOnRails
[05:50:05] czerasz: has joined #RubyOnRails
[05:59:13] sarink: has joined #RubyOnRails
[06:03:26] charliesome: has joined #RubyOnRails
[06:03:27] greg: has joined #RubyOnRails
[06:03:36] christiandsg: has joined #RubyOnRails
[06:04:02] lampshades: has joined #RubyOnRails
[06:04:40] greg: i have a problem in runnig rails server
[06:04:51] lampshades: has joined #RubyOnRails
[06:07:45] Lightsword: has joined #RubyOnRails
[06:09:08] artto: has joined #RubyOnRails
[06:11:02] concernedcitizen: has joined #RubyOnRails
[06:17:28] chrissonar: has joined #RubyOnRails
[06:19:09] eGGsha: has joined #RubyOnRails
[06:20:25] christiandsg: has joined #RubyOnRails
[06:20:53] workmad3: has joined #RubyOnRails
[06:25:34] tvw: has joined #RubyOnRails
[06:27:21] vigasdeep: has joined #RubyOnRails
[06:30:29] roolo: has joined #RubyOnRails
[06:30:46] rromanch_: has joined #RubyOnRails
[06:37:10] artto: has joined #RubyOnRails
[06:40:19] benhuda: has joined #RubyOnRails
[06:41:45] ejnahc: has joined #RubyOnRails
[06:44:31] bruno-: has joined #RubyOnRails
[06:47:13] Macaveli: has joined #RubyOnRails
[06:51:32] dideler: has joined #RubyOnRails
[06:52:17] djbkd: has joined #RubyOnRails
[06:55:22] greenarrow: has joined #RubyOnRails
[06:56:04] jeadr: has joined #RubyOnRails
[06:56:24] DoctorMonocular: has joined #RubyOnRails
[06:57:57] sandstrom: has joined #RubyOnRails
[06:59:38] dionysus69: has joined #RubyOnRails
[07:04:06] Sylario: has joined #RubyOnRails
[07:04:50] hololeap: has joined #RubyOnRails
[07:11:23] Lightsword: has joined #RubyOnRails
[07:11:31] sameerynho: has joined #RubyOnRails
[07:11:45] freezevee: has joined #RubyOnRails
[07:11:46] alphaatom: has joined #RubyOnRails
[07:13:39] DoctorMonocular: has joined #RubyOnRails
[07:15:39] Ergo: has joined #RubyOnRails
[07:19:15] yfeldblum: has joined #RubyOnRails
[07:19:46] matcouto: has joined #RubyOnRails
[07:19:54] mrbubbles: has joined #RubyOnRails
[07:19:56] DoubleMalt: has joined #RubyOnRails
[07:20:02] dionysus69: i am looking at the bcrypt, it seems that for password securing it uses just hashing + salt so is that enough in general password security?
[07:20:12] lxsameer_: has joined #RubyOnRails
[07:23:00] universa1: bcrypt is considered one of the more secure password hashing algorithms to date.
[07:24:30] dionysus69: universa1: cool thats enough info i ll stick with it then :)
[07:25:22] drale2k: has joined #RubyOnRails
[07:25:30] sameerynho: has joined #RubyOnRails
[07:26:02] Macaveli: Anyone have an idea if you can allow dates like 01/00/1990 ?
[07:26:13] Macaveli: We need it for National Number checks
[07:26:38] universa1: this is not a valid date.
[07:26:45] sevenseacat: its really not.
[07:27:04] universa1: what are you actually trying to achieve?
[07:27:13] Macaveli: Well if you are a new Belgian Citizen you get a birthdate 00/00/1990
[07:27:26] Macaveli: I mean if they do not know the official birthdate
[07:27:33] Macaveli: immigrants for example
[07:27:43] sevenseacat: thats..... a bit dumb
[07:28:05] universa1: Macaveli: ok. i doubt the date columns in most databases allow that, so i'd save those three values separately.
[07:28:06] Macaveli: Belgian Law
[07:28:09] NBarnes: has joined #RubyOnRails
[07:28:16] sevenseacat: yeah databases wont, because its not a valid date.
[07:28:33] czerasz: has joined #RubyOnRails
[07:28:56] sevenseacat: Macaveli: there are plenty of dumb laws out there, Belgian ones are not immune.
[07:29:21] Macaveli: Yeah I still don't understand why they don't do 01/01/1990
[07:29:41] sevenseacat: or just, you know, nil or something
[07:29:51] lxsameer_: has joined #RubyOnRails
[07:29:53] sevenseacat: because null in a database means exactly 'unknown'
[07:30:19] techsethi: has joined #RubyOnRails
[07:32:02] sandstrom: has joined #RubyOnRails
[07:33:02] artto: has joined #RubyOnRails
[07:34:56] artto: has joined #RubyOnRails
[07:35:32] strcmp1: has joined #RubyOnRails
[07:35:53] LJT: has joined #RubyOnRails
[07:37:25] artto: has joined #RubyOnRails
[07:38:23] artto_: has joined #RubyOnRails
[07:41:03] Radar: mysql will allow it silently
[07:41:09] Radar: (default settings)
[07:41:11] Radar: PostgreSQL won't
[07:41:21] Radar: MySQL will default it to 0000-00-00 00:00:00
[07:42:33] Ayey_: has joined #RubyOnRails
[07:43:39] zpe: has joined #RubyOnRails
[07:43:50] Radar: gnight everyone
[07:44:38] charliesome: has joined #RubyOnRails
[07:45:10] charliesome: has joined #RubyOnRails
[07:45:39] Ayey_: So i have a House model which has_one Garden model. The Garden model has some default fields and these fields cannot be null. How would i go about creating a unique Garden model and assigning it to all my existing Houses? I'm using Rails 3
[07:46:59] dionysus69: I am getting this error on generating resource, I dont get what is the problem and google didnt help :\ https://gist.github.com/webzorg/58d3456abdb1b3e633fb
[07:47:32] x-light: has joined #RubyOnRails
[07:48:42] exadeci: has joined #RubyOnRails
[07:48:53] universa1: dionysus69: Permission denied @ rb_sysopen
[07:49:14] dionysus69: and what is rb_sysopen? is it dir?
[07:49:16] universa1: dionysus69: the user you're running that command as has no write access to the directory in
[07:49:31] universa1: which you're trying to write: /home/webgen/www/lasha/app/controllers/admin/users_controller.rb
[07:49:39] krz: has joined #RubyOnRails
[07:49:48] dionysus69: yes but i have generated everything in past, what changed now?
[07:50:04] universa1: you changed the permissions on the directory somehow.
[07:50:30] dionysus69: ok i ll use chmod I guess but i am confused on how the dir permission changed :\ thanks :)
[07:50:31] Ratler: has joined #RubyOnRails
[07:51:43] solars: has joined #RubyOnRails
[07:57:12] LordLogs: has joined #RubyOnRails
[08:03:42] MartinElvar: has joined #RubyOnRails
[08:04:09] artto: has joined #RubyOnRails
[08:04:57] blackmesa: has joined #RubyOnRails
[08:09:07] charliesome: has joined #RubyOnRails
[08:09:35] workmad3: has joined #RubyOnRails
[08:10:00] closer: has joined #RubyOnRails
[08:11:15] bePolite: has joined #RubyOnRails
[08:13:26] charliesome: has joined #RubyOnRails
[08:15:08] matcouto: has joined #RubyOnRails
[08:17:51] adre: has joined #RubyOnRails
[08:20:07] pyemkey: has joined #RubyOnRails
[08:21:44] sameerynho: has joined #RubyOnRails
[08:22:01] errakeshpd: has joined #RubyOnRails
[08:22:02] Macaveli: sevenseacat standard strptime doesn't work with 00/00/1990 damn it :p
[08:22:11] sevenseacat: surprise surprise
[08:22:59] errakeshpd: what is the command to clear delayed job from heroku ?
[08:23:02] pyemkey: Hello. I have a problem with creating custom json. I don't have idea why associations are ignored. Actually in my case only part about cars is loading. I've tried to put each one separately e.g include: [car: ...] include: [policy: ..] etc. This one works. Any idea why when I put all together only one is loaded. https://gist.github.com/pyemkey/aa430754f358d2d89236
[08:23:12] errakeshpd: what is the command to clear delayed job queue from heroku ?
[08:24:11] roolo: has joined #RubyOnRails
[08:25:21] universa1: errakeshpd: depends on which storage backend you use. but the command is the same as on a non-heroku deployment.
[08:25:28] universa1: errakeshpd: Delayed::Job.destroy_all
[08:28:02] errakeshpd: For heroku ?
[08:29:37] livathinos: has joined #RubyOnRails
[08:30:53] dionysus69: I am getting this error of uninitialized constant :| can you please take a look for any suggestions ? :\ thanks in advance https://gist.github.com/webzorg/248baccd050fd9f2e6c7
[08:30:54] ur5us: has joined #RubyOnRails
[08:32:17] ght: has joined #RubyOnRails
[08:32:47] dionysus69: before I get uninitialized constant error I get this : Unable to autoload constant User, expected /home/webgen/www/lasha/app/models/user.rb to define it, on second refresh I get that error I posted
[08:33:48] rvanlieshout: has joined #RubyOnRails
[08:36:13] duncannz: has joined #RubyOnRails
[08:38:55] dionysus69: morning, when I change create_table "admin_users" to create_table "users", after migration, it changes back to create_table "admin_users", why ??
[08:40:15] rvanlieshout: dionysus69: what changes back? the file?
[08:40:22] rvanlieshout: and you shouldn't change migrations after you've executed them
[08:41:14] darutoko: has joined #RubyOnRails
[08:41:27] ishahnaz: has joined #RubyOnRails
[08:42:57] dionysus69: yes, the line that says admin_users I want it to be users
[08:43:22] dionysus69: so in order to change migrate new file I need to delete current tables? (thats not a problem if its gonna solve it)
[08:43:41] rvanlieshout: dionysus69: if depends if you've pushed that migration file to source control yet
[08:43:54] rvanlieshout: and 'it' doesn't change migration files, so if the actual migration file is changed it's something you've done
[08:43:58] rvanlieshout: did you push the migration file?
[08:44:07] dionysus69: nope I havent commited anything yet
[08:44:08] rvanlieshout: if not, rollback the migration, edit and run again
[08:44:17] rvanlieshout: if so, just create a new migration file that changes the table name
[08:44:48] jeadr: has joined #RubyOnRails
[08:45:20] dionysus69: rollback doesnt work tells me uninitialized constant CreateAdminUsers :\
[08:45:34] rvanlieshout: then the file contains something invalid
[08:45:37] rvanlieshout: what's the filename
[08:45:39] rvanlieshout: and what content does it have?
[08:46:24] dionysus69: model file is at models/user.rb and has https://gist.github.com/webzorg/a267039554d40bd17941
[08:46:48] dionysus69: should it be Admin::User< ActiveRec...
[08:46:57] rvanlieshout: the migration file
[08:47:03] Gmi: has joined #RubyOnRails
[08:47:41] dionysus69: rvanlieshout: https://gist.github.com/webzorg/f40533b3149f2b475ea8:) its called 20150817073753_create_admin_users.rb
[08:47:44] andywww: has joined #RubyOnRails
[08:47:46] andywww: has left #RubyOnRails: ()
[08:47:58] rvanlieshout: dionysus69: the file is called create_admin_users
[08:48:01] rvanlieshout: and your migration create_users
[08:48:10] rvanlieshout: either rename the file or the class
[08:48:14] artto: has joined #RubyOnRails
[08:48:46] dionysus69: ugh so many links, sorry missed that one and thanks
[08:49:02] rvanlieshout: migration files don't really care about what you have in your models and such
[08:50:00] ishahnaz: has joined #RubyOnRails
[08:50:32] artto: has joined #RubyOnRails
[08:51:25] Gmi_: has joined #RubyOnRails
[08:51:26] ktchup: has joined #RubyOnRails
[08:51:42] errakeshpd: I was commited migration file but not commited the schema , any issue ?
[08:52:02] errakeshpd: after migration run the table was not in production
[08:53:13] errakeshpd: It commit was before 1 month.
[08:53:25] rvanlieshout: errakeshpd: the schema.rb is not used for migration
[08:53:40] rvanlieshout: so not commiting that shouldn't give a problem there, although it will give problems in other scenario's
[08:54:54] errakeshpd: So migration file is only required for creating table in the production right ? The commit (added migration file and not included schema ) was done before 1 month.
[08:55:06] errakeshpd: @rvanlieshout other scenerios ?
[08:55:33] lxsameer_: has joined #RubyOnRails
[08:55:48] rvanlieshout: rebuilding db, creating tenant with apartment gem, running tests
[08:56:31] charliesome: has joined #RubyOnRails
[08:56:45] arta82: has joined #RubyOnRails
[08:57:16] mikecmpbll: has joined #RubyOnRails
[08:59:39] blackmesa: has joined #RubyOnRails
[08:59:44] dionysus69: getting this error now :\ https://gist.github.com/webzorg/1b2489e97cd98dfd051f undefined local variable or method `f' for #<#<Class:0x007f1f9cd49258>:0x007f1f9e31b310>
[08:59:56] marr: has joined #RubyOnRails
[09:00:54] dionysus69: in the form for I changed @user var to [:admin, @user], I am getting that error after that
[09:01:31] Gmi: has joined #RubyOnRails
[09:01:46] mikecmpbll: dionysus69: looks like you're missing an if on line 3, sir.
[09:02:39] dionysus69: mikecmpbll: :D omg
[09:03:22] mikecmpbll: dionysus69: it's pretty obvious once you realise that if f is undefined then obviously you're closing the form block before you're trying to use f
[09:05:00] mojojoel: has joined #RubyOnRails
[09:05:07] Spami: has joined #RubyOnRails
[09:05:57] quazimodo: has joined #RubyOnRails
[09:08:42] sameerynho: has joined #RubyOnRails
[09:09:01] dionysus69: mikecmpbll: ye i ll need to think about it ))
[09:12:15] mojojoel: https://gist.github.com/mojojoel/ca53a969a26bfb6046ac Trying to add the result of this controller into a UserSerializer, any suggestions?
[09:13:48] blnkammo_: has joined #RubyOnRails
[09:14:27] sameerynho: has joined #RubyOnRails
[09:17:00] LJT: has joined #RubyOnRails
[09:20:36] ur5us_: has joined #RubyOnRails
[09:21:22] ur5us__: has joined #RubyOnRails
[09:22:57] LordLogs: has joined #RubyOnRails
[09:23:56] LordLogs: has joined #RubyOnRails
[09:25:24] lxsameer_: has joined #RubyOnRails
[09:26:32] RahulT: has joined #RubyOnRails
[09:28:19] five27: has joined #RubyOnRails
[09:30:15] GreatDanton: has joined #RubyOnRails
[09:33:19] Karpah: has joined #RubyOnRails
[09:34:20] blackhuey: has joined #RubyOnRails
[09:43:14] EminenceHC: has joined #RubyOnRails
[09:43:53] rromanchuk: has joined #RubyOnRails
[09:46:45] nya: has joined #RubyOnRails
[09:49:09] workmad3: has joined #RubyOnRails
[09:52:24] Gmi: has joined #RubyOnRails
[09:54:07] srinidhi: has joined #RubyOnRails
[09:55:55] Gmi: has joined #RubyOnRails
[09:58:24] Shoutsid: has joined #RubyOnRails
[09:58:43] RahulT: has joined #RubyOnRails
[10:03:53] strcmp1: has joined #RubyOnRails
[10:04:32] Grundell: has joined #RubyOnRails
[10:05:04] chipotle: has joined #RubyOnRails
[10:09:30] bronson: has joined #RubyOnRails
[10:11:29] wasp__: has joined #RubyOnRails
[10:12:17] roolo: has joined #RubyOnRails
[10:12:17] zly: Any idea what can cause this error: Faraday::Error::ConnectionFailed SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
[10:12:29] zly: It's after authing with google
[10:12:49] zly: Just in between accepting the permissions and firing a callback
[10:13:41] sevenseacat: i've only ever seen that error when installing gems using an old version of rubygems
[10:14:50] zly: But it's "openssl::ssl::sslerror:" or "Gem::RemoteFetcher::FetchError:"
[10:14:52] zly: usually
[10:14:58] zly: And now I have the faraday error
[10:15:46] techsethi: has joined #RubyOnRails
[10:15:54] defsdoor: has joined #RubyOnRails
[10:17:36] michael_mbp: has joined #RubyOnRails
[10:19:53] qzqrbo: has joined #RubyOnRails
[10:20:04] qzqrbo: has left #RubyOnRails: ()
[10:20:04] qzqrbo: has joined #RubyOnRails
[10:20:04] qzqrbo: has left #RubyOnRails: ()
[10:20:04] qzqrbo: has joined #RubyOnRails
[10:20:04] qzqrbo: has left #RubyOnRails: ()
[10:20:04] qzqrbo: has joined #RubyOnRails
[10:20:04] qzqrbo: has left #RubyOnRails: ()
[10:20:04] qzqrbo: has joined #RubyOnRails
[10:20:04] qzqrbo: has left #RubyOnRails: ()
[10:20:04] qzqrbo: has joined #RubyOnRails
[10:20:10] stamina: has joined #RubyOnRails
[10:20:19] AntiSpamMeta: has joined #RubyOnRails
[10:20:24] rickmasta: has joined #RubyOnRails
[10:21:17] lucha: has joined #RubyOnRails
[10:25:38] jaegerbombb: has joined #RubyOnRails
[10:25:51] sameerynho: has joined #RubyOnRails
[10:26:33] oddalot: has joined #RubyOnRails
[10:27:14] jaegerbombb: has joined #RubyOnRails
[10:27:46] mrbubbles: has joined #RubyOnRails
[10:29:57] jhass: zly: which adapter?
[10:30:54] jaegerbombb: hi I had a basic question about using jQuery/js in a rails application
[10:32:00] Gmi: has joined #RubyOnRails
[10:32:40] DoctorMonocular: has joined #RubyOnRails
[10:33:11] RahulT: has joined #RubyOnRails
[10:33:25] zly: jhass: looks like I had to reinstall ruby with specified openssl path
[10:33:53] drale2k: has joined #RubyOnRails
[10:34:26] Gmi: has joined #RubyOnRails
[10:34:47] eGGsha: has joined #RubyOnRails
[10:35:20] frzn: has joined #RubyOnRails
[10:35:20] frzn: has joined #RubyOnRails
[10:36:37] towski_: has joined #RubyOnRails
[10:38:15] lxsameer_: has joined #RubyOnRails
[10:39:19] user1138: has joined #RubyOnRails
[10:41:21] jaegerbombb: how do I get jquery to work on a heroku instance of rails?
[10:42:16] jaegerbombb: are there any key things that need adding apart from the basic ones? (require jquery/bootstrap)
[10:43:32] sameerynho: has joined #RubyOnRails
[10:46:17] sevenseacat: it works exactly the same way it works on your own computer
[10:47:34] jaegerbombb: somehow I feel like I need extra gems
[10:47:42] sevenseacat: you really don't.
[10:48:34] jaegerbombb: getting this error in my browser inspection panel "Uncaught ReferenceError: require is not defined"
[10:48:52] mrbubbles: has joined #RubyOnRails
[10:48:56] sevenseacat: seems unrelated to jquery
[10:49:06] sevenseacat: seems related to some other js library you're trying to use
[10:49:26] jaegerbombb: I am trying to use something called bigslide.js
[10:50:18] jaegerbombb: http://ascott1.github.io/bigSlide.js/
[10:50:25] jaegerbombb: works on local
[10:51:15] jaegerbombb: only other thing i'm doing is appending and removing paragraph tags in jquery
[10:51:21] sevenseacat: theres nothing there about "require"
[10:51:28] sevenseacat: so where are you calling "require"?
[10:51:33] arup_r: has joined #RubyOnRails
[10:51:59] sevenseacat: i'd check the version of jquery it requires versus the version you're using, also
[10:52:22] jgt: has joined #RubyOnRails
[10:53:28] jaegerbombb: I think it is in bigslide?
[10:53:46] darrencauthon: has joined #RubyOnRails
[10:57:27] errakeshpd: For opening , email, I added letter opener gem" and config.action_mailer.delivery_method = :letter_opener in development but the email was not opening in browser
[10:57:32] arup_r: I am using this gem https://github.com/stefanpenner/country_select#usage for countries.. It is fine in web form. But struggling to get it working with my API calls.. If I can it like this https://gist.github.com/aruprakshit/29ff55db0f8e4fd88631, getting country names wrapped in select tags.. But I want only code and names
[10:57:34] andywww: has joined #RubyOnRails
[10:57:37] arup_r: how to do so ?
[10:57:39] errakeshpd: using rails 3.2
[10:57:55] techsethi: has joined #RubyOnRails
[10:58:14] jaegerbombb: do I need something called commonjs
[10:58:38] sevenseacat: no idea what that is, sorry.
[10:58:41] The_Phoenix: has joined #RubyOnRails
[10:59:19] allcentury: has joined #RubyOnRails
[10:59:29] jhass: arup_r: https://github.com/stefanpenner/country_select/blob/master/country_select.gemspec#L28
[11:00:02] errakeshpd: For opening , email, I added letter opener gem" and config.action_mailer.delivery_method = :letter_opener in development but the email was not opening in browser
[11:00:11] The_Phoenix: has joined #RubyOnRails
[11:00:20] arup_r: jhass: ok internally another gem it is using.. let me see
[11:00:24] errakeshpd: Any thing i missed out ?
[11:01:02] artto: has joined #RubyOnRails
[11:01:23] The_Phoenix: has joined #RubyOnRails
[11:01:55] artto: has joined #RubyOnRails
[11:02:47] lxsameer_: has joined #RubyOnRails
[11:03:13] The_Phoenix: has joined #RubyOnRails
[11:03:13] The_Phoenix: has joined #RubyOnRails
[11:04:45] arup_r: jhass: the gem I am using wrapped it some how.. I am not able to use country gem directly..
[11:05:12] arup_r: If I try in console Country.translations #NameError: uninitialized constant Country
[11:05:12] jhass: pretty sure you are
[11:05:34] jhass: http://www.rubydoc.info/gems/countries
[11:06:29] jhass: note that bundler only requires things you have in your Gemfile for you
[11:06:33] rodfersou: has joined #RubyOnRails
[11:06:53] arup_r: ok.. So I need to add this gem again in Gemfile
[11:06:57] jhass: and note https://github.com/stefanpenner/country_select/blob/master/lib/country_select.rb#L3
[11:06:59] sandstrom: has joined #RubyOnRails
[11:07:04] jhass: no, that's not what I said
[11:07:19] jhass: though if you use it directly it's not a bad idea
[11:07:30] techsethi: has joined #RubyOnRails
[11:07:41] srinidhi: has joined #RubyOnRails
[11:07:54] eoy: has joined #RubyOnRails
[11:08:02] Encapsulation: has joined #RubyOnRails
[11:09:38] arup_r: Well without installing the gem can I use country gem .. I just want to list the names and id in mt JSON Api call
[11:09:55] arup_r: Because I have the contry_select gem installed.
[11:10:26] drale2k: has joined #RubyOnRails
[11:11:27] poli: has joined #RubyOnRails
[11:11:56] rickmasta: has joined #RubyOnRails
[11:12:22] arup_r: jhass: I see them to use https://github.com/stefanpenner/country_select/blob/fad7c1d4aa24af9c84b1718176392d56f201a1f3/lib/country_select/tag_helper.rb#L56
[11:12:29] arup_r: but if I try getting error
[11:12:44] arup_r: ISO3166::Country #NameError: uninitialized constant ISO3166
[11:12:55] jhass: sounds like the gem isn't loaded still
[11:13:26] arup_r: But I am using it in form .. in web part.. and it is working like a charm
[11:13:38] arup_r: Now I have started to build API
[11:13:50] sameerynho: has joined #RubyOnRails
[11:16:53] lxsameer_: has joined #RubyOnRails
[11:17:15] yardenbar: has joined #RubyOnRails
[11:18:29] slani: has joined #RubyOnRails
[11:20:56] ruurd: has joined #RubyOnRails
[11:21:29] artto: has joined #RubyOnRails
[11:23:21] bruno-: has joined #RubyOnRails
[11:25:04] _axx: has joined #RubyOnRails
[11:25:10] benhuda: has joined #RubyOnRails
[11:27:09] mrbubbles: has joined #RubyOnRails
[11:27:38] arup_r: jhass: any clue.. not able to figure out it yey
[11:27:49] livcd: has joined #RubyOnRails
[11:29:33] chills42: has joined #RubyOnRails
[11:29:34] multiscan: has joined #RubyOnRails
[11:30:03] jhass: my guess stands, you didn't load it
[11:30:10] quazimodo: has joined #RubyOnRails
[11:30:42] arup_r: I have the contry_select gem in my Gemfile
[11:31:25] NBarnes: has joined #RubyOnRails
[11:32:11] JEEB: hmm, is there a way to have a rails app not require write access into its directory?
[11:32:40] JEEB: as in, db migrations and such wouldn't try to write to the SQL file, and I guess I would just have to set the log file paths?
[11:33:10] bbrowning: has joined #RubyOnRails
[11:33:15] JEEB: s/SQL file/schema/
[11:38:04] jeadr: has joined #RubyOnRails
[11:38:34] fighella: has joined #RubyOnRails
[11:38:45] pontiki: JEEB: you want this on production?
[11:39:09] pontiki: JEEB: it's entirely possible to do that
[11:39:40] pontiki: JEEB: you can also tell Rails to write it's log files somewhere else
[11:41:22] JEEB: pontiki: yeah, I was thinking of deploying rails applications (with possibly unicorn) so that it wouldn't have write rights on its own app
[11:41:42] tyrone__: has joined #RubyOnRails
[11:41:54] JEEB: I just remember once running the migrations on a dev box and if it didn't have write rights on the schema it would yell loudly at me
[11:41:59] sandstrom: has joined #RubyOnRails
[11:42:01] JEEB: the logs are probably the simpler part :)
[11:42:10] doodlehaus: has joined #RubyOnRails
[11:42:20] pontiki: JEEB: the thing to consider in this, is when you want to deploy updates
[11:43:08] puppeh: has joined #RubyOnRails
[11:43:14] pontiki: Rails doesn't write to anything but the logs during normal operation (unless you tell it to do something)
[11:43:46] JEEB: so it was probably specifically running the migrations with rake which triggered the want to write
[11:44:19] suchness: has joined #RubyOnRails
[11:44:28] pontiki: yes, most likely. after the migrations are run, it writes the db/schema file
[11:45:19] pontiki: but that's also not a regular operation. that happens before you can start up the server
[11:45:29] suchness: Does anyone know of some gems that add before and after hooks to instance methods?
[11:45:38] ldnunes: has joined #RubyOnRails
[11:45:42] pontiki: so it's really only an issue during deployments, not after
[11:46:32] Quintasan: Does anyone have any idea how to debug partial rendering problems? https://gist.github.com/anonymous/fc43ae7201f3bad8e289 This failure is simply beyond me, I even inserted binding.pry, exectued the test case line by line and it doesn't throw any errors but the test case fails.
[11:46:56] Cervajz: has joined #RubyOnRails
[11:47:04] bruno-: has joined #RubyOnRails
[11:48:48] puppeh: any ideas why this error pops up after upgrading to rails 4.0? http://pastie.org/private/qynwfq5eswrorequggqdkg
[11:49:03] northfurr: has joined #RubyOnRails
[11:51:18] jhass: Quintasan: testimony.volunteer is nil according to the error, can't say why from the code you provided
[11:51:25] suchness: puppeh: Is testimonial.volunteer nil?
[11:51:36] Quintasan: The most retarded thing is that it's not.
[11:52:05] Quintasan: lemme run the pry session
[11:52:11] suchness: puppeh: sorry that was in response to Quintasan
[11:52:25] suchness: Quintasan: It most certainly is.
[11:53:21] arup_r: As per the doco.. I should be able to use this https://github.com/stefanpenner/country_select#getting-the-country-name-from-the-countries-gem .. but I am not https://gist.github.com/aruprakshit/29ff55db0f8e4fd88631
[11:53:31] arup_r: What is causing this issue
[11:53:46] Quintasan: suchness: https://gist.github.com/Quintasan/be8201eea610047afc5e
[11:54:11] jeadr: has joined #RubyOnRails
[11:54:12] Quintasan: This is from inside the test case.
[11:54:45] jhass: Quintasan: maybe it runs multiple times into that code?
[11:55:14] jhass: what happens if you call the full thing in pry?
[11:55:47] arup_r: I had a typo .. updated ???
[11:55:49] arup_r: https://gist.github.com/aruprakshit/29ff55db0f8e4fd88631
[11:56:07] Quintasan: jhass: Full thing beign the test case?
[11:56:17] Quintasan: or testimony.volunteer.user.photo.url(:medium) part?
[11:56:19] jhass: Quintasan: no the full call up to .url(:medium)
[11:56:32] Quintasan: [11] pry(#<#<Class:0x00000003172408>>)> testimony.volunteer.user.photo.url(:medium) => "/system/users/photos/000/000/477/medium/0.jpg?1439811281"
[11:56:35] multiscan: has joined #RubyOnRails
[11:56:42] chills42: has joined #RubyOnRails
[11:56:54] jhass: mh, try pry-rescue
[11:57:11] jhass: and add pry-stack_explorer for good measure
[11:57:45] jhass: I still think you'll probably have more than one render and just happen to be in one where it works
[11:58:44] Quintasan: jhass: Well, the partial is supposed to render 3 times since I take that many objects but all of them have the associations properly defined.
[11:59:32] suchness: Quintasan: Where are you setting the three testimonials?
[11:59:51] suchness: Quintasan: or where is the code you are using to render three times?
[12:00:27] roolo: has joined #RubyOnRails
[12:00:28] bonhoeffer: has joined #RubyOnRails
[12:00:38] puppeh: should we use ActionDispatch::Request.new or Rack::Request.new ?
[12:00:42] greenarrow: has joined #RubyOnRails
[12:01:17] rustymyers: has joined #RubyOnRails
[12:02:05] Quintasan: suchness, jhass: I honestly feel dumb now. One of my mates modified the factory which created the associations.
[12:02:07] Ropeney: has joined #RubyOnRails
[12:02:12] Quintasan: I'll revert this and see if it works.
[12:03:49] jhass: Quintasan: so you didn't actually verify it's okay for the other two renders? :P
[12:04:31] czerasz: has joined #RubyOnRails
[12:06:18] arup_r: jhass: I forgot that I am using this gem https://github.com/jim/carmen-rails not the one I was shouting :/
[12:06:26] arup_r: so now all is well
[12:08:04] migimunz: has joined #RubyOnRails
[12:08:50] darrencauthon: has joined #RubyOnRails
[12:09:37] migimunz: Hi, I have a pretty simple controller action that redirects to an absolute url. It works as expected in the browser, however capybara complains of an infinite redirect. Does anyone have any idea why this happens?
[12:09:40] nya: has joined #RubyOnRails
[12:13:04] suchness: migimunz: Would need to see the controller and routes, and spec.
[12:15:34] migimunz: suchness, I'll make a minimal example
[12:16:18] shmoon__: has joined #RubyOnRails
[12:16:42] Pathfinder: has joined #RubyOnRails
[12:18:04] sameerynho: has joined #RubyOnRails
[12:19:46] LJT: has joined #RubyOnRails
[12:20:55] errakeshpd: How to specify : in Gemfile, how can i mention in gemfile, gem omniauth facebook with git url ?
[12:21:36] migimunz: suchness, here's an example that causes the infinite redirect error: https://gist.github.com/migimunz/97549f11b8714a5aa17c
[12:21:43] errakeshpd: To fetch the latest version
[12:21:44] suchness: errakeshpd: gem 'name', 'version, git: 'location.git', branch: 'release-1.2'
[12:21:49] hahuang65: has joined #RubyOnRails
[12:22:11] suchness: errakeshpd: gem 'name', 'version', git: 'location.git', branch: 'some branch'
[12:23:44] northfurr: has joined #RubyOnRails
[12:23:45] errakeshpd: gem "omniauth-facebook", git: "https://github.com/mkdynamic/omniauth-facebook.git"
[12:23:49] andatche: has joined #RubyOnRails
[12:24:00] errakeshpd: Like this ? whether it will fetch the latest version ?
[12:24:11] blackmesa: has joined #RubyOnRails
[12:24:28] suchness: errakeshpd: Yes that should work. You can explicitly enter the version as you can with all gem statements if you need to.\
[12:24:49] JoshL: has joined #RubyOnRails
[12:25:31] IceyEC: has joined #RubyOnRails
[12:25:32] suchness: migimunz: Hmm, I don't see anything alarming in that code.
[12:26:30] migimunz: suchness: Neither do I - at first I though that maybe google redirects a couple of times to give you a "personalized page" or whatever, but I haven't found a single url that I can redirect to that doesn't cause the error.
[12:26:42] northfurr: has joined #RubyOnRails
[12:27:28] allcentury: has joined #RubyOnRails
[12:28:06] jkamenik: has joined #RubyOnRails
[12:28:12] suchness: migimunz: Maybe try with this syntax instead:
[12:28:24] suchness: get :redirecting_action
[12:28:24] suchness: response.should redirect_to('http://somehost.com/some/path')
[12:28:51] Macaveli: has joined #RubyOnRails
[12:29:24] migimunz: suchness, that does work, have it in another test, but I'm completely stumped on why the visit version doesn't
[12:30:19] suchness: migimunz: You've got me, I really couldn't say why that functions in a different manner.
[12:31:09] migimunz: suchness, thanks for the help anyway
[12:31:27] jarred: has joined #RubyOnRails
[12:31:56] jarred: what's the helper method that lets you do stuff like "A, B, C, and 15 more"? this does exist right?
[12:32:08] jarred: i can just write this but if it already exists in Rails might as well use that
[12:32:14] blackmesa: has joined #RubyOnRails
[12:32:27] universa1: jarred: if it is present you find it in activesupport
[12:32:33] jarred: what's the method called?
[12:32:54] Macaveli: has joined #RubyOnRails
[12:33:29] DoctorMonocular: has joined #RubyOnRails
[12:33:32] suchness: migimunz: Sure, wish I had more insight for you.
[12:33:50] Dbugger: has joined #RubyOnRails
[12:34:07] Dbugger: Guys. My Rails app show "We're sorry, but something went wrong.", but the logs are empty. Could you help me figure out what is happening?
[12:34:46] suchness: dbugger: Do you have a rack app that is redirecting to a static page?
[12:35:15] suchness: dbugger: What logs are you looking at?
[12:36:19] lxsameer_: has joined #RubyOnRails
[12:36:25] Dbugger: suchness, all logs are empty. production, and development
[12:36:36] Dbugger: suchness, I am running puma
[12:36:50] universa1: dbugger: so you have the terminal open with the server process?
[12:36:59] universa1: you see the output for other requests?
[12:37:01] suchness: dbugger: thin.log?
[12:37:59] Dbugger: universa1, what do you mean "with the server process"?
[12:38:04] Dbugger: suchness, where is that file?
[12:38:15] universa1: dbugger: the window where you have run rails s ?
[12:38:16] Dbugger: in log folder, those are the unique files
[12:38:22] suchness: dbugger: I am not sure, but you should check the logs dedicated to puma.
[12:38:25] codeshah: has joined #RubyOnRails
[12:38:25] sonOfRa: has joined #RubyOnRails
[12:38:30] Dbugger: universa1, there is no "rails s", This is just on production
[12:38:43] universa1: dbugger: you never mentioned production.
[12:38:45] SteenJobs: has joined #RubyOnRails
[12:38:50] sameerynho: has joined #RubyOnRails
[12:39:03] universa1: dbugger: you see the output for other requests?
[12:39:09] Dbugger: Sorry, I meatn production
[12:39:24] Dbugger: universa1, what "other requests"?
[12:39:30] universa1: dbugger: the ones working?
[12:39:36] Papierkorb: has joined #RubyOnRails
[12:40:09] erich: has joined #RubyOnRails
[12:40:12] Dbugger: universa1, no requests are working..
[12:40:26] universa1: dbugger: ok.
[12:40:43] universa1: dbugger: so if it is production, how are you accessing your rails app?
[12:41:13] Dbugger: universa1, I am not accessing it. I opened http://MYIP
[12:41:25] Dbugger: and it showed me "We are sorry, but something went wrong"
[12:41:30] Dbugger: and through SSH I see nothing in the logs
[12:41:35] jarred: w/e i just wrote one
[12:41:37] universa1: dbugger: ok. are you using nginx / apache?
[12:41:44] lxsameer: has joined #RubyOnRails
[12:42:15] universa1: jarred: the point was, if the method is defined, you will find it in activesupport, but nobody will look through the docs / code to find it for you ;)
[12:42:31] universa1: jarred: but it might as well be, that it is not defined in as.
[12:42:38] universa1: dbugger: so you only have one vhost active?
[12:43:22] Dbugger: The vhost was working 2 hours ago
[12:43:33] Dbugger: it broke when I did a "git pull origin master" for my rails app
[12:43:40] sameerynho: has joined #RubyOnRails
[12:43:50] jarred: ah i just thought if it existed maybe someone would remember the name of the method offhand, this is a common thing probably a number of people have had to implement
[12:43:51] universa1: dbugger: so did you check the nginx logs?
[12:44:09] Dbugger: Where are they?
[12:44:20] KimJongUn: has joined #RubyOnRails
[12:44:23] universa1: dbugger: we don't know. it varies between operating systems.
[12:44:40] universa1: dbugger: but often a place like /var/log/ is a good place to start looking
[12:44:56] migimunz: suchness, I feel like a total idiot now - capybara was configured to use webkit as a js driver, but apparently used RackTest and didn't follow redirects correctly. I set the driver to webkit, now it works fine.
[12:45:43] Dbugger: Wait I found them
[12:46:04] krim: has joined #RubyOnRails
[12:46:46] Dbugger: universa1, in the error.log of nginx, i found this:
[12:46:54] Dbugger: 2015/08/17 08:46:27 [error] 14599#0: *4011 connect() to unix:/home/deploy/bookcaneer/shared/sockets/puma.sock failed (111: Connection refused) while connecting to upstream, client: 84.141.80.164, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:/home/deploy/bookcaneer/shared/sockets/puma.sock:/favicon.ico", host: "46.101.193.154", referrer: "http://46.101.193.154/users"
[12:46:55] jgt: has joined #RubyOnRails
[12:47:09] ishahnaz: has joined #RubyOnRails
[12:47:27] j3r0: has joined #RubyOnRails
[12:48:16] universa1: dbugger: ok. so you see the path, is that file present?
[12:48:21] universa1: dbugger: and is a puma process running?
[12:48:27] Dbugger: Woot? Suddenly it works :S
[12:48:33] Dbugger: I dont get this...
[12:49:24] RahulT: has joined #RubyOnRails
[12:49:26] Dbugger: Well... Im stiull unsure what happened, but lets be glad :)
[12:51:02] Dbugger: Thanks universa1 !
[12:51:47] puppeh_: has joined #RubyOnRails
[12:51:56] puppeh_: can somebody help me with my rack middleware problem? https://groups.google.com/forum/#!topic/rubyonrails-talk/sHdRgpxvXVc
[12:52:18] chills42: has joined #RubyOnRails
[12:52:33] broman: has joined #RubyOnRails
[12:52:55] lxsameer_: has joined #RubyOnRails
[12:53:30] broman: how can i add a "unique" constraint to a already created column through migrate???
[12:53:31] universa1: puppeh_: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/cookies.rb#L4-8
[12:53:57] universa1: puppeh_: using ActionDispatch::Request seems like a solution to me from a quick google
[12:54:15] universa1: broman: add_index :foos, :bar, unique: true
[12:55:18] universa1: broman: http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_index
[12:56:19] puppeh_: universa1: didn't help, same thing
[12:57:19] universa1: puppeh_: http://stackoverflow.com/questions/5343208/how-to-use-cookies-in-a-rack-middleware
[12:57:38] puppeh_: ok found it
[12:57:41] ramortegui: has joined #RubyOnRails
[12:57:49] puppeh_: yes thanks
[12:58:01] universa1: puppeh_: but tbh, no clue about it ;) just guessing from google
[12:58:17] bmurt: has joined #RubyOnRails
[12:59:02] NBarnes: has joined #RubyOnRails
[13:00:53] eyck: has joined #RubyOnRails
[13:02:52] multiscan: has joined #RubyOnRails
[13:06:40] benhuda: has joined #RubyOnRails
[13:06:51] unver: has joined #RubyOnRails
[13:09:09] greengriminal: has joined #RubyOnRails
[13:09:53] julienk: has joined #RubyOnRails
[13:10:30] user121212: has joined #RubyOnRails
[13:11:11] user121212: Hello, Is there any alternative to refills? https://github.com/thoughtbot/refills
[13:12:02] victortyau: has joined #RubyOnRails
[13:12:32] juanpaucar: has joined #RubyOnRails
[13:12:39] dobri: has joined #RubyOnRails
[13:13:45] jgt: has joined #RubyOnRails
[13:14:04] nya: has joined #RubyOnRails
[13:14:07] nettoweb: has joined #RubyOnRails
[13:15:20] umgrosscol: has joined #RubyOnRails
[13:18:23] mwlang: user121212: DIY with Zurb Foundation or Twitter Bootstrap
[13:18:54] StartupHub: has joined #RubyOnRails
[13:19:24] mwlang: user121212: or any of these, really: http://www.awwwards.com/what-are-frameworks-22-best-responsive-css-frameworks-for-web-design.html
[13:20:28] joshkovach: has joined #RubyOnRails
[13:21:19] m1lt0n: has joined #RubyOnRails
[13:21:30] user121212: mwlang: I was loooking for building a prototype, if there a way make an eyecandy app in short time span, I have to do that :)
[13:21:59] Guest72121: has joined #RubyOnRails
[13:22:03] mwlang: user121212: https://www.google.com/search?q=online+wireframe&ie=utf-8&oe=utf-8
[13:22:28] greengriminal: has joined #RubyOnRails
[13:23:22] user121212: mwlang: na, I can code ruby, But I'm not good at writing css, it may take little more time to get shit done for me.
[13:23:52] SteenJobs: has joined #RubyOnRails
[13:25:23] Guest72121: Hello, I've got problem with completing tutorial 'Getting started with rails'. When I add "render plain: params[:article].inspect" to articles_controller.rb and re-submit the form I see "nil" instead of my parameters.
[13:25:57] suchness: Guest72121: Try params.inspect
[13:26:33] suchness: Guest72121: You likely don't have anything stored in params[:article]. What does your form look like?
[13:27:23] Guest72121: suchness, it helped
[13:27:26] chills42: has joined #RubyOnRails
[13:27:44] Guest72121: suchness, it's exactly the same as in tutorial
[13:28:18] suchness: Guest72121: What do you have one of your form inputs named?
[13:28:22] pcpanic: has joined #RubyOnRails
[13:28:31] VeganGreg: has joined #RubyOnRails
[13:29:33] Guest72121: suchness, i don't know
[13:29:54] suchness: Guest72121: then how do you know it's exactly the same as the tutorial?
[13:30:02] pcpanic: Hi guys, I am trying to set a simple name field on collection select select, and I am always getting something[else], how do i refer in the controller to something[else] ? params[:something] ? This is a form with no model
[13:30:08] chills42: has joined #RubyOnRails
[13:30:59] suchness: pcpanic: params[:something][:else]
[13:31:20] pcpanic: suchness: Thanks! trying...
[13:31:21] suchness: pcpanic: I am not sure I am following very well what you're saying though.
[13:31:44] Guest72121: suchness, I found the mistake, the form was named "aricle"
[13:31:51] Guest72121: suchness, thanks
[13:32:28] oflannabhra: has joined #RubyOnRails
[13:32:55] broman: i made a "rails g migration add_index_to_integracao_produtos produto_php_id: uniq" but when i did db:migrate it got me this: Mysql2::Error: Duplicate column name 'produto_php_id': ALTER TABLE `integracao_produtos` ADD `produto_php_id` varchar(255)/home/breno/.rvm/gems/ruby-2.0.0-p645/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `query' ---------- how should i run the rails g migration?
[13:34:16] Cervajz_: has joined #RubyOnRails
[13:34:50] Anubix: has joined #RubyOnRails
[13:35:05] suchness: broman: You are using a generator, and that generator is thinking you want to add a field, produto_php_id that is uniq. Not add uniqueness to an existing produto_php_id.
[13:35:27] user121212: mwlang: hey, I just few stuff on themeforest, that will work for now, thanks :)
[13:35:30] broman: suchness, what should i do to add uniqueness no produto_php_id?
[13:35:41] suchness: broman: If I were you, I would just open the migration you created and just alter the code that was generated.
[13:35:54] mwlang: user121212: that works
[13:35:57] suchness: broman: I don't know, I haven't used active record for 6 years now.
[13:36:14] broman: suchness, http://pastie.org/10356619
[13:37:08] suchness: broman: add_index : integracao_produtos, : produto_php_id, unique: true
[13:37:43] suchness: broman: http://pastie.org/10356620
[13:38:10] broman: suchness, ty! it worked :)
[13:38:11] suchness: broman: http://pastie.org/10356623
[13:38:14] devdazed: has joined #RubyOnRails
[13:38:40] Lightsword: has joined #RubyOnRails
[13:38:53] chouhoulis: has joined #RubyOnRails
[13:40:43] The_Phoenix: has joined #RubyOnRails
[13:41:23] The_Phoenix: has joined #RubyOnRails
[13:41:32] sameerynho: has joined #RubyOnRails
[13:41:50] Anubix: Hi guys, in admin panel i am using sel.search function in about 80% of all models. I don't want to repeat it, but i dont know where is the best place to store this function?
[13:41:54] KimJongUn: has left #RubyOnRails: ()
[13:42:09] kiimi: has joined #RubyOnRails
[13:42:14] dopamean_: has joined #RubyOnRails
[13:42:16] kiimi: has left #RubyOnRails: ()
[13:42:29] chills42: has joined #RubyOnRails
[13:42:33] The_Phoenix: has joined #RubyOnRails
[13:42:58] allcentury: has joined #RubyOnRails
[13:43:10] universa1: Anubix: !code
[13:43:10] helpa: Anubix: 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.
[13:43:23] The_Phoenix: has joined #RubyOnRails
[13:44:09] quazimodo: has joined #RubyOnRails
[13:44:36] doodlehaus: has joined #RubyOnRails
[13:44:42] Anubix: universa1: its simple function self.search where name ilike, anyway it doesn't matter what is that function but where to place it. To helper, but what modle if i use it in all?
[13:44:55] The_Phoenix: has joined #RubyOnRails
[13:45:11] suchness: Anubix: Based on what you are saying, you should have a module that you can include.
[13:45:19] universa1: Anubix: since we don't know where you use, how you use it, whatever, just show us. we can't magically look into your code.
[13:45:31] suchness: Anubix: There are better ways, but without more information it's hard to say what your situation is.
[13:45:51] universa1: i can give you some random advice, which might fit, but in 99% there might have been a better solution to your actual problem.
[13:46:17] chills42: has joined #RubyOnRails
[13:46:24] The_Phoenix: has joined #RubyOnRails
[13:46:28] universa1: *in 99% of the cases
[13:46:35] oflannabhra: has joined #RubyOnRails
[13:46:51] Anubix: ok here - http://pastie.org/10356636
[13:46:53] chills42: has joined #RubyOnRails
[13:47:03] universa1: Anubix: now you're trolling.
[13:47:06] universa1: Anubix: !rules
[13:47:06] helpa: Anubix: https://gist.github.com/996779
[13:47:14] suchness: Anubix: and how about what it looks like in the other classes...
[13:47:32] chills42: has joined #RubyOnRails
[13:47:35] kiimi: has joined #RubyOnRails
[13:47:44] suchness: Anubix: Now you're just being a little brat.
[13:47:44] rubyonrails087: has joined #RubyOnRails
[13:47:55] Anubix: it's not trolling but i don't use github
[13:48:39] universa1: Anubix: so you have a scope that is used in multiple models... create an abstract model you inherit from, or some module to include.
[13:48:46] roolo: has joined #RubyOnRails
[13:48:54] Anubix: It's very simplle admin app where i search by name, other classes has name as well, so function is same, so i use this code in 5 next models what is not best was i think
[13:50:02] suchness: Anubix: http://pastie.org/10356644
[13:51:33] SteenJobs: has joined #RubyOnRails
[13:52:15] Anubix: I thought about this solution as well, but it's not best way i think. It doesn't reduce code much and it create new class in repository.
[13:53:18] suchness: Anubix: It does reduce code, and makes it so all your changes are in one place. You are right though, it's not the best solution, as you can tell by my naming conventions.
[13:55:36] pierre_f: has joined #RubyOnRails
[13:55:53] Anubix: suchness: So you think SearchAdmin.rb class is ok ?:)
[13:56:09] jkamenik1: has joined #RubyOnRails
[13:57:57] Ergo: has joined #RubyOnRails
[13:58:17] suchness: Anubix: What? Like SearchAdmin.new(ModelToSearch, value) ?
[13:59:13] Ergo: has joined #RubyOnRails
[14:00:14] mary5030: has joined #RubyOnRails
[14:01:34] Anubix: suchness: Ok i understand you now, you mean to create module in lib folder right?
[14:02:02] suchness: Anubix: Yeah
[14:02:31] Anubix: suchness: Well i am newbie i didnt work with own libraries yet :)
[14:02:54] suchness: Anubix: Just be prepared for that to become brittle over time.
[14:03:14] Anubix: suchness: should i use extend or include to add module to class?
[14:03:19] oscarbr92: has joined #RubyOnRails
[14:03:34] suchness: Anubix: You are making the assumption that a) All your searchable models will be searched by a name atribute in the db, and b) That is all you will want to search by.
[14:04:14] suchness: Anubix: You want to extend to add the methods to the class, include to add to the instances, in your situation you want extend.
[14:04:49] Ergo: has joined #RubyOnRails
[14:04:58] Anubix: suchness: Ok man thanks very much i will fight with it. And i know it is very limited but for my usage its okey :)
[14:05:24] suchness: Anubix: Good luck
[14:05:58] Anubix: suchness: If you can help me with another think, i am using namespaces for front-end and admin section, i am using 2 diferent layouts normal and for admin section, but i have problem with CSS and javascript
[14:06:29] Anubix: suchness: I dunno how to create CSS and JS for admin layout, and another CSS a JS for front-end
[14:06:48] suchness: Anubix: app/assets/javascripts/admin/application.js
[14:06:55] suchness: Anubix: app/assets/stylesheets/admin/application.js
[14:07:19] Anubix: ye i was trying this but it didnt work
[14:07:43] suchness: Anubix: Well, how about app/assets/stylesheets/administration.css
[14:07:58] Anubix: suchness: admin layout was still loading root application.css
[14:07:58] suchness: Anubix: then in that stylesheet require ./admin
[14:08:30] suchness: Anubix: then in the administration.html.erb|haml|whatever add stylesheet_link_tag "administration", :media => "all"
[14:08:34] darrencauthon: has joined #RubyOnRails
[14:09:11] bruno-: has joined #RubyOnRails
[14:09:24] suchness: config.assets.precompile += ['administration.js', administration.css']
[14:09:50] Anubix: suchness: Yeah this is it! thanks
[14:09:58] axl_: has joined #RubyOnRails
[14:10:07] oscarbr92_: has joined #RubyOnRails
[14:10:37] jamiely: has joined #RubyOnRails
[14:10:42] Anubix: suchness: Well I really appreciate your help
[14:10:50] Anubix: suchness: have a nice day
[14:10:56] pierre_f: oscarbr92_: yo!
[14:11:15] suchness: Anubix: but, you should be able to have app/assets/stylesheets/admin/application.css and then just stylesheet_link_tag 'admin/application', media: 'all'
[14:11:24] suchness: At least I think you should
[14:11:46] suchness: Anubix: Sure thing
[14:12:07] shinnya: has joined #RubyOnRails
[14:12:20] Anubix: suchness: Ye that's best way, i forget just do add admin/ in that stylesheet_link_tag, such a idiot mistake
[14:12:32] pcpanic: suchness: (...a little late) But working - Thanks!
[14:12:46] suchness: pcpanic: No problem
[14:13:41] erich: has joined #RubyOnRails
[14:13:44] benhuda: has joined #RubyOnRails
[14:13:58] oscarbr92_: pierre_f: sup
[14:14:18] RegulationD: has joined #RubyOnRails
[14:15:58] shippy: has joined #RubyOnRails
[14:17:50] pierre_f: oscarbr92_ : bored at the office, enjoying the only lovely day during summer in dublin by the window, what about yourself ?
[14:17:56] tyrone__: has joined #RubyOnRails
[14:17:59] mhib: has joined #RubyOnRails
[14:18:07] kiimi: guys is there a way i can seperate an admin panel from my main app, like keeping controllers, models etc away from app stuff
[14:18:10] [H]unt3r: has joined #RubyOnRails
[14:18:51] suchness: kiimi: Yes, you need a namespace.
[14:18:58] bonhoeffer: kiimi: and can use scope
[14:20:05] kiimi: ahhh okay, you know of any tutorials that talk about using this stuff for an admin panel?
[14:20:53] suchness: kiimi: http://www.iain.nl/backends-in-rails-3-1
[14:21:10] kiimi: thanks buddy, i'll check it out :D
[14:21:30] strcmp1: has joined #RubyOnRails
[14:23:48] gerep: has joined #RubyOnRails
[14:24:38] Ergo: has joined #RubyOnRails
[14:24:56] Kallis: has joined #RubyOnRails
[14:25:21] kies: has joined #RubyOnRails
[14:25:53] gerep: I have added a flags.yml file where I'll store some user configurations but when the user submits a form with the new configuration, I need to restart the server and that's not good for production, should I use database to store that instead? Or there is a way to reload the configuration?
[14:26:58] Papierkorb: gerep: use the DB.
[14:27:08] gerep: Papierkorb, ok, thanks a lot :D
[14:27:27] dopie: has joined #RubyOnRails
[14:30:01] mutuma: has joined #RubyOnRails
[14:31:26] srinidhi: has joined #RubyOnRails
[14:31:41] gerep: Papierkorb, are there good practices to work with application behavior configuration?
[14:32:03] gerep: I mean, the user will update some configurations and it will show or hide some fields in some forms
[14:32:26] Papierkorb: gerep: don't know of any best practices
[14:32:37] gerep: It will also use or not use some model validations
[14:33:20] chills42: has joined #RubyOnRails
[14:34:13] DoctorMonocular: has joined #RubyOnRails
[14:37:10] mutuma: has left #RubyOnRails: ()
[14:37:31] dev2: has joined #RubyOnRails
[14:37:37] Pathfinder: has joined #RubyOnRails
[14:37:53] JakFrist: has joined #RubyOnRails
[14:38:38] NBarnes: has joined #RubyOnRails
[14:39:23] chills42: has joined #RubyOnRails
[14:40:08] oflannabhra: has joined #RubyOnRails
[14:40:41] drale2k: has joined #RubyOnRails
[14:41:11] siempref_: has joined #RubyOnRails
[14:42:34] _tpavel: has joined #RubyOnRails
[14:43:50] netan: has joined #RubyOnRails
[14:44:37] jeadr: has joined #RubyOnRails
[14:44:47] riotjones: has joined #RubyOnRails
[14:45:05] netan: how do I run test in browser (so I can follow what happens) ?
[14:45:50] jtdowney: has joined #RubyOnRails
[14:45:50] jtdowney: has joined #RubyOnRails
[14:45:51] netan: (I try to google but don't know what terms to use)
[14:46:05] workmad3: netan: sounds like you want selenium
[14:48:13] netan: workmad3, yes this might be what i am looking for, cheking it out now
[14:48:56] wolfsoul: has joined #RubyOnRails
[14:51:48] Axy: has joined #RubyOnRails
[14:52:46] lapide_viridi: has joined #RubyOnRails
[14:52:52] ruurd: has joined #RubyOnRails
[14:53:11] SteenJobs: has joined #RubyOnRails
[14:54:51] arup_r: has joined #RubyOnRails
[14:57:04] jeadr: has joined #RubyOnRails
[14:57:07] netan: has joined #RubyOnRails
[14:57:59] northfurr: has joined #RubyOnRails
[14:58:06] rogue_koder: has joined #RubyOnRails
[14:58:51] blackmesa: has joined #RubyOnRails
[14:58:56] guest56: has joined #RubyOnRails
[14:59:13] darutoko: has joined #RubyOnRails
[15:01:51] mikebonar: has joined #RubyOnRails
[15:04:44] lindii_: has joined #RubyOnRails
[15:05:13] juanpaucar: has joined #RubyOnRails
[15:05:35] User458764: has joined #RubyOnRails
[15:05:53] Pathfinder: has left #RubyOnRails: ()
[15:06:18] KimJongUn: has joined #RubyOnRails
[15:06:32] christiandsg: has joined #RubyOnRails
[15:07:26] manfrin: has joined #RubyOnRails
[15:08:06] _tpavel: Hi, I'm trying to change my deployment with Capistrano to use foreman and exporting to upstart and I can't seem to make it work. I suspect rbenv is the problem. This is what I have: https://gist.github.com/tudorpavel/93d1dbd3b90ca1849e4a
[15:08:35] _tpavel: Does anyone have an idea what could be the problem?
[15:09:05] badmadrad: has joined #RubyOnRails
[15:09:12] givanse: has joined #RubyOnRails
[15:09:25] CanTonic: has joined #RubyOnRails
[15:09:26] drale2k_: has joined #RubyOnRails
[15:10:04] EminenceHC: has joined #RubyOnRails
[15:11:26] disgrntld: has joined #RubyOnRails
[15:14:30] hobodave: has joined #RubyOnRails
[15:14:57] kristofferR: has joined #RubyOnRails
[15:15:40] nogic: has joined #RubyOnRails
[15:15:42] doodlehaus: has joined #RubyOnRails
[15:16:42] Mession: has joined #RubyOnRails
[15:17:08] oscarbr92: has joined #RubyOnRails
[15:17:53] mephistophocles: has joined #RubyOnRails
[15:19:24] bobbobbins: has joined #RubyOnRails
[15:19:50] michaeldeol: has joined #RubyOnRails
[15:20:07] urlgrey: has joined #RubyOnRails
[15:22:16] umgrosscol: has joined #RubyOnRails
[15:22:44] oscarbr92: hello. I'm trying to update a model and its nested model in a single form. If I want to populate the nested model attributes I must find the object in the controller's edit method and use the fields_for the variable containing that object. But how can I save the changes in the update method if the fields aren't part of the params for the main model?
[15:23:02] bobbobbins: so this isn't exactly the channel for this, but I'm getting bitched at for not using a decent IRC client...can someone tell me what I should be using if I'm on a mac?
[15:23:18] cschneid_: has joined #RubyOnRails
[15:23:32] pierre_f: bobbobbins: limechat
[15:24:04] Norrin: bobbobbins, textual
[15:24:37] mikecmpbll: anyone know how i find out what phantomjs version i'm using with poltergeist? or where it's installed?
[15:24:44] bobbobbins: pierre_f: well damn, thats what I am using...maybe its some other issue then...i tried to join #httpd and got routed to another on that just said "FIX YOUR GODDAMN CONNECTION"
[15:24:57] mikecmpbll: pretty sure it got installed with the gem
[15:25:10] banister: has joined #RubyOnRails
[15:25:12] bobbobbins: Norrin: I'll take a look at textual thanks
[15:25:29] Norrin: bobbobbins, maybe you're getting the message from parting/joining too frequently
[15:25:36] Norrin: common irc problem
[15:25:51] Norrin: if you download the source you can compile & use it for free
[15:25:52] bobbobbins: maybe, but I just signed on for the first time....let me try again
[15:25:53] Norrin: with no user support
[15:26:52] bobbobbins: hah, well now it says I'm banned from there
[15:27:35] mikecmpbll: nvm, poltergeist doesn't support phantomjs 2 anyway
[15:27:49] Norrin: might be able to ask in #help for an op's nick to ask for assistance
[15:27:56] Norrin: an op of the room you want to get into
[15:28:28] bobbobbins: Norrin: thanks..I'll do that...textual looks pretty too, I think I'm going to switch
[15:28:32] erich: has joined #RubyOnRails
[15:28:43] mikecmpbll: textual is decent.
[15:30:19] AzaToth: has joined #RubyOnRails
[15:31:02] erich: has joined #RubyOnRails
[15:31:21] Cache_Money: has joined #RubyOnRails
[15:33:12] Norrin: oscarbr92, i'm a noob sorry
[15:34:45] dopamean1: has joined #RubyOnRails
[15:35:26] mikecmpbll: oscarbr92: accepts_nested_attributes_for
[15:35:37] s2013: has joined #RubyOnRails
[15:35:38] bobbobbins: has joined #RubyOnRails
[15:36:09] northfurr: has joined #RubyOnRails
[15:36:45] roolo: has joined #RubyOnRails
[15:38:19] havenwood: has joined #RubyOnRails
[15:39:03] oscarbr92: mikecmpbll: already using that, the relationship is fine and I can get the nested model in the controller, the problem is when I want to update, I'm not sure how to handle the params in order to update the nested model if I'm obtaining the previus data using a separate object in the fields_for
[15:39:30] mikecmpbll: that's exactly what anaf handles for you
[15:39:50] mikecmpbll: and seeing as i've no idea what you're doing currently, without writing your code for you i can't really advise more than that ;)
[15:39:55] lindii_: has joined #RubyOnRails
[15:40:06] NBarnes: has joined #RubyOnRails
[15:40:26] erich: has joined #RubyOnRails
[15:40:45] bobbobbins: has joined #RubyOnRails
[15:40:55] oscarbr92: mikecmpbll: hold it I'll share the code
[15:44:58] slash_nick: kegan_: what's up?
[15:45:23] ruurd: has joined #RubyOnRails
[15:47:24] mikecmpbll: how should the Gemfile version specifier '~> 0' behave?
[15:47:33] Norrin: do tables always have to have an id column?
[15:48:01] kies: has joined #RubyOnRails
[15:48:03] Norrin: what if i have a unique identifier i play to use in URIs different from id
[15:48:11] mikecmpbll: i would've thought it would be >= 0 and < nothing
[15:48:29] benhuda: has joined #RubyOnRails
[15:50:26] oscarbr92: has left #RubyOnRails: ()
[15:51:04] jeadr: has joined #RubyOnRails
[15:51:27] oscarbr92_: has joined #RubyOnRails
[15:51:57] dopamean_: has joined #RubyOnRails
[15:53:11] TomyLobo: has joined #RubyOnRails
[15:53:43] Papierkorb: Norrin: then you have some other UNIQUE column in your table.
[15:55:41] pragmatism: has joined #RubyOnRails
[15:59:41] speakingcode: has joined #RubyOnRails
[15:59:41] oscarbr92_: mikecmpbll: model: http://pastie.org/private/ktweohoxqosgrxvrbi8a , controller: http://pastie.org/private/ikdh4oynh7zzz3puujxcna , view: http://pastie.org/private/hwblycijfei5bitab0c2uq
[15:59:43] bonhoeffer: has joined #RubyOnRails
[16:00:16] Maletor: has joined #RubyOnRails
[16:00:19] mikecmpbll: oscarbr92_: !gist for future reference, you can include multiple files in the same URL and edit it later if you sign in with your github account
[16:00:19] helpa: oscarbr92_: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[16:01:07] mikecmpbll: oscarbr92_: ok, that's the code, and now what is the problem?
[16:01:09] jkamenik: has joined #RubyOnRails
[16:01:13] hobodave_: has joined #RubyOnRails
[16:01:30] cornerma1: has joined #RubyOnRails
[16:02:46] bruno-: has joined #RubyOnRails
[16:02:54] qejk: has joined #RubyOnRails
[16:03:54] bobbobbins: has joined #RubyOnRails
[16:04:22] oscarbr92_: mikecmpbll: in order to get the data to show in the form inputs of the edit view, I had to use the fields_for with a @medico variable, which contains the nested model from Usuario. But when I want to update It would only take the main model attributes and not the fields_for ones, since i'm not using medico_attributes as I do in the 'new' view
[16:04:57] mikecmpbll: why aren't you using medico_attributes?
[16:04:57] DoctorMonocular: has joined #RubyOnRails
[16:04:59] oscarbr92_: mikecmpbll: but if I use fields for with :medico_attributes it won't show the previous data for that model object
[16:05:16] mikecmpbll: you use fields_for :medico
[16:05:26] oscarbr92_: mikecmpbll: because of that I just told you
[16:05:27] mikecmpbll: not fields_for :medico_attributes, and it's the same in the new form.
[16:05:29] sarink: has joined #RubyOnRails
[16:05:55] mikecmpbll: it will probably work in the new form because it doesn't recognise :medico_attributes as an association on the object and therefore just treats it as a namespace for the fields
[16:05:59] oscarbr92_: mikecmpbll: no, in the new form I use :medico_attributes
[16:06:07] mikecmpbll: oscarbr92_: i know, that's wrong
[16:06:10] mikecmpbll: you need to use :medico
[16:06:14] oscarbr92_: mikecmpbll: that's my guess
[16:08:35] oscarbr92_: mikecmpbll: ok, but how can I save the whole thing if it just takes the attributes I permit in the params, and it only takes :medico_attributes (note that in the fields for I use @medico, not :medico, don't know if they're the same for you, though)
[16:08:52] doodlehaus: has joined #RubyOnRails
[16:09:02] mikecmpbll: oscarbr92_: i've told you already
[16:09:06] mikecmpbll: [17:06:09] <mikecmpbll> you need to use :medico
[16:09:25] mephistophocles: has joined #RubyOnRails
[16:10:57] ruurd: has joined #RubyOnRails
[16:11:20] MartinElvar: has joined #RubyOnRails
[16:11:25] oscarbr92_: mikecmpbll: ok, could you tell me where should I use it? I tried using medico in the params but apparently adding _attributes is a rails convention so it throws an error
[16:11:45] mikecmpbll: oscarbr92_: fields_for :medico
[16:12:11] mikecmpbll: or <%= f.simple_fields_for :medico do |medico| %> to use your code.
[16:12:27] bronson: has joined #RubyOnRails
[16:13:37] marr: has joined #RubyOnRails
[16:14:23] michaeldeol: has joined #RubyOnRails
[16:14:28] oscarbr92_: mikecmpbll: :o
[16:14:39] oscarbr92_: mikecmpbll: that did it. Thank you so much!
[16:14:57] Norrin: Papierkorb, but why have an id column?
[16:15:00] oscarbr92_: damn with this rails magic conventions
[16:15:03] mikecmpbll: oscarbr92_: just remember to use the same symbol for fields_for as you do in accepts_nested_attributes_for
[16:15:20] Norrin: oscarbr92_, i know right
[16:15:27] mikecmpbll: oscarbr92_: you're referencing an association, rails sorts out the parameter naming for you.
[16:15:34] mikecmpbll: that's the whole point of ANAF :)
[16:15:36] Papierkorb: Norrin: to easily find the row again without having to fiddle with whatever other unique you have. also, convention, those 4 bytes won't kill you
[16:15:53] mikecmpbll: oscarbr92_: also, you can change your new form to the same, and you can also get rid of your @medico instance var
[16:16:32] Norrin: if you use a resource @model in the routes file, is there a way to make some changes to the routes it automates?
[16:16:40] Norrin: oops try --> true**
[16:16:42] mephistophocles: has joined #RubyOnRails
[16:16:47] rakm: has joined #RubyOnRails
[16:17:57] banister: has joined #RubyOnRails
[16:18:03] Norrin: Papierkorb, is it not 8 bytes on a 64-bit machine?
[16:18:26] Norrin: not that that changes the truth of the rest of your statement
[16:18:39] Papierkorb: Norrin: probably 8Bytes on all machines, but yeah. I guess whatever unique you use there, probably a string?, easily trumps that though
[16:19:08] oscarbr92_: mikecmpbll: ok, surely will. Another question, do I still need the medicos_attributes:[] in the permit params, right?
[16:19:38] mikecmpbll: oscarbr92_: yes, the fields are still names as medicos_attributes
[16:20:53] oscarbr92_: mikecmpbll: right, thanks again :D
[16:22:54] drale2k_: We are using jbuilder to render json for the API and now for 1 instance (a clients client needs it -.-) we need to return XML instead of JSON. Has anyone done this with jbuilder? Don't feel like switching to RABL or something for just one thing and having to rewrite everything
[16:22:56] Norrin: if you use a resource @model in the routes file, is there a way to make some changes to the routes it automates?
[16:23:18] jeadr: has joined #RubyOnRails
[16:23:49] mikecmpbll: Norrin: would be good to explain what you want to do
[16:24:01] mikecmpbll: Norrin: there's all sorts of things you can do to change resourceful routes
[16:24:05] mikecmpbll: Norrin: !routing
[16:24:05] helpa: Norrin: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[16:24:17] Norrin: i'm read most of that
[16:24:22] mikecmpbll: then you will know :)
[16:26:06] livathinos: has joined #RubyOnRails
[16:26:14] oscarbr92_: mikecmpbll: the new fields for with :medico doesn't generate the fields :/ works with :medico_attributes, though
[16:26:17] Exuma: has joined #RubyOnRails
[16:26:21] techsethi: has joined #RubyOnRails
[16:26:46] concernedcitizen: has joined #RubyOnRails
[16:26:52] benlieb: has joined #RubyOnRails
[16:27:51] mikecmpbll: does a medico already exist?
[16:27:56] mikecmpbll: if not you should build one in the controller
[16:28:15] mikecmpbll: @usuario.build_medico
[16:29:36] towski_: has joined #RubyOnRails
[16:30:10] arooni-mobile: has joined #RubyOnRails
[16:30:23] arooni-mobile: has joined #RubyOnRails
[16:31:28] doodlehaus: has joined #RubyOnRails
[16:32:14] [Butch]: has joined #RubyOnRails
[16:36:07] bricker: has joined #RubyOnRails
[16:37:30] Sylario: I am looking for a list of past Rails security warning/patchs
[16:37:34] Sylario: where can i find that?
[16:38:11] ivanskie: has joined #RubyOnRails
[16:38:27] kaneda^: has joined #RubyOnRails
[16:39:00] sandstrom: has joined #RubyOnRails
[16:39:07] kaneda^: i'm seeing some really weird behavior in my app. i have a before_action in a controller that validates the presence of a value in the session. if i hit the back button and refresh the page the session variables disappear
[16:39:37] kaneda^: session store is cookie store
[16:40:27] KensoDev: has joined #RubyOnRails
[16:40:32] kaneda^: https://gist.github.com/kaneda/487830022612fc8dee4f <-- the application controller with the before action
[16:40:58] tenderlove: has joined #RubyOnRails
[16:40:59] solars: has joined #RubyOnRails
[16:42:13] rakm: has joined #RubyOnRails
[16:42:33] ruurd: has joined #RubyOnRails
[16:43:07] mikecmpbll: has joined #RubyOnRails
[16:43:20] oleksandriuzikov: has joined #RubyOnRails
[16:46:24] lwu: has joined #RubyOnRails
[16:46:38] bricker: Sylario: https://groups.google.com/forum/#!forum/rubyonrails-security
[16:47:05] kaneda^: super confusing, why would my session go boom?
[16:47:38] HenriettaSalt: has joined #RubyOnRails
[16:48:51] errakeshpd: has joined #RubyOnRails
[16:49:07] errakeshpd: http://stackoverflow.com/questions/32055705/date-conflict-checking-ruby
[16:49:26] j3r0: has joined #RubyOnRails
[16:49:50] errakeshpd: How i can correct the conflict ?
[16:50:53] skyjumper: if you were giving a rails coding/competency test, what kind of things would you look for?
[16:51:28] kegan_: has joined #RubyOnRails
[16:51:56] kaneda^: understanding of MVC, routes, strong params vs. protected attributes, rspec (and rspec vs cucumber), understanding of ORM (e.g., where, initialize vs create), factorygirl, i dunno
[16:52:39] kaneda^: skyjumper: persnoally i'd be less interested in someone's ability with rails as their ability to learn it
[16:53:01] skyjumper: kaneda^: you sound like a good manager/employer
[16:53:17] skyjumper: usually they want X experience with "the tech we use" where X is 3 to 5
[16:54:35] kaneda^: all postings are for the ideal candidate, such a candidate is rarely available
[16:54:55] skyjumper: correct on both counts
[16:55:09] kaneda^: it also depends on the size and style of the campaign
[16:55:37] sonofdirt: has joined #RubyOnRails
[16:55:44] kaneda^: if it's a small company the profile is going to be geared more towards the hacker than the journeyman
[16:56:13] djbkd: has joined #RubyOnRails
[16:57:39] kaneda^: so, the weirest bit about my problem is that if i stay on the same view i can refresh the page indefinitely, it's just when i switch to a new controller action that the session seems to wipe itself
[16:58:59] smathy: has joined #RubyOnRails
[16:59:07] slash_nick: kaneda^: want to share both controllers?... you mention to controllers: you can refresh x indefinitely but y(...) - is vice versa true?
[16:59:25] kaneda^: slash_nick: sure, one sec
[16:59:36] Norrin: mikecmpbll, i see how to add them but I'm not seeing how to remove them
[16:59:45] jkamenik: has joined #RubyOnRails
[16:59:56] mikecmpbll: Norrin: you didn't look hard enough then :)
[17:00:10] Norrin: mikecmpbll, so what now?
[17:00:12] Norrin: i don't see it
[17:00:29] Norrin: it's a few ways of adding routes but now do you remove them from a resource block?
[17:00:34] mikecmpbll: Norrin: you see the index on the right?
[17:00:52] mikecmpbll: what's the title of section 4?
[17:01:23] Norrin: smh why is that after non-resourceful routes?
[17:01:24] kaneda^: slash_nick: nvm, i found the line causing the issue, the index of the next page resets the session for a different reason; i'm putting together two apps right now, thanks
[17:01:25] Norrin: no i didn't see that
[17:01:29] ascarter: has joined #RubyOnRails
[17:01:30] Norrin: i read sections 2 and 3 fully
[17:01:36] j_mcnally: has joined #RubyOnRails
[17:01:50] mikecmpbll: Norrin: you don't see the column on the right that says Chapters at the top?
[17:02:01] Norrin: i didn't see section 4
[17:02:15] Mia: has joined #RubyOnRails
[17:02:19] mikecmpbll: Norrin: ah okay :) well it's called Customizing Resourceful Routes, which is what you want to do
[17:02:24] Norrin: 2) resourceful routes 3) non-resourceful routes 4) resourceful routes again.....
[17:02:26] Norrin: not logical
[17:02:31] stephen_g: has joined #RubyOnRails
[17:02:40] mikecmpbll: and of the 10 subsections, there's one which you might be particularly interested in.
[17:02:44] Norrin: thank you very much though
[17:02:53] kaneda^: slash_nick: changed it to only reset the session vars that it cares about in that section, worked, lol
[17:03:15] slash_nick: nice well done
[17:03:18] kitfox: has joined #RubyOnRails
[17:03:26] kaneda^: just silly
[17:03:34] mwlang: has joined #RubyOnRails
[17:03:53] kies: has joined #RubyOnRails
[17:05:04] sandstrom: has joined #RubyOnRails
[17:05:57] mwlang: if you inherited a Rails 1.2 project and had to keep it alive for approximately one year and perform periodic hotfixes on the live site, how would you do it? There are no automated tests and the code is crazy brittle.
[17:06:29] kaneda^: mwlang: i'd try to get test coverage over the most critical parts of the code, even if that's only like 10% coverage
[17:06:49] ruurd: has joined #RubyOnRails
[17:07:32] mwlang: kaneda^: that???s sort of what I???m thinking???either that or get the most basic test suite set up (smoke tests?) and then add specs on the failing code then fix to pass.
[17:07:46] kaneda^: yeah, something like that
[17:07:56] mwlang: I gotta say, though???I???m totally spoiled by Factory Girl and Rspec 3.
[17:08:17] kaneda^: yeah, agreed
[17:08:21] elepedus: has joined #RubyOnRails
[17:09:19] jgpawletko: has joined #RubyOnRails
[17:09:59] mwlang: I think bacon still supports Ruby 1.8.7, so I might drop that in rather than trying to wrack my brain to remember Unit::Test
[17:11:12] mwlang: hmmm???rspec 3.0 actually installed and runs on 1.8.7 so let???s see if I can integrate it!
[17:12:47] netzfisch: has joined #RubyOnRails
[17:13:41] bruno-: has joined #RubyOnRails
[17:14:19] Ergo: has joined #RubyOnRails
[17:16:09] lampd1: has joined #RubyOnRails
[17:16:35] jhack: has joined #RubyOnRails
[17:16:35] jhack: has joined #RubyOnRails
[17:17:39] frzng: has joined #RubyOnRails
[17:18:03] lindii_: So im loading content into tabs with ajax. Anything i can improve in this code? https://gist.github.com/anonymous/29b24e8688a016ba163a
[17:18:32] Papierkorb: lindii_: first off, the indention
[17:18:46] Papierkorb: your show.html.erb is all over the place
[17:19:29] lindii_: Papierkorb: i tried that.. but dont know why is saving it that way after i chose 2 spaces
[17:19:32] Papierkorb: if you want to use tabs, fine, but then please everywhere. (Afaik the community prefers two spaces for indention)
[17:19:49] Papierkorb: lindii_: then you told it to render tabs as two spaces, but not to *use* spaces for indention
[17:19:49] kaneda^: 2 or 4 spaces, it seems
[17:21:08] Rubie: has joined #RubyOnRails
[17:21:11] Papierkorb: lindii_: show.js.erb is the same thing thrice. The branches only differ by their argument to render().
[17:21:22] northfurr: has joined #RubyOnRails
[17:22:05] lindii_: Papierkorb: you mean i dont need those params validation?
[17:22:07] Papierkorb: lindii_: that logic you do in there IMO better belongs in the controller. Too much magic for a view, especially as it accesses 'params'
[17:22:23] Papierkorb: lindii_: no but that having the same thing thrice is not DRY.
[17:22:37] Papierkorb: lindii_: $(".tab-content").html("<%= escape_javascript(render(< ONLY DIFFERENCE HERE >)) %>");
[17:22:57] maia: has joined #RubyOnRails
[17:23:52] Papierkorb: lindii_: users.controller.rb (Interessting naming scheme, convention is users_controller.rb). No idea about others, but I'd use a case statement there instead of the if-elsif chain
[17:24:02] maia: has joined #RubyOnRails
[17:24:26] lindii_: Papierkorb: yes i need to change that
[17:24:51] roolo: has joined #RubyOnRails
[17:24:53] theBestNunu: has joined #RubyOnRails
[17:25:31] lindii_: Papierkorb: also in the view i was thinking about moving this code: class: params[:tab] == nil ? "active" : "" %> to a helper
[17:25:37] lindii_: Papierkorb: same as for rendering
[17:25:39] maia: hello. does anyone know how to execute a sql statement with bypassing prepared statements? For some reason my query has not all variables replaced, therefor it???s adding endless amounts of sql statements to the statement cache.
[17:25:55] Rubie: has joined #RubyOnRails
[17:26:08] Papierkorb: lindii_: I'd move the whole if-elsif chain of the view into the controller
[17:26:26] jalcine: has joined #RubyOnRails
[17:26:34] Papierkorb: lindii_: Not a fan of helpers, they clutter the environment
[17:26:47] jgt: has joined #RubyOnRails
[17:26:58] lindii_: Papierkorb: but would i move that in the controller?
[17:28:55] Papierkorb: lindii_: e.g. by having @render_arguments = [...] and then $(".tab-content").html("<%= escape_javascript(render(*@render_arguments)) %>"); - Though, you could also use @view_data_or_so = render_to_string(...) and then just have ...escape_javascript(@view_data_or_so) ..
[17:29:12] Papierkorb: I like the latter more as it's less splat operator magic
[17:30:05] mwlang: lindii_: implement a link_to_tab that takes two arguments, title, and path and returns the whole <li>???.</li> block as html_safe string.
[17:30:10] christiandsg: has joined #RubyOnRails
[17:30:22] maia: Rephrasing my question: is there a way to manually prepare a sql statement to ensure that all variables are accounted for?
[17:30:54] Papierkorb: yeah, no JSONP needed really lindii_ if you except HTML and then just inject the returned HTML document into your DOM in JS
[17:31:20] mwlang: mwlang: well, you might need a third parameter for tab_id to pass ???posts???, ???images??? etc. so you can set active class appropriate...
[17:31:22] lindii_: im kinda lost but i will figure that out
[17:31:23] Papierkorb: Also you can't mess up escaping. yes I see the call to the escape method, but a call you don't have to make is a call that you can't mess up (in the future)
[17:32:56] bruno-: has joined #RubyOnRails
[17:33:08] crystal77: has joined #RubyOnRails
[17:33:48] crystal77: Is it possible to watch all actions that I do in a console? Like if I create a new user in a web app, see all the "stuff" that it's doing in the console?
[17:35:44] DoctorMonocular: has joined #RubyOnRails
[17:37:08] cnk: has joined #RubyOnRails
[17:37:51] northfurr: has joined #RubyOnRails
[17:38:54] riotjones: has joined #RubyOnRails
[17:40:34] ishahnaz: has joined #RubyOnRails
[17:40:36] yfeldblum: has joined #RubyOnRails
[17:42:22] paulcsmith: has joined #RubyOnRails
[17:43:01] toretore: has joined #RubyOnRails
[17:43:10] bricker: crystal77: it'll show you the DB queries, what else are you looking for?
[17:43:24] bricker: every method call?
[17:43:24] baweaver: has joined #RubyOnRails
[17:43:26] crystal77: like what controller it used, parameters, any calculations, etc
[17:43:37] crystal77: not just GET requets
[17:44:02] bricker: crystal77: controller and parameters are in the normal server log in development. I don't know what you mean by "calculations"
[17:45:59] chinmay_dd: has joined #RubyOnRails
[17:46:05] baweaver: has joined #RubyOnRails
[17:47:06] IceyEC: has joined #RubyOnRails
[17:48:15] Sadin: has joined #RubyOnRails
[17:49:43] dopie: has left #RubyOnRails: ("Leaving")
[17:50:02] rubyonrails890: has joined #RubyOnRails
[17:50:34] arup_r: has joined #RubyOnRails
[17:51:35] jkamenik1: has joined #RubyOnRails
[17:55:11] kegan_: what do i have to do to get bootstrap working
[17:55:20] kegan_: if i had classes and views that routed fine before
[17:55:30] zpe: has joined #RubyOnRails
[17:55:37] doodleha_: has joined #RubyOnRails
[17:55:38] kegan_: what is it that i've done by putting the imports for bootstrap-sass, and the includes in application.css and application.js or whatever
[17:56:19] walkingtoast: has joined #RubyOnRails
[17:56:22] kegan_: that my stylesheet links don't work, for instance
[17:56:25] kegan_: the way that they used to?
[17:56:47] benhuda: has joined #RubyOnRails
[17:58:42] Dbugger: has joined #RubyOnRails
[17:58:45] Dbugger: Hello guys.
[17:58:46] stephen_g: is the stylesheet loading up at all?
[17:59:12] Dbugger: Can someone explain me why do I need Apache or Nginx to use the Puma webserver on my projects? Why can't I use it directly to server to the whole internet?
[17:59:12] jamiely: has joined #RubyOnRails
[17:59:39] kegan_: stephen_g I'm new to web dev but not coding, i'm having trouble wrapping my head around the different dependencies and things
[17:59:47] kegan_: it's telling me that the asset was filtered out and will not be served
[17:59:59] stephen_g: what's telling you that?
[18:00:11] kegan_: myserver/myobject
[18:00:28] kegan_: where /myobject used to serve the index
[18:00:28] stephen_g: i mean is it a message that you see in your browser console or your terminal?
[18:00:40] kegan_: browser console
[18:01:00] kegan_: well, both
[18:01:27] smathy: dbugger, because it's better resource usage. An httpd is very good at serving static files and doing all the HTTP/S termination etc. - why would you waste puma on doing those things.
[18:01:47] deol: has joined #RubyOnRails
[18:02:23] smathy: dbugger, your question is basically the same as saying: "Why do I have to have a kernel, why can't puma just boot the machine and handle access to the filesystem directly?"
[18:02:48] SteenJobs: has joined #RubyOnRails
[18:03:14] djbkd: has joined #RubyOnRails
[18:03:48] nahtnam: does unicorn server only run one thread or something? I cant seem to make two ajax calls at the same time! :(
[18:04:18] jamesrward: has joined #RubyOnRails
[18:04:27] tubbo: nahtnam: MRI is single-threaded by design...
[18:04:40] nahtnam: tubbo: By thread i mean worker or whatever
[18:04:46] nahtnam: I dont know what unicorn calls it
[18:04:51] nahtnam: puma works fine but not unicorn
[18:05:02] tubbo: nahtnam: unicorn should be running multiple concurrent worker processes tied together by the same master process. how many workers are you running with unicorn?
[18:05:18] nahtnam: I dont know, im just running unicorn server
[18:05:19] tubbo: iirc the default is 4 but i might be wrong, been a minute since i configured unicorn (i'm mostly a puma guy these days)
[18:05:29] jamesrward: I have a rake task I'm running on heroku that should be fetching a bunch of twitter users locations. It works fine locally but on heroku my counts show no changes to the database after each run.
[18:05:46] tubbo: nahtnam: ps -ef | grep unicorn
[18:05:53] nahtnam: TO be more sppecific, I have: alias railss='unicorn -p 3000'
[18:06:10] livathinos: has joined #RubyOnRails
[18:06:30] tubbo: nahtnam: you should see a few processes, one being "unicorn: master process" and the others "unicorn: worker process
[18:06:31] jamesrward: I added a bunch of puts so I can see the task is going through each iteration as expected without errors but when I drop into the console it appears that nothing has changed.
[18:06:44] tubbo: betting you either have just 1 worker or there's something in your code tying up the other 3 workers
[18:06:53] nahtnam: tubbo: http://i.imgur.com/3ewdHBG.png
[18:06:56] nahtnam: Looks like only one
[18:07:52] jamesrward: heroku run rake twitter:task not run agains the default promoted database for that app? Do I need to specify an environment for this to work?
[18:08:13] tubbo: nahtnam: unfortunately, you'll have to deal with the lack of styles on http://unicorn.bogomips.org/ but the docs are there and i think it even gives you an example config.
[18:08:26] DoctorMonocular: has joined #RubyOnRails
[18:08:48] erich: has joined #RubyOnRails
[18:09:06] tubbo: jamesrward: nope, that should work. what's your RAILS_ENV on heroku?
[18:09:07] chouhoulis: has joined #RubyOnRails
[18:09:45] jamesrward: tubbo: production
[18:10:02] chouhoulis: has joined #RubyOnRails
[18:10:46] jamesrward: https://gist.github.com/anonymous/301b7acca06dc7a829fe Here's a gist of the code and I am running it via heroku run rake twitter:follower_count
[18:10:50] tubbo: jamesrward: well then, not sure why that wouldn't work. does your rake output on heroku suggest that it is in fact making changes to the DB, yet when you actually query the DB it's not apparently there?
[18:11:00] jamesrward: All the puts come up as expected along the way.
[18:11:13] tubbo: jamesrward: you're not checking whether `p.save` actually worked
[18:11:27] tubbo: a callback could have returned nil or false and then `p.save` would not throw an exception, but still return false
[18:11:31] nahtnam: tubbo: Fixed it, had to add -c config/unicorn.rb Thanks
[18:11:43] tubbo: nahtnam: ahhh yeah :) didn't know if you already had a configuration set up
[18:12:12] mwlang: does anyone have a rake task to turn an activerecord instance into a yaml fixture?
[18:12:21] Tinyyy: has joined #RubyOnRails
[18:12:55] Dbugger: smathy, but we have been doing it the other way for a long time? Why this change, now that I start getting into RoR?
[18:13:09] jamesrward: tubbo: do you recommend something like unless p.save!
[18:13:36] tubbo: jamesrward: yeah, i'd `puts` no matter what you do...so if p.save then puts "it worked" else puts "it failed" end
[18:13:42] bonhoeffer: has joined #RubyOnRails
[18:13:53] elepedus: has joined #RubyOnRails
[18:14:04] jeadr: has joined #RubyOnRails
[18:14:09] smathy: dbugger, who has been doing what the other way around? I assume you don't mean that you've been using puma to serve static assets before getting into RoR?
[18:15:53] jamesrward: tubbo: adding that now. Could be worth noting I am checking after each run via heroku run rails console and Participant.where("twitter_location IS NULL").count to look for count changes.
[18:16:45] tubbo: dbugger: if you're talking about just using a module on apache or nginx to interpret your server-side code or whatever, it's actually the same concept...just a ruby app server is an arbitrary process on the box, communicating through a standard socket protocol, rather than a built-in module to nginx and apache.
[18:17:33] tubbo: this is hugely beneficial for the advancement of ruby app servers, as they are no longer coupled to the cruft and release cycles of server vendors.
[18:18:02] tubbo: not to mention that your application can live on a collection of boxes independent to your web server cluster, which would scale automatically and independently from one another.
[18:18:36] puppeh: has joined #RubyOnRails
[18:18:39] tubbo: jamesrward: well that's just figuring out if anything happened at all. what i'm thinking is your class or something in the callback lifecycle is preventing the data from getting written...either that or you're looking in the wrong database for the data.
[18:19:02] bin_005: has joined #RubyOnRails
[18:19:28] SteenJobs: has joined #RubyOnRails
[18:19:33] jamesrward: tubbo: Looks like the save is fine, the problem is how I am checking to confirm after. Something is wrong with how I am using rails console.
[18:19:56] tubbo: jamesrward: check Rails.env to make sure you're in the environment maybe?
[18:20:21] tubbo: jamesrward: also $twitter is a code smell. don't use globals.
[18:21:05] Papierkorb: "[20:20] <tubbo> jamesrward: also $twitter is a code smell. don't use boring social networks"
[18:21:24] baweaver: has joined #RubyOnRails
[18:21:25] jkamenik: has joined #RubyOnRails
[18:21:30] Papierkorb: tubbo: sorry, could not resist
[18:21:40] northfurr: has joined #RubyOnRails
[18:22:22] Dbugger: smathy, tubbo, I have been all my life a PHP developer, and now that I go into ruby I see this new thing. So I just wonder, WHY the difference?
[18:22:39] jamesrward: tubbo: Rails.env is coming back as production on the console as well. Not sure where things are getting out of sync. There are definitely new records being saved but my counts stay the same.
[18:22:51] tubbo: jamesrward: strange
[18:23:00] tubbo: dbugger: i just told you
[18:23:16] tubbo: dbugger: <tubbo> this is hugely beneficial for the advancement of ruby app servers, as they are no longer coupled to the cruft and release cycles of server vendors.
[18:23:17] Dbugger: tubbo, I sadly dont know what a "standard socket protocol" is
[18:23:52] smathy: dbugger, so what PHP app server do you think has been serving static assets?
[18:23:55] tubbo: dbugger: being a PHP developer, you know as well as I do the pain of hosting apps on shared environments, not being in control of the environment means you're not able to upgrade PHP to use the newest and coolest features
[18:24:26] Dbugger: smathy, sorry, Im not following
[18:24:56] Dbugger: tubbo, What do you mean with "shared environments"? Having an app running on more than one server?
[18:25:21] tubbo: dbugger: decoupling the "static web server" from the "app code server" allows one to change out the app server or upgrade ruby at their own discretion, without needing to recompile nginx.
[18:25:45] DLSteve: has joined #RubyOnRails
[18:25:49] RegulationD: has joined #RubyOnRails
[18:25:53] smathy: dbugger, you were saying that puma should serve static assets, asking why do you need nginx/apache to do that. I explained and you said "but we have been doing it the other way for a long time". So are you suggesting that in the PHP world you didn't have apache or nginx? You were just using some PHP app server to do all your httpd?
[18:26:01] tubbo: dbugger: yes, like at my company we usually deploy our codebases to about 3 app servers per client, and those boxes are not the same machines that nginx lives on
[18:26:29] Dbugger: How is that better than just updating a single webserver (for instance Apache)?
[18:26:35] tubbo: dbugger: "standard socket protocols" just means like TCP, HTTP or standard UNIX sockets, which are basically TCP but handled entirely within the operating system (so less overhead)
[18:27:00] Dbugger: tubbo, smathy, sorry Im getting mixed up reading you both at the same time..
[18:27:06] bruno-: has joined #RubyOnRails
[18:27:08] JakFrist: has joined #RubyOnRails
[18:27:28] jamesrward: tubbo: ok I see what's happening. Something is wrong with the way I am ordering records to update. It seems that NULLS FIRST is not being obeyed so it is updating existing fields instead of filling in the NULLS first. hence my NULL count never changed.
[18:27:57] tubbo: dbugger: in fact, this is how *most* of the world deploys software...from java to python.
[18:28:10] kegan_: stephen_g I forgot the yield block
[18:28:13] kegan_: I freaking
[18:28:20] tubbo: dbugger: but i don't think anyone is claiming it's better. at least i'm not. just saying it's different.
[18:28:29] smathy: tubbo, you seem to think PHP is different too, I'm still at a loss.
[18:28:30] kegan_: HOW STUPID CAN ONE MAN BE
[18:28:52] tubbo: smathy: no, i explained why it's the same thing a few lines above
[18:29:07] Dbugger: tubbo, mind a PM?
[18:29:10] northfurr: has joined #RubyOnRails
[18:29:17] tubbo: i'm saying what's different is the idea that you're compiling the app server as a module on the web server vs. spinning off the app server as its own separate process. that's what's different.
[18:29:20] tubbo: ruby does that too :)
[18:29:22] tubbo: dbugger: sure
[18:29:53] pipework: has left #RubyOnRails: ("Protesting")
[18:30:14] pragmatism: has joined #RubyOnRails
[18:30:55] christiandsg: has joined #RubyOnRails
[18:30:55] choke: has joined #RubyOnRails
[18:30:59] sonofdirt: has joined #RubyOnRails
[18:33:07] atzorvas: has joined #RubyOnRails
[18:33:48] yfeldblum: has joined #RubyOnRails
[18:33:53] northfurr: has joined #RubyOnRails
[18:34:24] oscarbr92: has joined #RubyOnRails
[18:34:45] j3r0: has joined #RubyOnRails
[18:36:14] oscarbr92: mikecmpbll: you were right it worked :D
[18:36:22] maia: has joined #RubyOnRails
[18:36:54] djbkd: has joined #RubyOnRails
[18:38:33] benlieb: has joined #RubyOnRails
[18:38:49] kristofferR: has joined #RubyOnRails
[18:39:16] n008f4g_: has joined #RubyOnRails
[18:39:30] HenriettaSalt: has joined #RubyOnRails
[18:39:38] nogic: has joined #RubyOnRails
[18:41:30] atzorvas: long Q about polymorphic assocs. I have models: Dataset, Crawler, Index & Alert. a dataset has one crawler and many indices, and an index/crawler belongs_to dataset. An alert has alertable_{type,id}, and I have defined two methods, one def alertable; returns index or crawler; end and one def dataset; returns alertable.dataset; end. But I can't find how to group Alert by datasets, any help would be gr
[18:42:02] arup_r: atzorvas, what to eat? ;)
[18:42:20] oflannabhra: has joined #RubyOnRails
[18:42:37] jkamenik: has joined #RubyOnRails
[18:42:49] atzorvas: arup_r: it's gr-eat, long msg and it splitted to 2 rows :$
[18:43:04] dstarh: has joined #RubyOnRails
[18:43:30] atzorvas: just for ref, here is my alert.rb https://gist.github.com/atzorvas/0292d535a82c03eb8603
[18:43:34] arup_r: I am hungry so... I thought you are gving something to eat
[18:43:56] atzorvas: I'm hungry too :P
[18:44:06] arup_r: mwlang, Hi
[18:44:23] jkamenik1: has joined #RubyOnRails
[18:44:40] mwlang: arup_r: howdy
[18:44:51] arup_r: doing good. n you ?
[18:45:18] mwlang: a-ok. boatloads of fun in Rails 1.2???.not!
[18:46:12] smathy: atzorvas, you don't know about the :polymorphic option for `belongs_to`? Or was there a reason you rolled your own?
[18:47:30] kegan_: do I have to manually add a precompile for every class css/js file in assets.rb?
[18:47:52] badmadrad: has joined #RubyOnRails
[18:49:38] benlieb: has joined #RubyOnRails
[18:50:02] atzorvas: has joined #RubyOnRails
[18:51:24] DEA7TH: has joined #RubyOnRails
[18:53:50] existensil: has joined #RubyOnRails
[18:54:06] CanTonic: has joined #RubyOnRails
[18:54:22] smathy: What's assets.rb ?
[18:54:43] Cervajz: has joined #RubyOnRails
[18:55:19] northfurr: has joined #RubyOnRails
[18:55:55] Cervajz_: has joined #RubyOnRails
[18:56:16] jkamenik: has joined #RubyOnRails
[18:57:22] mephistophocles: has joined #RubyOnRails
[19:00:09] speakingcode: has joined #RubyOnRails
[19:00:28] bronson: has joined #RubyOnRails
[19:00:55] michaeldeol: has joined #RubyOnRails
[19:01:17] ascarter: has joined #RubyOnRails
[19:01:57] ruurd: has joined #RubyOnRails
[19:02:07] jkamenik: has joined #RubyOnRails
[19:02:33] michaeldeol: has joined #RubyOnRails
[19:02:45] JoshL: has joined #RubyOnRails
[19:02:49] kegan_: smathy initializers
[19:02:57] BongoShaftsbury: has joined #RubyOnRails
[19:02:58] havenwood: has joined #RubyOnRails
[19:03:40] bonhoeffer: is it possible to set which child layout in the controller?
[19:05:35] benlieb: has joined #RubyOnRails
[19:08:21] atzorvas: bonhoeffer: please clarify your question.
[19:08:26] kadoppe: has joined #RubyOnRails
[19:10:12] rogue_koder: has joined #RubyOnRails
[19:11:11] arup_r: smathy, Rails create the file by default
[19:11:18] arup_r: assets.rb I meant
[19:11:35] speakingcode: has joined #RubyOnRails
[19:12:22] atzorvas: just for ref, my solution to the problem asked before. Dunno if it's a nice solution, but it seems to work! https://gist.github.com/atzorvas/0292d535a82c03eb8603/revisions?diff=split
[19:12:58] yardenbar: has joined #RubyOnRails
[19:13:04] roolo: has joined #RubyOnRails
[19:13:08] atzorvas: arup_r: now let's eat
[19:13:19] arup_r: sure......
[19:15:36] wldcordeiro: has joined #RubyOnRails
[19:16:28] northfurr: has joined #RubyOnRails
[19:17:33] gerep: Is there any difference between :class => "btn" and class: "btn"?
[19:17:41] gerep: I know both will do the same thing
[19:17:52] gerep: But will one be "better"?
[19:18:19] hololeap: has joined #RubyOnRails
[19:18:19] slash_nick: gerep: performance wise, no
[19:18:34] gerep: slash_nick, that was my doubt :D thanks
[19:18:45] gerep: slash_nick, it will be just a question of taste
[19:19:06] dcope: hey all - is there a way to have an instance variable only evaluate if it is used in the view?
[19:19:26] slash_nick: gerep: yeah, taste... consistency
[19:19:30] bePolite: has joined #RubyOnRails
[19:19:46] slash_nick: dcope: what do you mean?... maybe more importantly, what are you trying to do?
[19:20:59] dcope: slash_nick: in my controller i'm declaring an instance variable so @car = Car.find.... but in the view i'm caching everything related to @car
[19:21:07] dcope: so i dont want Car.find to run unless the cache has expired
[19:21:51] slash_nick: dcope: Are you not caching the car object itself? just the view?
[19:22:25] dcope: just the view at the moment.
[19:22:43] speaking1ode: has joined #RubyOnRails
[19:22:45] slash_nick: @cars = Rails.cache.fetch(:cars) { Car.where(is_a_car: true) } would initialize the cache on first run, utilizing the cache on subsequent calls
[19:23:09] jkamenik: has joined #RubyOnRails
[19:23:13] dcope: yeah, i know i can cache the object itself. i was just wondering if i could do it from the views standpoint
[19:23:45] Shoutsid: has joined #RubyOnRails
[19:25:29] greengriminal: has joined #RubyOnRails
[19:25:44] EminenceHC: has joined #RubyOnRails
[19:27:22] slash_nick: dcope: i think caching the object is how you can forego running the query... to forego parsing objects and re-rendering views, you use view or fragment caching on top of that. Am I mistaken guys?
[19:27:41] sandstrom: has joined #RubyOnRails
[19:27:49] dcope: ah, i didn't think about caching on both ends
[19:27:59] speakingcode: has joined #RubyOnRails
[19:28:01] bweston: has joined #RubyOnRails
[19:28:38] slash_nick: dcope: so when your ttl runs out, you'll fetch new objects... if those objects have the same id/updated_at timestamps, the view cache is utilized...
[19:29:00] slash_nick: dcope: but if that object has updated, the view is rerendered and recached
[19:29:33] ivanskie: has joined #RubyOnRails
[19:29:48] paulcsmith: has joined #RubyOnRails
[19:30:00] solars: has joined #RubyOnRails
[19:30:50] businessgeek: has joined #RubyOnRails
[19:31:22] mikebonar: has joined #RubyOnRails
[19:31:43] SxDx: has joined #RubyOnRails
[19:31:46] gambl0re: has joined #RubyOnRails
[19:32:44] kristofferR: has joined #RubyOnRails
[19:34:00] choke: has joined #RubyOnRails
[19:35:06] banister: has joined #RubyOnRails
[19:35:34] ivanskie: has joined #RubyOnRails
[19:37:09] maia: has joined #RubyOnRails
[19:37:17] SxDx: Hello, I'm currenlty having a problem with STI and has_many_through. I created a gist to show the problem: https://gist.github.com/SxDx/55883be19c8e27003b05
[19:37:46] SxDx: Can someone help me out?
[19:38:02] juanpaucar: has joined #RubyOnRails
[19:38:26] juanpaucar: has joined #RubyOnRails
[19:38:57] jkamenik1: has joined #RubyOnRails
[19:40:54] JakFrist: has joined #RubyOnRails
[19:41:11] maia: tenderlove: in case you???re available: is there any way to bypass prepared statements? Because SomeActiveRecordClass.where(name: 'x').update_all(score: 123) will add a new key to the statement pool for each (unique) value in update_all.
[19:41:51] baweaver: has joined #RubyOnRails
[19:43:48] Cervajz: has joined #RubyOnRails
[19:44:54] da3mian: has joined #RubyOnRails
[19:45:24] danman: has joined #RubyOnRails
[19:46:21] maia: tenderlove: ???or is there a way to help adequaterecord to prepare a statement with all values bound? 'UPDATE t SET a = ? WHERE b = ?' will only use the latter value for preparation
[19:47:42] bePolite: has joined #RubyOnRails
[19:48:06] da3mian: has joined #RubyOnRails
[19:48:22] maia: (I???m not attempting to disable prepared statements completely, just to skip using the statement pool cache for statements that are unique)
[19:49:01] polpak: has joined #RubyOnRails
[19:49:33] smathy: dcope, the other alternative is to put a `@car ||= ` assignment into a method, and use helper_method to expose that method to your view, and use that instead of @car
[19:49:59] SanguineAnomaly: has joined #RubyOnRails
[19:50:03] diegoviola: has joined #RubyOnRails
[19:50:44] baweaver: has joined #RubyOnRails
[19:53:04] jeadr: has joined #RubyOnRails
[19:54:34] ciree: my rails app
[19:54:38] ciree: renders a spa
[19:54:45] ciree: I want to append a hash fragment to the end of the url
[19:54:47] ciree: in the controller
[19:55:26] sonofdirt: has joined #RubyOnRails
[19:55:39] AnoHito: has joined #RubyOnRails
[19:56:00] smathy: ciree, !enternotspace
[19:56:00] helpa: ciree: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[19:56:11] benlieb: has joined #RubyOnRails
[19:56:23] smathy: ciree, !code - re your actual problem
[19:56:23] helpa: ciree: 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.
[19:56:34] rogue_koder_: has joined #RubyOnRails
[19:56:48] ciree: not sure how posting code would help
[19:57:24] ciree: so page is /stuff/things, and I want the return to be /stuff/things#spa
[19:58:38] kidoz: has joined #RubyOnRails
[19:59:48] zpe: has joined #RubyOnRails
[20:00:48] smathy: redirect_to request.path + "#spa"
[20:01:44] ciree: that will rerun my controller action logic though no?
[20:02:48] erich: has joined #RubyOnRails
[20:03:20] Axsuul: has joined #RubyOnRails
[20:03:21] Coldblackice: has joined #RubyOnRails
[20:03:38] smathy: ...in fact, all else being equal it will just create an infinite request loop.
[20:03:52] kegan_: has joined #RubyOnRails
[20:03:56] smathy: All that's why I asked for your code, so I could see what you were actually trying to do.
[20:03:56] roolo: has joined #RubyOnRails
[20:04:38] Axsuul: has joined #RubyOnRails
[20:06:00] Axsuul: has joined #RubyOnRails
[20:07:24] Swappticon: has joined #RubyOnRails
[20:09:45] SxDx: has joined #RubyOnRails
[20:09:46] iliketurtles: has joined #RubyOnRails
[20:09:58] shathoma: has joined #RubyOnRails
[20:10:55] iliketurtles: has joined #RubyOnRails
[20:11:11] SxDx: Can anyone help fix my problem with STI and has_many through? https://gist.github.com/SxDx/55883be19c8e27003b05
[20:12:18] ascarter: has joined #RubyOnRails
[20:12:50] bruno-: has joined #RubyOnRails
[20:13:29] smathy: SxDx, I don't think you can fix it with the Rails associations. I think you'd need to create your own cities method that did a sub-select rather than a join.
[20:14:41] speaking1ode: has joined #RubyOnRails
[20:14:56] SxDx: no way to force rails to alias the tables?
[20:15:58] shathoma_: has joined #RubyOnRails
[20:16:12] smathy: SxDx, it already has aliased them, the STI code is just not using that alias properly.
[20:16:49] smathy: SxDx, no one likes STI much - there are a lot of ugly corner cases like this.
[20:16:58] smathy: SxDx, I'd ask you whether it's really worth it?
[20:19:12] SxDx: It's an existing application, wouldn't have used STI myself.
[20:19:40] christiandsg: has joined #RubyOnRails
[20:22:17] benlieb: has joined #RubyOnRails
[20:22:25] shathoma: what is the best way to test my models to make sure I have my associations right and they can do what I need them to do.. the ruby on rails console?
[20:22:26] drale2k: has joined #RubyOnRails
[20:23:08] smathy: SxDx, right, it's not irreversible - but obviously a fairly significant change, so yeah - your easiest route would be to write your own methods.
[20:23:20] smathy: shathoma, a test?
[20:23:55] shathoma: yah I have a ton of models i built, i want to test them sort of to make sure i have the asscoations right and they are storing data like they should (mostly because I have a whole bunch of models that are many to many or what not with join tables)
[20:24:34] shathoma: before i start building the UI i figured I would test them to make sure I have the associations working right and I know what im doing with active record and all the methods it will add etc.
[20:25:10] smathy: shathoma, then yeah, tests.
[20:25:44] SxDx: smathy, sadly writing my own methods also means no more eager loading
[20:25:45] shathoma: so I did notice a railscast on rspect, is that what i want? it seemed to test more functionality perhaps in the controllers later than just the models and how they are hooked up. or is it all encompassing?
[20:26:04] da3mian: has joined #RubyOnRails
[20:26:22] kies: has joined #RubyOnRails
[20:27:38] smathy: SxDx, your methods should return an AR::Relation object, just like the methods that has_many creates for you. Shouldn't change your eager loading code downstream at all.
[20:29:19] smathy: SxDx, usually, the only annoyance is that has_many writes a few other methods for you like the setter, and the ids methods. If you're using them you'll need to write them too.
[20:29:32] momomomomo: has joined #RubyOnRails
[20:29:51] smathy: shathoma, you can write tests for all parts of your application, including unit tests for your models.
[20:30:14] smathy: shathoma, I'd start here if I were you: http://guides.rubyonrails.org/testing.html
[20:30:22] hololeap: has joined #RubyOnRails
[20:30:57] shathoma: omg right there, I was making it way to complicated and looking at rails casts and what not
[20:31:08] MartinElvar: has joined #RubyOnRails
[20:31:22] shathoma: I didn't do any scaffolding so the tests weren't built for me.
[20:31:44] woobywoob: has joined #RubyOnRails
[20:32:01] gambl0re: whats the command that creates the model, controller, views all at the same time?
[20:32:10] gambl0re: its called scaffolding or something like that
[20:32:10] SxDx: ah yes, smathy thank you for your advice
[20:32:10] shathoma: in an odd twist my test/models folder has some .rb files but not the full gaumet of models. I can backfill that though I guess I will start there. Thanks smathy!
[20:32:30] shathoma: @gambl0re yes scaffolding I believe.
[20:32:44] smathy: shathoma, you're welcome.
[20:32:55] businessgeek: has joined #RubyOnRails
[20:33:08] smathy: gambl0re, run `rails generate` to see the things you can generate.
[20:33:27] smathy: gambl0re, then mostly you can run just `rails generate name_of_generator` to see the help for that generator.
[20:33:59] bin_005: has joined #RubyOnRails
[20:34:02] Rubie: has joined #RubyOnRails
[20:34:23] gambl0re: is it best practice do not use scaffolding?
[20:34:44] doodlehaus: has joined #RubyOnRails
[20:34:58] gambl0re: or just create each one seperately?
[20:36:10] jalcine: has joined #RubyOnRails
[20:36:23] blackmesa: has joined #RubyOnRails
[20:36:26] smathy: gambl0re, until you're finding that the scaffolding is just getting in your way, I say keep using it.
[20:38:38] Kallis: has joined #RubyOnRails
[20:39:11] segy: has joined #RubyOnRails
[20:39:16] choke: has joined #RubyOnRails
[20:39:44] helpa-bot: has joined #RubyOnRails
[20:40:25] gambl0re: has joined #RubyOnRails
[20:42:26] helpa-bot: has joined #RubyOnRails
[20:43:16] Norrin: ACTION still doesn't know what scaffolding means
[20:43:29] Norrin: i'm glad the main guide no longer has any mention of it
[20:43:32] tubbo: gambl0re: there's also the resource generator...i never liked the code scaffolds made all that much
[20:43:44] jenrzzz: has joined #RubyOnRails
[20:43:46] tubbo: it just creates blank classes (for the most part) for everything you'd need in your app
[20:44:04] tubbo: Norrin: you'd know what scaffolding meant...if the main guide mentioned it ;)
[20:44:30] Norrin: i tried this years ago and could never grep what scaffold meant
[20:44:43] Norrin: 2 years ago
[20:45:38] helpa: has joined #RubyOnRails
[20:46:14] ivanskie: has joined #RubyOnRails
[20:46:38] DoctorMonocular: has joined #RubyOnRails
[20:47:50] x-light: has joined #RubyOnRails
[20:48:15] cnk: has joined #RubyOnRails
[20:48:36] lele: has joined #RubyOnRails
[20:49:10] helpa-bot: has joined #RubyOnRails
[20:49:15] darrenca_: has joined #RubyOnRails
[20:50:19] helpa-bot: has joined #RubyOnRails
[20:50:55] ur5us: has joined #RubyOnRails
[20:51:24] n00bDev: has joined #RubyOnRails
[20:52:16] iliketurtles: has joined #RubyOnRails
[20:52:25] n00bDev: why am i getting a illegal quoting on this line?
[20:52:27] n00bDev: https://gist.github.com/gwong89/693a127ccbe3befcdfd2
[20:53:13] arup_r: little confusion though
[20:53:18] n00bDev: im trying to import my csv file and encountered a invalid byte utf-8 error, and googling resulted advising me to put the encoding
[20:53:32] arup_r: see this method.. http://guides.rubyonrails.org/active_record_validations.html#custom-methods when
[20:53:35] Xiti: has joined #RubyOnRails
[20:53:58] smathy: n00bdev, add the full error as a new file in your gist.
[20:54:01] arup_r: it is a active_user shouldn't the method will return `nil`.. then how it is valid
[20:54:22] arup_r: I am not getting for now how custom method helps to validation..
[20:54:44] arup_r: does valid? method check errors object to see if the record id valid or not ?
[20:55:26] smathy: valid? runs all the validations, then returns true if errors is empty.
[20:55:45] smathy: ...well actually it clears errors, then runs the validations, then checks errors
[20:55:48] arup_r: Aww I see
[20:56:09] arup_r: I thought method return value is captured.. now it makes sense
[20:56:38] arup_r: thanks.. before sleep I wanted to be clean at my concept..
[20:56:41] chipotle: has joined #RubyOnRails
[20:56:42] arup_r: good night pupils..
[20:56:50] JoshyJosh: has joined #RubyOnRails
[20:56:51] n00bDev: https://gist.github.com/gwong89/693a127ccbe3befcdfd2
[20:56:55] n00bDev: smathy: its updated
[20:57:28] n00bDev: line 9 is the highlighted line on the page
[20:57:48] drale2k_: has joined #RubyOnRails
[20:58:49] dionysus69: has joined #RubyOnRails
[20:59:04] jeadr: has joined #RubyOnRails
[21:00:01] bronson: has joined #RubyOnRails
[21:01:15] jkamenik: has joined #RubyOnRails
[21:07:41] doodlehaus: has joined #RubyOnRails
[21:08:31] EminenceHC: has joined #RubyOnRails
[21:08:49] darrencauthon: has joined #RubyOnRails
[21:11:27] benlieb: has joined #RubyOnRails
[21:11:30] Scriptonaut: I have a User model, and it has_one signature. I have a form_for current_user that contains a fields_for :signature, however even when I use strong params, it's telling me signature isn't permitted. This is my user_params: https://gist.github.com/robins35/1825b22d1029e7af816e
[21:11:42] Scriptonaut: anyone know why I'm getting: Unpermitted parameter: signature
[21:13:08] duderonomy: has joined #RubyOnRails
[21:13:37] bruno-: has joined #RubyOnRails
[21:14:16] bin_005: has joined #RubyOnRails
[21:15:21] StartupHub: has joined #RubyOnRails
[21:15:56] tubbo: Scriptonaut: i think the key is now 'signature', not 'signature_attributes'. though i may be wrong.
[21:16:01] tubbo: did you try that though?
[21:16:29] netzfisch: has joined #RubyOnRails
[21:18:02] Scriptonaut: no, I will though
[21:19:08] Scriptonaut: tubbo: that worked, but why do the docs say to do association-name_attributes
[21:19:31] Scriptonaut: and why did I have to do that for all my other associations?
[21:21:04] jeadr: has joined #RubyOnRails
[21:21:56] tubbo: Scriptonaut: hmm, do you have accepts_nested_attributes_for configured properly in your User model?
[21:22:11] doodlehaus: has joined #RubyOnRails
[21:22:49] northfurr: has joined #RubyOnRails
[21:23:04] Scriptonaut: hrm, even after adding that, it still won't permit it
[21:24:54] Skelz0r: has joined #RubyOnRails
[21:25:20] j3r0: has joined #RubyOnRails
[21:25:37] j3r0: jekyll or octopress ?
[21:25:45] j3r0: what you guys prefer ?
[21:27:22] cnk: I use octopress because it is so easy to get started
[21:27:40] cnk: but my blog's stylying looks like every other octopress site on the planet
[21:27:40] drale2k: has joined #RubyOnRails
[21:28:13] j3r0: I want to ask something ... I know it sounds stupid ... but you can post an article only with git ?
[21:28:28] tubbo: there's no admin interface or anything
[21:28:49] tubbo: there's no database, it's a static site generator that compiles HTML and CSS/JS files that you can load anywhere...S3, github pages, wherever you want
[21:29:11] doodlehaus: has joined #RubyOnRails
[21:29:52] n1lo: has joined #RubyOnRails
[21:32:09] jeadr: has joined #RubyOnRails
[21:33:41] cnk: so easy hosting - but the important part for my, I can edit the blog posts in emacs - not through some damn textarea form
[21:33:58] Radar: GOOD MORNING
[21:34:13] gambl0re: has joined #RubyOnRails
[21:34:15] cnk: What timezone are you in radar?
[21:34:20] Radar: cnk: THE BEST ONE
[21:34:43] cnk: seems a little early for down under - unless I am wrong about what time it is in AU
[21:35:45] yashinbasement: has joined #RubyOnRails
[21:36:08] Radar: naw you are spot on cobber
[21:36:16] tubbo: Radar: hello Radar i am looking for help on my app could you please take a look http://staging.thefartzone.com
[21:36:18] Radar: maybe I should say "g'day mates" or something
[21:36:27] Radar: !kick tubbo
[21:36:27] helpa: Radar: No.
[21:36:34] tubbo: thnx helpa
[21:36:52] Radar: is elasticsearch-model still the gem I want to use if I want my model data to be persisted to ElasticSearch?
[21:38:13] mikebonar: has joined #RubyOnRails
[21:38:21] smathy: n00bdev, link 404s, you took down the gist?
[21:38:49] allcentu1: has joined #RubyOnRails
[21:40:15] bruno-: has joined #RubyOnRails
[21:40:39] ivanskie: has joined #RubyOnRails
[21:41:25] tubbo: Radar: yeah, and you need it alongside elasticsearch-rails
[21:41:31] tubbo: if you want the rails integration stuff
[21:41:39] Radar: indeed I am getting to that point
[21:42:01] Radar: I'll have to do some tweaking with how it indexes products + their variants, but I think I can manage it.
[21:42:22] Radar: I say that because the way I've currently got it setup it returns a product with an inner_hit which is the variant that matches a UPC.
[21:42:31] bin_005: has joined #RubyOnRails
[21:42:52] Radar: Trying to build a product lookup database and pulling the info from multiple sources which go from "full of useful data" all the way down to "parse the title for the information"... it's fun.
[21:43:23] tubbo: you can definitely do that with the DSL
[21:43:28] Radar: "Flaschenhalter Bontrager Hollow 6 mm Baja Blue" Where the first 3 words are the product name, next two are the size, and final two are the colour.
[21:43:51] tubbo: it should be possible to get the same product from every angle
[21:43:52] Radar: I hope so :) I'll take a look when I get to work proper for the day. Currently doing work on MTWR.
[21:44:00] tubbo: so if i type blue bontrager hollow 6mm it will show up
[21:44:10] Radar: common terms search will do that
[21:44:11] helpa: Multitenancy With Rails - https://leanpub.com/multi-tenancy-rails - An excellent book that teaches you about building a Multitenanted Rails application. Written by Ryan Bigg.
[21:44:18] tubbo: oh yeah that thing
[21:44:28] Radar: I'm doing an update to that book which gets rid of the engine and adds the features to a proper application
[21:44:35] tubbo: man i wish people read that book before they tried to make our app into a multi-site situation
[21:45:45] tubbo: the way we have it, the multi-tenancy is handled at the db level
[21:46:02] tubbo: except on this one project that is ok
[21:46:11] tubbo: but involved introducing global state which is no bueno
[21:46:34] jgt: has joined #RubyOnRails
[21:46:59] oflannab_: has joined #RubyOnRails
[21:47:42] n00bDev: is it common when parsing csv files that the corresponding line isnt exactly the same when looking through a text editor/excel?
[21:47:58] Radar: n00bdev: no. You're doing it wrong.
[21:48:01] n00bDev: my columns are shifted up by 2 rows in rails console
[21:48:11] Radar: n00bdev: Code to reproduce the issue and CSV that goes with it plzkthx
[21:49:24] michaeldeol: has joined #RubyOnRails
[21:51:24] yaymukund: has joined #RubyOnRails
[21:51:47] _lovehandle_: has joined #RubyOnRails
[21:53:59] edwinvdgraaf: has joined #RubyOnRails
[21:54:00] Scriptonaut: when I add: accepts_nested_attributes_for :signature, it will no longer render my fields_for
[21:54:05] jeadr: has joined #RubyOnRails
[21:54:09] smathy: I wish there was a CTCP command to tell if someone had highlighting/alert on for their own nickname.
[21:54:26] smathy: Scriptonaut, !code
[21:54:26] helpa: Scriptonaut: 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.
[21:54:45] nya: has joined #RubyOnRails
[21:54:46] jlbenc: has joined #RubyOnRails
[21:55:25] n00bDev: https://gist.github.com/gwong89/b044e4e889cf597cfe86
[21:56:37] nahtnam: n00bdev: Thats not a csv
[21:56:37] Scriptonaut: smathy: https://gist.github.com/robins35/8ce82b10a66eb9ff29c1
[21:56:48] n00bDev: sorry adjusting
[21:57:02] Scriptonaut: And like I said, I have accepts_nested_attributes_for :signature in user.rb
[21:57:07] Scriptonaut: but adding that makes it not render
[21:57:47] Cervajz_: has joined #RubyOnRails
[21:59:12] smathy: Scriptonaut, is current_user.signature maybe not set to anything (yet)?
[21:59:14] baweaver: has joined #RubyOnRails
[21:59:20] diegoviola: has joined #RubyOnRails
[21:59:54] Scriptonaut: ah, ya it's not set
[21:59:59] erich: has joined #RubyOnRails
[22:00:01] n00bDev: https://gist.github.com/gwong89/b044e4e889cf597cfe86
[22:00:15] Duckily: has joined #RubyOnRails
[22:00:57] Rubie: has joined #RubyOnRails
[22:01:13] smathy: Scriptonaut, yeah, so that's why. You might want to do a bit of a `current_user.build_signature unless current_user.signature` somewhere.
[22:01:26] Duckily: i have an integer attribute on an organization named ???plan_limit???, which i want to be able to set to nil, for an unlimitted plan
[22:01:35] Scriptonaut: ah, thanks smathy
[22:01:55] manfrin: has joined #RubyOnRails
[22:02:12] Duckily: whats the best way for setting this to nil?
[22:02:18] smathy: Scriptonaut, also, assuming that your `form_for` is for `current_user` then you don't need to stipulate the value in the `fields_for` - ie. you can just do `= form.fields_for :signature do |signature_form`
[22:02:19] Duckily: from a form
[22:02:40] jlbenc: Hello all
[22:02:57] x-light: has joined #RubyOnRails
[22:03:05] jlbenc: Anyone familiar with simple_form?
[22:03:22] IceyEC: has joined #RubyOnRails
[22:04:26] tubbo: jlbenc: !used
[22:04:26] helpa: jlbenc: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[22:04:55] smathy: n00bdev, right, and so which line number in that CSV is showing up as which line in your console?
[22:05:38] Duckily: https://gist.github.com/anonymous/d0a26e76b5f3d39d0ff0
[22:05:41] jlbenc: I have s simple_form with <%= f.input :vehiculo_anio, as: :select, collection: (1..4) %> and it works fine, however, I'd like to have the range reversed, but if i set it as 4..1 it doesnt render anythning :(
[22:05:50] Duckily: is this the best way to do it with a virtual attribute?
[22:06:08] Duckily: seems kind of hacky
[22:06:58] Duckily: having a random checkbox that you manage in the controller doesn???t seem too much better??? any other ideas?
[22:07:22] smathy: jlbenc, (1..4).to_a.reverse
[22:07:42] art-solopov: has joined #RubyOnRails
[22:08:06] jlbenc: @smathy lemme try it... brb
[22:08:17] smathy: Duckily, is this the same form where you want to set it to integer values too?
[22:08:18] sonofdirt: has joined #RubyOnRails
[22:08:25] christiandsg: has joined #RubyOnRails
[22:08:29] Duckily: smathy: yeah
[22:08:52] Duckily: so via javascript i thought id hide the number field depending on whether its checked
[22:09:35] Duckily: i could also just use pure js and have the checkbox/button not just hide the field but clear it and then the server can set to nil if it doesn???t get an attribute
[22:10:23] jlbenc: @smathy That Did it!! Thanks!
[22:10:38] choke: has joined #RubyOnRails
[22:11:31] yaymukund: has joined #RubyOnRails
[22:11:41] choke: has joined #RubyOnRails
[22:11:51] j3r0: I accidentally instead of rails generate model Comment commenter:string body:text article:references I forgot the article: references , how I use the --force to overwrite ?
[22:12:01] n00bDev: smathy: random: shows up as 1 and useless_data shows up as 2
[22:12:23] n00bDev: row 10 in csv shows up as 8 in console
[22:12:49] smathy: Duckily, you know that if you just submit an empty text field it'll NULL out the value?
[22:13:02] smathy: Duckily, not sure if your question is about mechanics, or about UI.
[22:13:08] Duckily: smathy: wait really?
[22:13:09] smathy: jlbenc, you're welcome.
[22:13:25] Duckily: smathy: i though it just doesn???t update?
[22:13:25] cnk: j3r0: If you are not too far into it, just destroy and regenerate
[22:13:42] toretore: has joined #RubyOnRails
[22:13:55] j3r0: and how do I destroy ?
[22:14:04] Contigi: has joined #RubyOnRails
[22:14:08] smathy: Duckily, not sure why you thought that.
[22:14:13] j3r0: I will google it
[22:14:15] Rubie: has joined #RubyOnRails
[22:14:17] cnk: just say destroy where you say generate
[22:14:19] crdpink: has joined #RubyOnRails
[22:14:24] smathy: Duckily, I mean for a string field (in the DB) it'll set it to "" - but for an integer it sets it to NULL.
[22:14:25] cnk: so rails destroy scaffold or whatevery
[22:14:28] Duckily: smathy: is that because its a number field
[22:14:39] smathy: Duckily, in essence, yeah.
[22:14:41] Duckily: smathy: thats why i thought it, i suppose
[22:14:53] Duckily: smathy: ok so ill just handle it in js then, thanks!
[22:14:58] smathy: Duckily, I'd say more that the reason a string is set to "" is because it's a string.
[22:15:08] smathy: Duckily, you're welcome.
[22:15:09] j3r0: thnx cnk
[22:15:12] Duckily: smathy: right, i don???t know why i made that assumption
[22:16:14] greengriminal: has joined #RubyOnRails
[22:18:08] ledestin: has joined #RubyOnRails
[22:18:43] kinduff: has joined #RubyOnRails
[22:18:46] kinduff: has joined #RubyOnRails
[22:18:52] djbkd: has joined #RubyOnRails
[22:18:54] choke: has joined #RubyOnRails
[22:19:14] quazimodo: has joined #RubyOnRails
[22:19:46] kinduff: Does it make sense to store a record count in an integer column and update that with a worker if I'm require to count several records frequently?
[22:20:27] cnk: yes - and there is a rails convention for that
[22:20:50] cnk: http://yerb.net/blog/2014/03/13/three-easy-steps-to-using-counter-caches-in-rails/
[22:21:16] TheNet: has joined #RubyOnRails
[22:21:21] michaeldeol: has joined #RubyOnRails
[22:21:50] kinduff: thanks a lot cnk
[22:21:59] smathy: n00bdev, when you say "shows up" - what do you mean precisely? Because your code isn't printing anything out.
[22:22:18] Swappticon: has joined #RubyOnRails
[22:22:32] n00bDev: oh sorry i placed 2 puts statements in the method but i removed them
[22:23:15] greengriminal: has joined #RubyOnRails
[22:24:01] n00bDev: i basically printed out the row and current index
[22:25:38] smathy: n00bdev, ok, so excuse me if this is insulting, I know this is basic - but just in case - do you know that things like `each_with_index` are zero-based iterators?
[22:26:28] n00bDev: no insult taken. like my name says, im noob.
[22:27:04] IceyEC: has joined #RubyOnRails
[22:27:21] smathy: n00bdev, so the value of i in the first iteration will be 0
[22:27:38] smathy: Ie. row 1 is i=0
[22:27:38] greengriminal: has joined #RubyOnRails
[22:27:51] smathy: (or "the first row" might be a clearer way of saying it)
[22:27:53] n00bDev: right yeah im realizing that
[22:28:07] n00bDev: is tehre a way to start the iterator at one
[22:28:24] n00bDev: to reflect the same thing as the csv file
[22:28:45] n00bDev: because i need to only get data from row 11 and every 8th row after that
[22:29:44] smathy: n00bdev, just line_num = i + 1
[22:30:18] n00bDev: as the iterator?
[22:30:26] smathy: No, as the first line in your loop.
[22:30:47] smathy: n00bdev, btw, this is not a good way to do whatever you're trying to do.
[22:31:04] n00bDev: im open to suggestions
[22:31:24] n00bDev: i cant think of any other way to parse, the csv file is formatted terribly and its out of my contorl
[22:32:00] ivanskie: i wish there was a boot that would mention awesome_nested_set talk about it, and describe why you'd use it, etc...
[22:32:26] choke: has joined #RubyOnRails
[22:32:32] lindii_: is there a better way to do this instead of having these conditions in my view https://gist.github.com/adavia/537921286d99de9f6215
[22:33:46] smathy: n00bdev, well, based on the data you're showing I'd do this: next unless row[1] && row[1] != "b"
[22:33:52] djbkd: has joined #RubyOnRails
[22:34:02] smathy: n00bdev, also remove `headers: true` - your CSV doesn't have headers.
[22:34:38] smathy: n00bdev, my point really is that you should actually make your decision based on the presence of the data you're looking for.
[22:35:44] n00bDev: ohh ok thank you smathy
[22:35:58] baweaver: has joined #RubyOnRails
[22:36:51] helpa: has joined #RubyOnRails
[22:38:33] rails323: has joined #RubyOnRails
[22:38:46] ivanskie: what is STI support in awesome_nested_set (curiousity about to kill the cat).. i'm pretty sure its not sexually transmitted infections lolz
[22:39:38] ivanskie: single table inheritance, apprarently nevermind
[22:40:28] Oxyrus: has joined #RubyOnRails
[22:41:15] helpa: has joined #RubyOnRails
[22:41:20] ff7f00: has joined #RubyOnRails
[22:42:03] Radar: If you're not careful it will spread around your app exactly like a real STI
[22:42:21] Aeyrix: Late train
[22:42:26] Aeyrix: Crash on my road
[22:42:32] Aeyrix: Wew laddie
[22:42:59] yaw: has joined #RubyOnRails
[22:43:00] ff7f00: Hi all, I have a rails engine gem that will used mostly in development environments. It needs to programmatically gain access to all of the controllers in the application. However, with development environments, eager loading is disabled. Where would be the best place in my engine code to call Rails.application.eager_load! after the application has fully initialized?
[22:45:34] greengriminal: has joined #RubyOnRails
[22:45:56] _lovehandle_: has joined #RubyOnRails
[22:46:42] _lovehandle_: has joined #RubyOnRails
[22:46:49] ivanskie: yeah just found a great blog post about when would be a good idea to use STI and when its not a good idea.
[22:47:33] baweaver: has joined #RubyOnRails
[22:47:53] _lovehandle_: has joined #RubyOnRails
[22:48:32] ivanskie: im certain i need tree structure in my models tho. like for products, i have several types of computers, at first I just combined all columns into one table of monitors, desktop, laptop, all in ones.. but while doing so i realized this is dumb. So i went to look to Spree (of course).. and saw the awesome_nested_set gem there.. which then gave me inspiration
[22:48:52] _lovehandle_: has joined #RubyOnRails
[22:49:16] AnoHito: has joined #RubyOnRails
[22:50:08] ivanskie: i just wish there was a CRM/ERP engine.. and not an app... that I could just use out of the box to make own internal app.. but my research didn't turn up anything but outdated stuff.
[22:50:32] tubbo: ivanskie: you mean like salesforce?
[22:50:44] tubbo: or sharepoint? :)
[22:50:46] DoctorMonocular: has joined #RubyOnRails
[22:50:51] sloggerkhan: I'm looking into the upcoming rails 5 actionchannel features and I'm wondering if there's a way to send a message on subscribe before starting the "stream_from". For example, maybe the channel has some sort of MOTD that should be pushed on subscribe to the new client, but not to the whole channel? I'm starting to read through the actioncable code, but there's a quick answer or a link to a an expanded tutorial it's be nice.
[22:50:52] _lovehan1le_: has joined #RubyOnRails
[22:50:54] ivanskie: i gave MSCRM a shot, since we have a license..
[22:51:02] tubbo: salesforce, last i heard, has a fairly sophisticated api and client libraries to boot
[22:51:21] ivanskie: very nice. but to get quickbooks integration going is a nightmare and serious $$$$$
[22:51:27] _lovehandle_: has joined #RubyOnRails
[22:51:35] ivanskie: mscrm online would have been easier and cheaper but we don't have license for that.
[22:51:45] ivanskie: not sharepoint.
[22:52:14] ivanskie: salesforce is a bit too extensive..
[22:52:26] ivanskie: im talking more like openerp a.k.a. odoo
[22:52:38] ivanskie: but thats all php or what have you. yuck.
[22:53:00] ivanskie: (resentful at myself for not jumping on the php bandwagon with the rest of kids at school)
[22:53:09] choke: has joined #RubyOnRails
[22:53:16] tubbo: given you're using a decent DB, you shouldn't need STI at all
[22:53:24] ivanskie: nope i dont need it.
[22:53:33] ivanskie: but awesome_nested_set i sure could use
[22:53:51] tubbo: you really don't need it with rails either if you're ok with dealing with some unstructured data in your AR models (which can be easily refactored into view mdoels)
[22:54:09] ivanskie: that just went over my head
[22:55:09] darrencauthon: has joined #RubyOnRails
[22:55:15] n00bDev: if i have a number like 452,503.00, is the appropriate data type for this float?
[22:56:35] Aeyrix: Wait to store?
[22:56:49] Aeyrix: Is that meant to be currency?
[22:57:17] Sigma00: tell us what the number represents, it's easier to say what data type you need that way
[22:57:38] n00bDev: yeah its currency
[22:57:56] Aeyrix: Multiply it by 100 and store it as an integer.
[22:58:12] Sigma00: ^ best way
[22:58:22] Axsuul: has joined #RubyOnRails
[22:59:07] sonofdirt: has joined #RubyOnRails
[22:59:10] TheNet: has joined #RubyOnRails
[22:59:25] Axsuul: has joined #RubyOnRails
[22:59:33] ff7f00: "During development, Rails unloads all classes after every request." <- Did not know this. Is there anyway to disable this feature in development?
[22:59:45] ivanskie: tubbo, after some short reading on unstructured data in rails... yah i don't think that applies to my case.. the structure doesn't change very often. i will pretty much always have a few times of computer machines from a few vendors, and I took column names from the info I get from the vendors themselves from marketing / excel price lists.. etc.. (i like to have all info on hand for future, when I'll want to quickly find a computer by filtering
[22:59:45] ivanskie: certain spec stuff, and then do a check to see if its in stock at a supplier, and price. blah blah) I was considering just using Spree.. but we don't have and will not have any customer facing ecommerce.)
[23:00:19] Axsuul: has joined #RubyOnRails
[23:00:24] bronson: has joined #RubyOnRails
[23:00:49] Sigma00: ff7f00: yeah, it's an option in development.rb
[23:00:54] tubbo: maybe just toss all of it into elasticsearch and play with the facets and analyzers until you can get something cool?
[23:00:57] Sigma00: why would you though
[23:01:35] tubbo: ff7f00: that basically just means that it reloads your code when you make a new request
[23:01:43] tubbo: like if you change it
[23:02:33] ivanskie: I can do this all already as it is.. just login to supplier website, search stuff... and then once sale is done, put the stuff i really care to keep in my own excel file (company, serial numbers, what was installed / configured.. etc) which is what i do now.. but I wanted to make this app, since i'm lazy as a lot of us 'developers'.. so i'd just put quickbooks salesorder number, that'd pull up company info blah blah, and items, and i'd just scan
[23:02:33] ivanskie: barcode from box for model/part number/serial.. and type extra info in after.. lol
[23:03:01] ff7f00: Sigma00 tubbo: the issue is that I'm creating a gem for dynamic analysis of rails applications (for security assessments) and so more often then not my engine will be used in dev environments. My engine actively looks at the descendants of ApplicationControllers which don't exist if none of the paths have been eager loaded
[23:03:09] michaeldeol: has joined #RubyOnRails
[23:03:36] ff7f00: enabled eager_load through config.before_initialize do |app| helps on the first request
[23:03:45] ff7f00: but then Rails unloads everything after the request is done
[23:03:51] ff7f00: so this loading doesn't persist
[23:04:24] Sigma00: you're gonna have issues with adoption of your gem unless you make it work without getting rid of class reloading
[23:04:25] ff7f00: I believe settings config.cache_classes to true in enviornments/development.rb will save me here
[23:04:37] Inside: has joined #RubyOnRails
[23:04:37] Inside: has joined #RubyOnRails
[23:04:46] tubbo: ff7f00: yeah i'd be a little pissed if by installing your gem my classes didn't reload automatically in development
[23:04:51] tubbo: and i had to restart the server after every change
[23:05:01] weaksauce: i agree with tubbo and Sigma00
[23:05:07] superlou: has joined #RubyOnRails
[23:05:08] smathy: n00bdev, dissenting opinion from Aeyrix and Sigma00 - use the decimal type for currency.
[23:05:27] ff7f00: ah yea we're talking about different contexts here. This gem will be used strictly for security assessments where pentesters won't be making code changes
[23:05:39] Sigma00: ff7f00: then they can run it in production mode, no?
[23:05:41] ff7f00: I'd love for that to not be the case, but I'm not sure I see any other workaround
[23:06:12] tubbo: ff7f00: yeah i would say if i was penetration testing an application, i'd try and run it in production mode to get a better idea of what the app would really be like to deal with in the real world
[23:06:19] ff7f00: so when I pentest rails applications, i'll run a local instance in development mode (sometimes getting things to run in production is a pain in the butt e.g. ssl certs)
[23:06:30] tubbo: yeah that is true
[23:07:07] tubbo: ff7f00: you should probably include a warning along with the gem so people know to comment it out of their Gemfile or something
[23:07:08] ff7f00: but I will make small changes like adding binding.pry so you're right, having to reboot everytime i add a binding.pry would suck
[23:07:16] tubbo: yeah haha
[23:07:29] tubbo: plus...if you're penetration testing it's really easy in development
[23:07:32] rakm: has joined #RubyOnRails
[23:07:34] ff7f00: calling Rails.eager_load on every request would not be fun 8/
[23:07:39] tubbo: i mean, there's a friggin web console
[23:07:50] tubbo: just go to /rails/console and type system "rm -rf *" boom hax0red
[23:08:53] workmad3_: has joined #RubyOnRails
[23:09:00] ff7f00: what's interesting is that I haven't run into this problem with Rails 4.2, this only showed up when I started testing Rails 3.2
[23:09:11] christiandsg: has joined #RubyOnRails
[23:09:13] weaksauce: ff7f00 is the gem only used internally or is it going to be exposed to rubygems.org
[23:09:24] ff7f00: it'll be on rubygems.org (already is actually)
[23:09:56] Motoservo: has joined #RubyOnRails
[23:10:05] tubbo: ff7f00: what's it called? i'm curious to see what it does now :)
[23:10:41] ff7f00: boilerman (but it's not quite ready yet)
[23:11:07] ff7f00: hey, disabling cache_classes seems to do the trick
[23:11:19] ff7f00: err should I say, enabling cache_classes
[23:12:34] kies: has joined #RubyOnRails
[23:12:39] Kallis: has joined #RubyOnRails
[23:12:43] Axsuul: has joined #RubyOnRails
[23:13:02] Aeyrix: I saw the word pentesting
[23:13:12] Aeyrix: Relevant expertise reporting in
[23:13:20] Sigma00: I test pens for a living, too!
[23:13:46] Sigma00: ACTION recommends bic pens
[23:13:47] tubbo: nice work ff7f00
[23:13:53] Ropeney: has joined #RubyOnRails
[23:13:55] tubbo: fuck a bic
[23:14:11] tubbo: uni-balls all the way
[23:14:48] Miccet: has joined #RubyOnRails
[23:15:24] ff7f00: tubbo: thanks, but the filtering is the most useful part, and the feature that isn't implemented yet. Need to brush up on my JS skills for that one
[23:15:54] darrencauthon: has joined #RubyOnRails
[23:16:09] VeryBewitching: has joined #RubyOnRails
[23:16:17] ff7f00: also Zebra F-301 > bic & uni
[23:17:02] annlewis: has joined #RubyOnRails
[23:20:26] smathy: Jotter all the way.
[23:22:16] n00bDev: smathy im trying to parse a number with a comma, but when its saving it as a rounded number, eg: 434,331.00 => 434.0
[23:22:24] n00bDev: do i have to do a check or something?
[23:22:39] n00bDev: it is saving*
[23:23:54] weaksauce: doesn't ruby interpret the comma as an implicit array?
[23:25:19] lwu: has joined #RubyOnRails
[23:26:53] kegan_: has joined #RubyOnRails
[23:26:54] nahtnam: VeryBewitching: Can I pm you? :D
[23:27:13] njero: has joined #RubyOnRails
[23:29:59] gilest: has joined #RubyOnRails
[23:30:19] lwu: has joined #RubyOnRails
[23:30:25] smathy: n00bdev, you need to remove the commas from your string before trying to cast to decimal (or any number).
[23:31:02] smathy: weaksauce, that's just a comma in a string.
[23:32:46] nfk: has joined #RubyOnRails
[23:36:41] Lightsword: has joined #RubyOnRails
[23:38:04] SteenJobs: has joined #RubyOnRails
[23:40:21] RahulT: has joined #RubyOnRails
[23:42:30] LiquidInsect: has joined #RubyOnRails
[23:42:37] quazimodo: has joined #RubyOnRails
[23:42:38] IceyEC: has joined #RubyOnRails
[23:43:55] blackmesa: has joined #RubyOnRails
[23:45:41] GnuYawk: has joined #RubyOnRails
[23:47:14] urlgrey_: has joined #RubyOnRails
[23:47:26] blnkammo: has joined #RubyOnRails
[23:48:52] shippy: has joined #RubyOnRails
[23:49:10] charliesome: has joined #RubyOnRails
[23:49:37] charliesome: has joined #RubyOnRails
[23:50:17] iliketurtles: has joined #RubyOnRails
[23:51:35] swhitt: has joined #RubyOnRails
[23:51:51] DoctorMonocular: has joined #RubyOnRails
[23:52:56] umgrosscol: has joined #RubyOnRails
[23:54:47] jgt1: has joined #RubyOnRails
[23:56:55] shippy: has joined #RubyOnRails
[23:57:58] gambl0re: has joined #RubyOnRails
[23:58:23] j_mcnally: has joined #RubyOnRails
[23:58:30] SteenJobs: has joined #RubyOnRails