« Back to channel list

#RubyOnRails - 06 November 2015

« Back 1 day Forward 1 day »
[00:00:35] tubbo: i mean i use vim test alternates so i just do a key command and it creates the file for me :P
[00:01:43] ruurd: has joined #RubyOnRails
[00:02:27] nogic: has joined #RubyOnRails
[00:03:01] smathy: Most of my rspec files are made by :sav new/rspec/file and then cG
[00:03:35] nibbo: has joined #RubyOnRails
[00:04:19] ellisTAA: tubbo: thanks !!
[00:04:54] smathy: My eyes hurt from rolling them so much.
[00:05:08] StaticVoid: has left #RubyOnRails: ()
[00:05:40] jahbrewski: has joined #RubyOnRails
[00:07:38] StaticVoid: has joined #RubyOnRails
[00:08:08] ellisTAA: if i want to test app>controllers>v1>authentications_controller.rb would i create a controllers folder in my spec folder and create a file called v1_authentications_controller.rb? didn???t see anything google
[00:09:35] smathy: EllisTAA, s/app/spec/ and s/\.rb/_spec.rb/ and away you go.
[00:10:01] ellisTAA: smathy: why is spec in the app folder?
[00:10:24] TheNet: has joined #RubyOnRails
[00:10:56] smathy: Those are substitutions - s/from/to/
[00:11:09] ellisTAA: smathy: you???re to advanced for me
[00:11:19] smathy: s/ for me/
[00:12:11] smathy: I meant that a file in: app/anything/here.rb will have a corresponding spec file as: spec/anything/here_spec.rb
[00:12:57] ruurd: has joined #RubyOnRails
[00:14:04] ellisTAA: smathy: so will the result @ be spec>controllers>v1_authentications_controller.rb or spec>controllers>v1>authentications_controller.rb
[00:14:07] jahbrewski: has joined #RubyOnRails
[00:15:21] smathy: EllisTAA, neither.
[00:15:38] ellisTAA: smathy: damn ...
[00:15:50] darrencauthon: has joined #RubyOnRails
[00:15:55] smathy: EllisTAA, you're missing the _spec
[00:16:01] ellisTAA: i was just going to say that
[00:16:08] smathy: ...and I have no idea why you're separating your dirs with >s and not /s
[00:16:45] ellisTAA: smathy: is v1/authentications_controller_spec.rb right or is controllers/v1_authentications_controller_spec.rb right?
[00:19:18] smathy: ...a file in: app/anything/here.rb will have a corresponding spec file as: spec/anything/here_spec.rb
[00:19:32] tuelz1: has joined #RubyOnRails
[00:20:32] ellisTAA: smathy: gotcha .. so spec/v1/controllers/authentications_controller_spec.rb ???
[00:21:05] baweaver: has joined #RubyOnRails
[00:21:20] ellisTAA: nvm i think i got it. thanks for the help
[00:23:05] vigintas: has joined #RubyOnRails
[00:23:21] annlewis: has joined #RubyOnRails
[00:23:23] roxtrongo: has joined #RubyOnRails
[00:27:13] A124: has joined #RubyOnRails
[00:28:24] DiCablo: has joined #RubyOnRails
[00:28:43] ruurd: has joined #RubyOnRails
[00:28:52] StaticVoid: is there a way to remove all files generated using scaffold ?
[00:29:21] StaticVoid: Or do I just manually remove them all ?
[00:29:48] rhizome: StaticVoid: rails destroy scaffold WhatEver
[00:30:16] StaticVoid: rhizome: thx!
[00:30:23] chridal: has joined #RubyOnRails
[00:30:30] nertzy: has joined #RubyOnRails
[00:30:46] northfurr: has joined #RubyOnRails
[00:32:43] ur5us: has joined #RubyOnRails
[00:34:43] moeabdol: has joined #RubyOnRails
[00:35:28] hardtail: has joined #RubyOnRails
[00:35:55] jahbrewski: has joined #RubyOnRails
[00:37:14] yfeldblum: has joined #RubyOnRails
[00:38:39] roxtrongo: has joined #RubyOnRails
[00:39:16] eyck: has joined #RubyOnRails
[00:39:25] jgt1: has joined #RubyOnRails
[00:40:52] SeanLazer: has joined #RubyOnRails
[00:41:05] DLSteve: has joined #RubyOnRails
[00:42:12] chipotle: has joined #RubyOnRails
[00:42:20] djbkd: has joined #RubyOnRails
[00:43:30] ruurd: has joined #RubyOnRails
[00:43:48] mices: has joined #RubyOnRails
[00:43:55] mices: https://gist.github.com/mices/cb7e4af5c3b9eb136acd layout displays Login instead of Sign Out when user logged in
[00:44:45] yfeldblum: has joined #RubyOnRails
[00:45:09] mices: maybe it should be if devise.session
[00:45:16] chridal: has joined #RubyOnRails
[00:47:56] RegulationD: has joined #RubyOnRails
[00:48:09] lemur: has joined #RubyOnRails
[00:48:25] eyck: has joined #RubyOnRails
[00:49:46] jahbrewski: has joined #RubyOnRails
[00:50:34] bahar: has joined #RubyOnRails
[00:50:35] bahar: has joined #RubyOnRails
[00:50:53] Ropeney: mices: can you just do `if current_user` ?
[00:52:04] HalcyonicStorm: has joined #RubyOnRails
[00:52:05] ruurd: has joined #RubyOnRails
[00:52:24] mices: Ropeney: yea that works thanks
[00:52:44] mices: why didn't the other work? that's doesn't work because i'm using devise?
[00:53:05] safety_cut: has joined #RubyOnRails
[00:53:18] bahar: hi. so does anyone have any thoughts on how to handle a feature where a person can confirm they did a job. the problem i'm having is that i don't know how many people will do a job. some jobs could have 1, some could have 10. so how can 10 people all confirm they did one job.... i'm a newb, so this is hurting my head :)
[00:53:25] Ropeney: did you try p session[:user_id] ?
[00:54:46] Ropeney: mices: i think you'll find the user_id at `session["warden.user.user.key"][1][0]`
[00:55:35] Ropeney: mices: http://stackoverflow.com/questions/10338692/how-can-i-find-a-devise-user-by-its-session-id its prob a 0 not a 1 now.
[00:56:04] nya: has joined #RubyOnRails
[00:56:47] VeryBewitching: has joined #RubyOnRails
[00:56:52] mices: current_user is defined in user helpers file?
[00:57:33] tuelz1: has joined #RubyOnRails
[00:58:52] pyemkey: has joined #RubyOnRails
[00:58:52] Ropeney: mices: right here https://github.com/plataformatec/devise/blob/master/lib/devise/controllers/helpers.rb
[00:59:33] mices: Ropeney: what is "p session[:user_id]"
[00:59:56] Ropeney: mices: debug code to see what session[:user_id] contained
[01:00:24] chridal: has joined #RubyOnRails
[01:00:27] mices: my code runs i don't use debug
[01:00:48] jahbrewski: has joined #RubyOnRails
[01:00:50] Ropeney: you look at server output
[01:00:50] pontiki_: has joined #RubyOnRails
[01:00:54] tubbo: mices: if session[:user_id] is not a great way of figuring out whether the session exists
[01:00:55] Ropeney: and it would should the contents
[01:01:35] EminenceHC: has joined #RubyOnRails
[01:02:11] moeabdol: has joined #RubyOnRails
[01:02:42] mices: i think i should familiarize myself with the devise helpers in case there's anything good in there i can use
[01:02:59] mices: i don't mean current_user
[01:03:05] mices: that's rails not devise
[01:03:17] SteenJobs: has joined #RubyOnRails
[01:03:57] Pazician: has joined #RubyOnRails
[01:04:39] ruurd: has joined #RubyOnRails
[01:04:46] mices: devise has user_signed_in? helper
[01:05:01] mices: current_user
[01:05:06] mices: and user_session
[01:05:15] mices: what would i do with user_session
[01:06:58] mices: looks like i have 3 to choose from
[01:08:21] duncannz: has joined #RubyOnRails
[01:09:21] roxtrongo: has joined #RubyOnRails
[01:12:44] mices: it seems at least some of the devise helpers don't work right, i put destroy_user_session_path and it creates a get link for /users/sign_out
[01:13:01] d34th4ck3r: has joined #RubyOnRails
[01:13:16] mices: the link it should have created should have been devise/sessions#destroy no?
[01:14:05] [Butch]: has joined #RubyOnRails
[01:15:46] bruno-: has joined #RubyOnRails
[01:15:48] mices: when i click users/sign_out the browser returns uninitialized constant
[01:16:47] SteenJobs: has joined #RubyOnRails
[01:16:53] one_zero: has joined #RubyOnRails
[01:17:56] th0m_: has joined #RubyOnRails
[01:18:23] mices: when i click users/sign_out the browser returns uninitialized constant UsersController
[01:18:41] helpa: If you don't provide any code, it becomes really difficult for us to help you. Providing code to reproduce the problem increases your chances of getting great, accurate help immensely.
[01:20:32] mices: i was gonna post my users controller but i just realized i don't have one
[01:20:54] mices: i think i may have deleted it a few days ago and forgot, i was busy migrating to linux from windows
[01:21:28] mices: why would i have delete my users controller
[01:22:44] rhizome: we can hear you
[01:23:01] pontiki: are you using a version control system, such as git?
[01:23:53] Maxz_: has joined #RubyOnRails
[01:24:05] annlewis: has joined #RubyOnRails
[01:24:14] hardtail: has joined #RubyOnRails
[01:25:23] koprom: has joined #RubyOnRails
[01:25:52] mices: seemingly i thought i didn't need it since i was using devise
[01:26:53] cswelin: has joined #RubyOnRails
[01:28:41] mices: i ran `rails generate controller` but i think it's missing some actions
[01:29:31] SeanLazer: has joined #RubyOnRails
[01:29:39] nyaa: has joined #RubyOnRails
[01:30:13] harishreddy: has joined #RubyOnRails
[01:31:25] beauby: has joined #RubyOnRails
[01:32:18] bvbrandon: has joined #RubyOnRails
[01:32:35] tuelz1: has joined #RubyOnRails
[01:33:28] bvbrandon: has left #RubyOnRails: ()
[01:35:23] chridal: has joined #RubyOnRails
[01:35:43] bratsche: has joined #RubyOnRails
[01:36:00] [Butch]: has joined #RubyOnRails
[01:38:45] CanTonic: has joined #RubyOnRails
[01:39:55] wendel: has joined #RubyOnRails
[01:45:47] rhizome: right, devise does provide a fallback controller of sensible defaults
[01:45:53] rhizome: internally
[01:46:57] hardtail: has joined #RubyOnRails
[01:47:56] rhizome: man i really need to learn some stuff
[01:48:57] baweaver: has joined #RubyOnRails
[01:49:11] rakm: has joined #RubyOnRails
[01:49:57] sevenseacat: has joined #RubyOnRails
[01:50:37] djbkd: has joined #RubyOnRails
[01:51:24] sankaber: has joined #RubyOnRails
[01:52:49] pydave6367: has joined #RubyOnRails
[01:55:01] Rinzlit1: has joined #RubyOnRails
[01:55:50] jahbrewski: has joined #RubyOnRails
[01:55:57] hardtail: has joined #RubyOnRails
[01:57:39] SteenJobs: has joined #RubyOnRails
[01:58:11] chipotle: has joined #RubyOnRails
[01:58:54] Pazician: has joined #RubyOnRails
[02:01:19] mices: my "sign out" link routes to devise/sessions#destroy but fails to log out the user and renders /app/views/users/show.html.erb
[02:01:39] pyemkey: has joined #RubyOnRails
[02:01:56] x-light: has joined #RubyOnRails
[02:02:31] krzkrz: has joined #RubyOnRails
[02:03:58] mices: of course i ended up running rails generate controller users action action action
[02:04:20] mices: so i have all my actions but Sign Out link isn't signing out the user
[02:04:38] rhizome: there is a devise-specific view generator. run rails g by itself
[02:05:05] mices: i ran the devise views generater
[02:05:13] rhizome: you're killing me here
[02:06:00] Ropeney: mices, post code
[02:07:11] TheNet: has joined #RubyOnRails
[02:07:46] mices: ok but i just wanna say i ran 'rails generate devise User' then i ran 'rails generate devise:views'
[02:08:01] mices: that's what i meant when i said i ran devise views generator
[02:08:18] rhizome: more like cat .bash_history > #ruby_on_rails
[02:08:32] rhizome: well, gist anyway
[02:08:56] rhizome: mices: so you have a views/devise/ directory
[02:09:08] mices: yikes this is no good, all the controller definitions in user are blank
[02:09:34] rhizome: devise provides fallback
[02:10:09] mices: nothing in the devise gist for "fallback"
[02:10:20] mices: i mean devise github page
[02:10:24] chridal: has joined #RubyOnRails
[02:12:21] gen13211: has joined #RubyOnRails
[02:12:30] mices: rhizome: how would fallback help me get my users controller back
[02:14:28] rgrmatt: has joined #RubyOnRails
[02:15:25] rhizome: does it say class UsersController < Devise::WhateverController
[02:15:26] mices: can i rails generate scaffold and say n to all but the controller
[02:15:39] mices: that's what i have to do then
[02:15:40] rhizome: if files exist, it will ask to overwrite
[02:16:12] rhizome: type history 100
[02:16:36] mices: rhizome: not, UserController is a subclass of ApplicationController
[02:17:30] mices: i got lines 78 through 177
[02:17:42] bruno-: has joined #RubyOnRails
[02:17:59] mices: pass generate scaffold the class or model?
[02:18:44] gen13211: has left #RubyOnRails: ()
[02:19:09] gen13211: has joined #RubyOnRails
[02:19:51] DanielN: has joined #RubyOnRails
[02:20:36] twilling: has joined #RubyOnRails
[02:22:36] beauby: has joined #RubyOnRails
[02:23:26] yfeldblum: has joined #RubyOnRails
[02:23:31] roshanavand: has joined #RubyOnRails
[02:23:37] jahbrewski: has joined #RubyOnRails
[02:23:52] havenwood: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[02:24:50] annlewis: has joined #RubyOnRails
[02:26:19] drbayer: has joined #RubyOnRails
[02:27:19] bobbobbins: has joined #RubyOnRails
[02:27:57] gen13211: hi to every oe
[02:30:06] blackmesa: has joined #RubyOnRails
[02:41:45] gen1321: has joined #RubyOnRails
[02:42:17] fre: has joined #RubyOnRails
[02:42:39] gen1321: has left #RubyOnRails: ()
[02:43:02] Maxz_: has joined #RubyOnRails
[02:45:28] chridal: has joined #RubyOnRails
[02:49:42] baweaver: has joined #RubyOnRails
[02:49:50] nya: has joined #RubyOnRails
[02:50:35] xcm: has joined #RubyOnRails
[02:53:17] willardg: has joined #RubyOnRails
[02:54:49] koprom: has joined #RubyOnRails
[02:55:23] jahbrewski: has joined #RubyOnRails
[02:56:06] willardg: When is the secret_token file supposed to be generated exactly?
[02:57:57] gen13211: has joined #RubyOnRails
[02:58:33] gen13211: has left #RubyOnRails: ()
[02:59:03] atomical: has joined #RubyOnRails
[02:59:27] TheNet: has joined #RubyOnRails
[03:00:16] nya: has joined #RubyOnRails
[03:03:24] ebbflowgo: has joined #RubyOnRails
[03:04:13] mices: what changes does devise make to users controller?
[03:08:11] ebbflowgo: has joined #RubyOnRails
[03:09:55] willardg: I'm not sure how to answer that question. Devise has it's own controller that we'll never see. The user controller can inherit from the devise controller allowing you to make customizations.
[03:09:56] pwnd_nsfw: None, mices ....
[03:10:33] pwnd_nsfw: You'd have to specify the controller being used in your routes file though
[03:10:57] bratsche: has joined #RubyOnRails
[03:11:51] renews: has joined #RubyOnRails
[03:11:54] kinduff: has joined #RubyOnRails
[03:12:03] jscheel: has joined #RubyOnRails
[03:15:40] TheNet: has joined #RubyOnRails
[03:17:49] Maxz_: has left #RubyOnRails: ()
[03:18:06] maxz: has joined #RubyOnRails
[03:18:15] drbayer: has joined #RubyOnRails
[03:20:23] chridal: has joined #RubyOnRails
[03:22:23] mordocai: has joined #RubyOnRails
[03:24:54] jahbrewski: has joined #RubyOnRails
[03:25:36] annlewis: has joined #RubyOnRails
[03:27:41] blackhuey: has joined #RubyOnRails
[03:31:36] A124: has joined #RubyOnRails
[03:32:53] tuelz1: has joined #RubyOnRails
[03:32:53] blackmesa: has joined #RubyOnRails
[03:34:15] Guest53: has joined #RubyOnRails
[03:36:36] quazimodo: can we put value=true or value=false on form inputs
[03:36:41] quazimodo: or must we use value=1/0
[03:36:51] quazimodo: or "true", "false"
[03:39:32] DLSteve: has joined #RubyOnRails
[03:39:58] inoter: has joined #RubyOnRails
[03:41:36] Aeyrix: Weird, Sidekiq is exiting after a particular job.
[03:41:39] youngbaks: has joined #RubyOnRails
[03:43:25] adam12: quazimodo: ActiveRecord will do some coercion into boolean form
[03:43:41] adam12: quazimodo: provided you're talking to an AR model and the field is boolean.
[03:45:22] jahbrewski: has joined #RubyOnRails
[03:46:35] Aeyrix: nvm i'm styoud
[03:46:37] Aeyrix: stupid even
[03:50:31] baweaver: has joined #RubyOnRails
[03:50:58] pydave6367: has joined #RubyOnRails
[03:51:21] quazimodo: adam12: it's gotta be a string in the form and params though
[03:54:23] d5sx43: has joined #RubyOnRails
[03:57:47] d5sx43: has joined #RubyOnRails
[03:58:52] The_Phoenix: has joined #RubyOnRails
[03:59:06] Peteykun: has joined #RubyOnRails
[04:04:15] krzkrz: has joined #RubyOnRails
[04:05:30] jahbrewski: has joined #RubyOnRails
[04:06:18] RegulationD: has joined #RubyOnRails
[04:06:58] wendel: has joined #RubyOnRails
[04:10:07] braincrash: has joined #RubyOnRails
[04:11:49] wendel_: has joined #RubyOnRails
[04:13:00] nya: has joined #RubyOnRails
[04:15:05] baweaver: has joined #RubyOnRails
[04:16:03] jahbrewski: has joined #RubyOnRails
[04:19:40] nogic: has joined #RubyOnRails
[04:24:35] kp666: has joined #RubyOnRails
[04:24:35] krzkrz: has joined #RubyOnRails
[04:24:44] Contigi777: has joined #RubyOnRails
[04:26:30] annlewis: has joined #RubyOnRails
[04:28:39] luckymeerza: has joined #RubyOnRails
[04:30:56] jahbrewski: has joined #RubyOnRails
[04:33:42] blackmesa: has joined #RubyOnRails
[04:41:08] krzkrzkrz: has joined #RubyOnRails
[04:41:22] ewilliam: https://www.irccloud.com/pastebin/lPPZZhU8/
[04:41:44] ewilliam: how does that happen?
[04:41:50] ewilliam: params.merge not working
[04:42:13] foomanchu: has joined #RubyOnRails
[04:43:19] youngbaks: has joined #RubyOnRails
[04:43:36] sevenseacat: looks like its working fine?
[04:43:39] sevenseacat: whats the problem?
[04:43:56] sadaf2606: has joined #RubyOnRails
[04:43:56] sevenseacat: merge is not an in-place action
[04:44:08] djbkd: has joined #RubyOnRails
[04:44:29] mloy: has joined #RubyOnRails
[04:46:06] srinidhi: has joined #RubyOnRails
[04:46:23] Ropeney: yeah whats wrong with it?
[04:46:54] infamos: has joined #RubyOnRails
[04:48:26] baweaver: has joined #RubyOnRails
[04:49:21] ewilliam: ah gotcha. returns a new hash, instead of modifying it, duh
[04:49:37] Ropeney: ewilliam: merge!
[04:49:50] lemur: has joined #RubyOnRails
[04:50:15] wendel: has joined #RubyOnRails
[04:50:24] ewilliam: Ropeney: thanks
[04:51:57] ewilliam: ah that doesnt work. ill just do it inside the new call
[04:54:13] sevenseacat: because every time you call address_form_params you get back a new hash
[04:54:38] chridal: has joined #RubyOnRails
[04:55:46] dionysus69: has joined #RubyOnRails
[05:01:09] nyaa: has joined #RubyOnRails
[05:01:54] pawnbox: has joined #RubyOnRails
[05:05:26] chridal: has joined #RubyOnRails
[05:06:20] trosborn: has joined #RubyOnRails
[05:08:02] freezevee: has joined #RubyOnRails
[05:09:27] shinenelson: has joined #RubyOnRails
[05:10:02] dopie: has joined #RubyOnRails
[05:12:03] nya: has joined #RubyOnRails
[05:13:53] ewilliam: yes, got it. thanks sevenseacat
[05:17:54] pawnbox: has joined #RubyOnRails
[05:23:09] roxtrongo: has joined #RubyOnRails
[05:27:08] annlewis: has joined #RubyOnRails
[05:29:57] oded_: has joined #RubyOnRails
[05:30:54] baweaver: has joined #RubyOnRails
[05:31:22] peppers: has joined #RubyOnRails
[05:34:28] blackmesa: has joined #RubyOnRails
[05:34:30] nya: has joined #RubyOnRails
[05:35:07] simplyianm: has joined #RubyOnRails
[05:35:39] simplyia_: has joined #RubyOnRails
[05:38:04] x-light: has joined #RubyOnRails
[05:38:06] neanderslob_: has joined #RubyOnRails
[05:42:45] User458764: has joined #RubyOnRails
[05:44:30] srinidhi: has joined #RubyOnRails
[05:48:23] wendel: has joined #RubyOnRails
[05:49:20] youngbaks: has joined #RubyOnRails
[05:52:17] krzkrzkrz: has joined #RubyOnRails
[05:53:04] pawnbox: has joined #RubyOnRails
[05:53:09] Peteykun: has joined #RubyOnRails
[05:53:50] infamos: has joined #RubyOnRails
[05:58:35] ur5us: has joined #RubyOnRails
[05:59:51] arup_r: has joined #RubyOnRails
[06:02:45] d34th4ck3r: has joined #RubyOnRails
[06:05:01] pawnbox_: has joined #RubyOnRails
[06:05:22] wendel: has joined #RubyOnRails
[06:06:10] chridal: has joined #RubyOnRails
[06:08:56] johnflux: has joined #RubyOnRails
[06:08:56] johnflux: has joined #RubyOnRails
[06:11:43] youngbaks: has joined #RubyOnRails
[06:12:42] rvanlieshout: happy friday folks!
[06:12:55] sevenseacat: happy friday rvanlieshout :)
[06:14:27] chrissonar: has joined #RubyOnRails
[06:14:43] wendel: has joined #RubyOnRails
[06:15:06] sadaf2605: has joined #RubyOnRails
[06:17:18] chridal: has joined #RubyOnRails
[06:17:44] jahbrewski: has joined #RubyOnRails
[06:18:03] atmosx: happy friday!
[06:18:07] atmosx: ACTION off to work
[06:18:12] dhjondoh: has joined #RubyOnRails
[06:18:31] rvanlieshout: sevenseacat: anything planned for this weekend?
[06:18:50] sevenseacat: relaxing. reading. playing video games. the usual :) you
[06:19:08] bruno-: has joined #RubyOnRails
[06:19:46] rvanlieshout: there is this village quiz thing..
[06:19:50] rvanlieshout: it's weird and awesome
[06:19:57] rvanlieshout: you subscribe a team (120 teams did)
[06:20:05] rvanlieshout: fetch the boocklet with questions at 18:30
[06:20:12] rvanlieshout: and bring it back with answers at 23:30
[06:20:14] rvanlieshout: all resources allowed
[06:20:23] mozzarella: "This account is scheduled to be deleted 27 secs ago."
[06:21:57] rvanlieshout: so we're in a team with around 20 people
[06:22:08] nya: has joined #RubyOnRails
[06:22:20] Axsuul: has joined #RubyOnRails
[06:22:26] sevenseacat: they would have to be some really weird questions that aren't easily googleable or something
[06:22:45] rvanlieshout: yeah. so expect a buch of questions about the village's history itself
[06:22:48] RegulationD: has joined #RubyOnRails
[06:22:49] rvanlieshout: at least not that easy to google
[06:23:07] rvanlieshout: and there are some things to be done on site somewhere. so you'll have to send a team member
[06:23:08] jahbrewski: has joined #RubyOnRails
[06:23:15] rvanlieshout: based on some criptic description
[06:23:21] sevenseacat: sounds like fun though :)
[06:23:36] x-light: has joined #RubyOnRails
[06:23:47] rvanlieshout: yeah. the whole village stops at that time
[06:24:12] roshanavand: has joined #RubyOnRails
[06:24:18] rvanlieshout: they have been spreading hints.. really annoying.. article in local newspaper where 8 words were written with a captial L where they shouldn't had to be
[06:24:24] rvanlieshout: so what does that mean?
[06:27:53] annlewis: has joined #RubyOnRails
[06:30:11] EminenceHC: has joined #RubyOnRails
[06:30:56] arup_r: atmosx: o/
[06:32:02] baweaver: has joined #RubyOnRails
[06:32:31] atmosx: hello arup_r how are you?
[06:33:54] krzkrzkrz: has joined #RubyOnRails
[06:35:13] blackmesa: has joined #RubyOnRails
[06:35:29] startupality: has joined #RubyOnRails
[06:40:27] chridal: has joined #RubyOnRails
[06:41:48] tagrudev: has joined #RubyOnRails
[06:46:16] sarink: has joined #RubyOnRails
[06:46:29] krzkrzkrz: has joined #RubyOnRails
[06:51:46] fedexo: has joined #RubyOnRails
[06:52:06] njero: has joined #RubyOnRails
[06:52:40] ruurd: has joined #RubyOnRails
[06:53:32] User458764: has joined #RubyOnRails
[06:55:41] krzkrzkrz: has joined #RubyOnRails
[06:56:54] roshanavand: has joined #RubyOnRails
[06:57:55] axsuul_: has joined #RubyOnRails
[07:02:15] dikaio: has joined #RubyOnRails
[07:02:56] yfeldblum: has joined #RubyOnRails
[07:07:30] pyemkey: has joined #RubyOnRails
[07:08:15] norc: has joined #RubyOnRails
[07:09:43] Dreamer3: has joined #RubyOnRails
[07:10:57] oscarb92: has joined #RubyOnRails
[07:12:26] x-light: has joined #RubyOnRails
[07:13:15] nya: has joined #RubyOnRails
[07:15:24] zmyrgel: has joined #RubyOnRails
[07:15:25] chridal: has joined #RubyOnRails
[07:15:55] zmyrgel: hi, I'm trying to migrate one rails app from rhel6 to rhel7 but I can't seem to get the rails app to run
[07:15:57] oscarb92: hello, I'm trying to do a raw query with ActiveRecord::Base.connection.execute(query), but it returns a fixnum with the number of rows instead of the rows themselves
[07:16:21] zmyrgel: I'm trying to use phusion passenger with apache 2.4 but all I get is the rhel test page
[07:16:26] sevenseacat: oscarb92: that might be normal, depending on the query
[07:16:50] rvanlieshout: zmyrgel: passenger and apache all support rhel 7
[07:17:01] kies^: has joined #RubyOnRails
[07:17:22] zmyrgel: rvanlieshout: rails 4.2 app
[07:17:41] rvanlieshout: document root correct?
[07:17:43] rvanlieshout: passenger loaded?
[07:18:08] bmalum: has joined #RubyOnRails
[07:18:09] zmyrgel: yeah, the access log shows / path gives 403 error but I have the 'require all granted' line for the directory
[07:18:22] rvanlieshout: and how did you check passenger is loaded?
[07:18:39] zmyrgel: apache error log shows passenger info
[07:18:47] oscarb92: sevenseacat: I've tried several queries and it always returns the number of rows
[07:18:50] bitwise_: what does passenger actually do?
[07:19:33] sevenseacat: oscarb92: thats doesnt help us in telling you if its normal or not
[07:19:38] sevenseacat: oscarb92: what queries are you running?
[07:19:54] jas02: has joined #RubyOnRails
[07:20:13] oscarb92: sevenseacat: "select * from any_table" returns the number of rows
[07:20:25] rvanlieshout: oscarb92: it should not return an array of results
[07:20:36] rvanlieshout: that would consume way to much memory. you'll get a stream to process
[07:20:51] rvanlieshout: but why would you want to run select * from something using such method?
[07:20:58] sevenseacat: you definitely dont need to be running a query like that with connection.eecute
[07:20:59] oscarb92: sevenseacat: well, it returns a fixnum, which is the number of rows
[07:21:15] rvanlieshout: oscarb92: check the documentation of the gem of the db adapter you're using
[07:21:23] oscarb92: sevenseacat: Yes, that's an example
[07:21:31] sevenseacat: I didn't ask you for an example
[07:21:40] sevenseacat: I asked you what queries you were running
[07:22:00] execute: (I'm kinda regretting my username now with these random false-positive highlights i'm getting :-) )
[07:22:29] oscarb92: sevenseacat: https://gist.github.com/OscarBastardo/35377293c82e20d6ca68#file-query-sql
[07:22:39] sevenseacat: it also depends on your adapter, the type of result you get back. for example, in postgres you get a PG::Result object
[07:22:57] rvanlieshout: that's some bad sql
[07:23:01] oscarb92: sevenseacat: sql_server adapter
[07:23:10] sevenseacat: yeah who fucking knows with that one
[07:23:19] rvanlieshout: oscarb92: and where in the docs would you expect the sql server adapter to return something other then an integer?
[07:23:21] sevenseacat: go ask whoever wrote the adapter
[07:24:43] oscarb92: rvalienshout: It works in the db management studio :/, is it adaptable to ActiveRecord query?
[07:25:19] rvanlieshout: oscarb92: the db management studio is likely to process that stream
[07:25:25] rvanlieshout: as you should
[07:26:06] oscarb92: rvanlieshout: it returns a fixnum, not a stream
[07:26:24] sevenseacat: i doubt it a lot
[07:26:31] rvanlieshout: and the instance of the connection might have an open stream ready for you to use
[07:26:37] rvanlieshout: but did you even check the documentation for that?
[07:27:10] zmyrgel: here's some log output to http://pastebin.com/E75z5p3i
[07:27:39] freezevee: has joined #RubyOnRails
[07:27:49] arup_r: has joined #RubyOnRails
[07:28:41] annlewis: has joined #RubyOnRails
[07:29:00] ruurd: has joined #RubyOnRails
[07:29:33] oscarb92: sevenseacat: what?
[07:30:18] oscarb92: rvanlieshout: can't seem to find anything related to that https://github.com/rails-sqlserver/activerecord-sqlserver-adapter
[07:32:32] bmalum: has joined #RubyOnRails
[07:32:44] baweaver: has joined #RubyOnRails
[07:32:52] rvanlieshout: so then you're stuck to the doc for the adapter you're using (as written in this documentation) or to the normal activerecord methods
[07:33:06] rvanlieshout: available to perform such tasks.. years pass by before i need a connection.execute
[07:33:11] cac: has joined #RubyOnRails
[07:33:13] moei: has joined #RubyOnRails
[07:35:09] sevenseacat: I think I've only ever used it once
[07:36:04] blackmesa: has joined #RubyOnRails
[07:37:53] oscarb92: Ok, I should adapt the sql to the activerecord then
[07:38:08] rvanlieshout: and that was in a migration, right? sevenseacat
[07:38:36] Pazician: has joined #RubyOnRails
[07:38:40] sevenseacat: rvanlieshout: no actually - it was a big stupid long query that ran on a schedule as part of a background job
[07:39:27] sevenseacat: buggy as hell too
[07:44:10] vigintas: has joined #RubyOnRails
[07:44:27] kalusn: has joined #RubyOnRails
[07:44:34] toomus: has joined #RubyOnRails
[07:45:32] youngbaks: has joined #RubyOnRails
[07:47:21] toomus: I have before_save callback, where I check something, and depending on the value record is saved or not
[07:48:48] toomus: Now I need another callback which be executed everytime, independetly from before_save callback
[07:49:15] rvanlieshout: set that callback before this one?
[07:49:15] srinidhi: has joined #RubyOnRails
[07:49:19] rvanlieshout: you can have multiple before save callbacks
[07:50:23] Pazician_: has joined #RubyOnRails
[07:51:34] chridal: has joined #RubyOnRails
[07:52:22] zpe: has joined #RubyOnRails
[07:52:38] toomus: rvanlieshout: This another callback should be called everytime after befor_save
[07:52:53] Coldblackice: has joined #RubyOnRails
[07:54:42] cac: has joined #RubyOnRails
[07:55:21] x-light: has joined #RubyOnRails
[07:58:18] norc: I got a question about this error: http://pastie.org/10533597
[07:58:36] norc: The error stems from the join table missing in the database, but the error message makes absolutely no sense to me.
[07:59:12] norc: Im just trying to understand the error message, and whether it could have helped me deduce the problem by itself
[07:59:52] wethu: has joined #RubyOnRails
[08:01:03] norc: It really is that "DESC" that bugs the hell out of me.
[08:01:07] Bloomer: has joined #RubyOnRails
[08:01:08] norc: Oh it is not.
[08:01:22] norc: Silly me. I was just thinking about DESC as descending, not oracles DESCRIBE. :)
[08:02:00] DoubleMalt: has joined #RubyOnRails
[08:02:07] krzkrzkrz: has joined #RubyOnRails
[08:06:32] yashinbasement: has joined #RubyOnRails
[08:06:53] relix: has joined #RubyOnRails
[08:08:26] teclator: has joined #RubyOnRails
[08:10:28] solars: has joined #RubyOnRails
[08:10:43] nyaa: has joined #RubyOnRails
[08:13:53] craysiii: has joined #RubyOnRails
[08:16:39] darutoko: has joined #RubyOnRails
[08:18:04] nya: has joined #RubyOnRails
[08:18:41] Sheperson: has joined #RubyOnRails
[08:19:13] marr: has joined #RubyOnRails
[08:19:39] wethu: has joined #RubyOnRails
[08:20:34] sudiptamondal: has joined #RubyOnRails
[08:22:36] trosborn: has joined #RubyOnRails
[08:27:39] yashinbasement: has left #RubyOnRails: ("Leaving")
[08:27:47] yashinbasement: has joined #RubyOnRails
[08:28:21] zmyrgel: ok, I've cleared my manual passenger installation and switched to use passenger rpm's
[08:28:37] pwnd_nsfw: has joined #RubyOnRails
[08:28:46] zmyrgel: process list shows passenger is running but passsenger-status shows that its not serving any apps
[08:29:03] arup_r: Will it be a good idea to keep these gems inside the development group ? ( https://github.com/capistrano/rails#installation )
[08:29:23] ELCALOR_: has left #RubyOnRails: ()
[08:29:26] annlewis: has joined #RubyOnRails
[08:30:18] ELCALOR: has joined #RubyOnRails
[08:30:42] zmyrgel: I still get 403 when trying to access the rails app vhost
[08:32:02] Polysics: has joined #RubyOnRails
[08:32:15] Polysics: I hate inherited_resources.
[08:32:38] Polysics: I have a spec about a controller where I am redefining `create` and the override gets ignored in the spec
[08:32:54] Polysics: ie. even adding non-existent methods to the create body does nothing
[08:32:59] voker57: has joined #RubyOnRails
[08:33:08] Polysics: I tried killing spring and running rspec manually, no help
[08:33:21] Polysics: POSTing to the action via browser works, as expected
[08:33:39] Polysics: anything else I might have overlooked? this is silly
[08:33:41] dionysus69: has joined #RubyOnRails
[08:34:16] artto: has joined #RubyOnRails
[08:34:48] dideler: has joined #RubyOnRails
[08:35:57] freezevee1: has joined #RubyOnRails
[08:36:33] ljhade24: has joined #RubyOnRails
[08:36:47] blackmesa: has joined #RubyOnRails
[08:36:48] Polysics: renaming the controller DOES break the spec, so somehow it is ignoring my method override
[08:37:29] jgt1: has joined #RubyOnRails
[08:37:38] sevenseacat: polysics: code?
[08:38:01] Polysics: gisting it up
[08:38:18] build22: has joined #RubyOnRails
[08:38:22] dionysus69: is it just a naming difference between web service and an api?
[08:38:31] krzkrzkrz: has joined #RubyOnRails
[08:39:10] Polysics: sevenseacat: https://gist.github.com/polysics/ecdf42b4ac8bc3857f92
[08:39:42] sevenseacat: so whats the problem with it?
[08:39:46] Polysics: note that permitted_params IS honored
[08:40:11] sadaf2605: has joined #RubyOnRails
[08:40:34] Polysics: I added the spec failure
[08:41:02] brendan-: has joined #RubyOnRails
[08:41:06] Polysics: but the spec failure is just a symptom, if I add "adadssdsds" as the only create body it still fails with that false/nil
[08:41:16] Polysics: indicating it is running the "stock" create action, I'd say
[08:41:37] sevenseacat: thats what create! does
[08:42:14] Polysics: yup, but taking OUT create! (or really gutting the method) keeps failing the same way
[08:43:07] sevenseacat: well how are you assigning assigns[:text_message] without the `create!` ?
[08:43:31] Polysics: that's the weird thing here :)
[08:43:47] roshanavand: has joined #RubyOnRails
[08:43:54] sadaf2605: has joined #RubyOnRails
[08:43:56] sevenseacat: not really - you havent shown that failure, so
[08:44:49] lipoqil: has joined #RubyOnRails
[08:44:55] Polysics: edited with the current code and failure
[08:44:57] sevenseacat: ah, thats `resource`, i see
[08:45:07] sevenseacat: so you're modifying `resource`, but not saving the changes
[08:45:22] sevenseacat: (this is all just from reading the readme btw)
[08:45:23] Polysics: what's weird here is not that the reseource is saved or not, it's that the `create` method is not even ran
[08:45:32] sevenseacat: how is it not?
[08:45:42] Polysics: this_method_does_not_exist_idk_lol
[08:45:50] Polysics: still fails with the false/nil :D
[08:45:58] Polysics: (also sorry for the multiline paste)
[08:46:54] JDeen: has joined #RubyOnRails
[08:46:57] Polysics: I tried killing spring, heck, I tried restarting the box
[08:47:25] sevenseacat: probably because it doesnt call create!
[08:48:22] Polysics: and that is ok with me, but it's a non-existing method, it should except out
[08:48:33] Polysics: adding output, anything, does not run
[08:48:46] Polysics: first time I see this :d
[08:48:52] sevenseacat: you have no idea how much metaprogramming is in this gem - i wouldn't make those kind of assumptions
[08:49:13] Polysics: I have another controller that is similar, putting something in the create body does run (or error)
[08:49:18] sevenseacat: have you tried calling create! yet?
[08:49:35] kalusn: has joined #RubyOnRails
[08:49:42] AzaToth: has joined #RubyOnRails
[08:49:47] Polysics: you mean overriding create! instead of create?
[08:49:51] sevenseacat: great, so how is this 'similar' controller different?
[08:49:56] Polysics: yeah, the original version calls "create!"
[08:49:56] sevenseacat: no, i mean calling create! from inside create
[08:50:13] sevenseacat: colour me unsurprised.
[08:50:41] Polysics: question is "how does it not error with a non-existing method?"
[08:50:51] sevenseacat: because it doesnt call it
[08:51:32] sadaf2605: has joined #RubyOnRails
[08:51:36] Polysics: then what calls create! inside create, if it does not call non_exist inside create? I don't think it's selectively running code, that's TOO MUCH introspection :)
[08:51:49] annlewis: has joined #RubyOnRails
[08:52:04] sevenseacat: by the sounds of it, inherited_resources will ignore your action if your action doesnt call its own action, by metaprogramming trickery
[08:52:11] JDeen: I am interested in making an api with Grape. Grape seems to be fine with rials? Or is it better to handle it with kind of 'namespaced routes' or any other better way?
[08:52:17] sevenseacat: its really, really simple to test if this is the case
[08:52:19] Polysics: I do call create!
[08:52:26] Polysics: and the "error" still gets ignored
[08:52:41] srinidhi: has joined #RubyOnRails
[08:52:49] Polysics: https://gist.github.com/polysics/e2befe6579069307ceaf
[08:52:52] Polysics: actual create body
[08:52:56] Polysics: (not the test one in the gist)
[08:53:00] Polysics: failure is the same
[08:53:10] bahar: has joined #RubyOnRails
[08:53:15] sevenseacat: ok, so now thats nothing to do with the non-existent method
[08:53:23] sevenseacat: two different issues there
[08:53:39] Polysics: yeah, that was more of a "show that the create override is not actually running"
[08:53:49] sevenseacat: its not running when you don't call create!, thats correct.
[08:54:24] sevenseacat: can you please please please just try calling create! in the same action as the non-existent method to verify
[08:55:27] Polysics: just adding "asdasd" on top of that method body I just showed you?
[08:55:51] sevenseacat: ...by calling a non-existent method in the same action that calls create!
[08:55:56] sevenseacat: this is like the fifth time I've asked
[08:56:13] Polysics: I did. Still false/nil failure
[08:56:55] Polysics: https://gist.github.com/polysics/f32ac95888f2cc6f835e
[08:56:56] cac: has joined #RubyOnRails
[08:57:02] Polysics: spec is the same as in the original gist
[08:57:06] Polysics: as the spec is correct :)
[08:57:24] sevenseacat: that was far too hard
[08:57:34] sevenseacat: so now we go back to the inherited resources readme
[08:58:08] sevenseacat: can you try making all your changes inside the create! block
[08:58:24] sevenseacat: as thats what all the examples of overwriting do
[08:59:19] kimegede: has joined #RubyOnRails
[08:59:53] arup_r: zmyrgel: I yesterday installed passenger using https://www.phusionpassenger.com/library/install/nginx/install/oss/trusty/
[09:00:13] arup_r: in my Linode Ubuntu server and also nginx.. till now all is well
[09:00:22] A124: has joined #RubyOnRails
[09:00:31] nfk|laptop: has joined #RubyOnRails
[09:00:49] arup_r: going to add capistrano.. dunno how it will go.. working on it.. You may check the link I gave you if it helpful to yiu
[09:00:55] zmyrgel: arup_r: well I have rhel7 server with apache 2.4 so I need to get it running there
[09:01:06] Axsuul: has joined #RubyOnRails
[09:01:08] arup_r: in Linode ?
[09:01:41] zmyrgel: arup_r: in our prod env
[09:01:54] JDeen: Guys, hi, advice on building an api on an existing Rails applicatio is highly appreciated. One option I see is to use grape. Any other suggstions? I am interseted in using JWT to issue tokens upon sign-in if that matters.
[09:02:05] arup_r: ok Passenger doc has guide for each server .. you might have a look at it. I choose Ubuntu because I will be running my app there
[09:02:30] teclator: has joined #RubyOnRails
[09:02:34] arup_r: zmyrgel: I got it, but where you hosted the server.. AWS, DigitalOcean, Linode etc ?
[09:02:38] mikecmpbll: has joined #RubyOnRails
[09:02:39] zmyrgel: arup_r: yeah, I've looked the docs, converted my previous manual passenger installation to use provided rhel rpms
[09:02:40] Polysics: sevenseacat: https://gist.github.com/polysics/95a8336214680742b493
[09:02:45] Polysics: same failure, it's something else
[09:02:45] Doddlin: has joined #RubyOnRails
[09:03:01] norc: jdeen: Is there a reason you want this to be on the same rails application?
[09:03:03] zmyrgel: arup_r: colocation datacenter which we manage
[09:03:23] ljhade24: has left #RubyOnRails: ()
[09:03:48] Doddlin: could someone please assist me with the simplest form ever that I just can???t seem to get to work? (A)
[09:04:02] zmyrgel: seems that passenger is running but it just won't register the apps existance
[09:04:33] arup_r: ok, I used Nginx + passenger ..
[09:04:42] zmyrgel: and apache looks into public dir and doesn't see index page and tries to forward to default location and shows the test page
[09:05:04] arup_r: I was having huge trouble.. but finally I got it working.. By asking lot of people around :)
[09:05:08] Doddlin: https://gist.github.com/anonymous/4477b3832c0ec17b1ead
[09:05:16] FailBit: GOOD MORNING
[09:05:35] FailBit: I just woke up a minute ago
[09:05:35] Doddlin: GOOD MORNING
[09:05:46] FailBit: it's 04:05
[09:05:48] DEA7TH: has joined #RubyOnRails
[09:05:51] JDeen: norc: My concerns is Devise auth. I am using it to check the users and to give a token to identify the kind of session. Other than that I thought of even using a Sintra app for the pourpose when I found Grape.
[09:05:51] Polysics: sevenseacat: I am almost sure it's something with that resource loading, I will look through that
[09:05:52] FailBit: I'm drenched in sweat
[09:06:03] Doddlin: Regarding my Gist, I have tried current_user.id as well but it says the same :S
[09:06:06] Polysics: thanks for now
[09:06:11] JDeen: norc: May be I can auth the user without devise, never tried
[09:06:18] SamGerber: has joined #RubyOnRails
[09:07:42] sevenseacat: asdsdfsdfsdfsdfsdfs there was none of the nonexisting method in that code again
[09:07:47] FailBit: Doddlin: new_tankowner_tank_path(:tankowner_id => params[:id] ) ::: new_tankowner_tank_path(params[:id])
[09:07:59] sevenseacat: I don't know if polysics was deliberately miscontruing everything I said or what
[09:07:59] jsrn_: has joined #RubyOnRails
[09:08:06] sevenseacat: either way, sigh
[09:08:20] Doddlin: FailBit, trying, thanks! :)
[09:08:44] sevenseacat: ACTION goes back to playing with web animations
[09:08:53] Doddlin: what???s with those ::: ?
[09:09:05] arup_r: FailBit: That shouldn't be the issue
[09:09:10] FailBit: that just means "change this line to"
[09:09:15] Doddlin: ahaaa! haha
[09:09:39] FailBit: arup_r: I think it is, because the path helpers take a hash as their _final_ option
[09:09:43] arup_r: Doddlin: Show your `params` from the log
[09:10:03] arup_r: FailBit: :tankowner_id => params[:id] is a Hash syntax
[09:10:18] Doddlin: arup_r, it says Parameters: { ???id??? => ???1??? }
[09:10:27] Doddlin: and gives the same error
[09:10:49] arup_r: Doddlin: show the full log...
[09:11:00] norc: Doddlin: Just to be sure, you are running your server in development mode right?
[09:11:11] Doddlin: norc, yes!
[09:11:14] norc: But yeah. Full log + trace + everything.
[09:12:18] arup_r: Doddlin: and also the rake routes to show us what url the path new_tankowner_tank_path maps to
[09:12:27] Doddlin: sure, pls hold! :)
[09:13:38] arup_r: FailBit: The error "no implicit conversion of Symbol into Integer" when you will be trying to access an Array element using something otherthan integer
[09:14:03] arup_r: so if you have a = [1] and a[:a] # no implicit conversion of Symbol into Integer
[09:14:18] arup_r: so if you have a = [1] and a['a'] # no implicit conversion of String into Integer
[09:14:26] arup_r: like that ....
[09:14:30] Doddlin: like this? https://gist.github.com/anonymous/214612439a8e1f326295
[09:14:31] arup_r: try in IRB :
[09:14:43] FailBit: I'm aware of that
[09:15:22] andronati: has joined #RubyOnRails
[09:15:32] Doddlin: I also thought that it was linked to some kind of array so I tried current_user[0].id, then it said .id is not avail on nilObject
[09:15:47] arup_r: that is worse :)
[09:15:59] Cervajz: has joined #RubyOnRails
[09:16:02] sadaf2605: has joined #RubyOnRails
[09:16:05] Doddlin: haha yes???
[09:16:26] FailBit: it's the form_for choking
[09:16:32] goldbug: has joined #RubyOnRails
[09:16:32] FailBit: not the path helper itself
[09:16:39] Doddlin: however, if I try to access sign_in it states that I am already logged in in the log
[09:16:52] FailBit: I wonder if it wants form_for([@tankowner_tank, new_tankowner_tank_path(params[:id])])
[09:17:38] Doddlin: that yields: undefined method `model_name' for String:Class
[09:17:45] arup_r: Doddlin: show the url mapping of the path using rake routes
[09:17:55] FailBit: form_for([@tankowner, @tankowner_tank])
[09:17:59] FailBit: arup_r: he already has
[09:18:02] jahbrewski: has joined #RubyOnRails
[09:18:15] arup_r: ok.. :) small screen
[09:18:43] FailBit: I happen to mostly know what I'm getting into when I answer stuff
[09:19:11] Doddlin: FailBit, atleast new error: undefined method ???tanks_path??? for Class...
[09:19:15] sadaf2605: has joined #RubyOnRails
[09:19:18] goldbug: Dumb Question O'Clock. In a console, if I type I18nData.languages("DE"), I get a result like this: {"AA"="Afar", "AB"=>"Abchasisch", "AF"=>"Afrikaans", "AK"=>"Akan" ... } and so on. So how do I retrieve a string from that with the language name, i.e. "Abchasisch"?
[09:19:27] vigintas: has joined #RubyOnRails
[09:19:32] arup_r: Doddlin: you are using form_for by giving it a GET path ? https://gist.github.com/anonymous/214612439a8e1f326295#file-routes-txt-L29
[09:19:55] FailBit: arup_r: I just addressed this
[09:20:31] FailBit: I've had him/her change it to the proper nested form_for syntax
[09:20:41] bruno-: has joined #RubyOnRails
[09:21:00] User458764: has joined #RubyOnRails
[09:21:00] Cervajz_: has joined #RubyOnRails
[09:21:00] mark2: has joined #RubyOnRails
[09:21:09] blackmesa: has joined #RubyOnRails
[09:21:10] arup_r: Doddlin: did you get where you are wrong? I am then going back to my Cap thing
[09:21:21] Doddlin: arup_r, not really
[09:21:33] Doddlin: it says tanks_path is undefined
[09:22:48] Doddlin: but hang on??? I???m being stupid
[09:22:51] sadaf2605: has joined #RubyOnRails
[09:22:51] arup_r: goldbug: Use Hash#key method
[09:23:09] Axsuul: has joined #RubyOnRails
[09:23:14] Cervajz__: has joined #RubyOnRails
[09:23:21] goldbug: arup_r: What's the syntax? I'm very confused about hashes.
[09:23:43] dANO-: has joined #RubyOnRails
[09:23:48] Peg-leg: has joined #RubyOnRails
[09:23:49] goldbug: I had thought something like I18nData.languages["DE"]["AB"] would work but that returns 'nil'.
[09:24:06] funkylaundry: has joined #RubyOnRails
[09:24:46] arup_r: http://ruby-doc.org/core-2.2.2/Hash.html#method-i-key
[09:25:38] arup_r: goldbug: wait. you want the value "Abchasisch" by the key "AB" ?
[09:25:44] arup_r: or the reverse ?
[09:26:25] goldbug: arup_r: Yep, the value Abchasisch by the key AB (and in the DE language).
[09:26:34] Bloomer: has joined #RubyOnRails
[09:27:12] arup_r: then yu shouldn't get `nil` as per your attempt :/
[09:28:12] mooru: has joined #RubyOnRails
[09:28:15] goldbug: Ah, so my syntax was right but. . . there's something else wrong?
[09:29:15] sebstrax: has joined #RubyOnRails
[09:30:31] vigintas: has joined #RubyOnRails
[09:30:40] goldbug: Interestingly, if I type in I18nData.languages["DE"] I get "German" back as a result.
[09:31:33] goldbug: I18nData.languages("DE")["DE"] gives me "Deutsch", which is what I was looking for.
[09:31:55] goldbug: Not sure I understand why!
[09:33:16] rvanlieshout: becausae the language in germany in your current locale is German?
[09:34:30] sadaf2605: has joined #RubyOnRails
[09:34:36] goldbug: Yes - I understand the result, just not the syntax.
[09:34:53] goldbug: What's the difference between ("DE") and ["DE"]?
[09:35:03] rvanlieshout: ("DE") is an argument
[09:35:10] rvanlieshout: to a method called languages
[09:35:19] goldbug: And ["DE"] is a key?
[09:35:25] baweaver: has joined #RubyOnRails
[09:35:28] rvanlieshout: of the hash returned by that method
[09:35:35] rvanlieshout: check the output without the ["DE"]
[09:35:52] goldbug: Yes, it's a set of keys and values.
[09:36:23] goldbug: I guess I am surprised that they are using an argument rather than a hash for the ("DE") bit.
[09:36:56] Balllkenende: has joined #RubyOnRails
[09:37:04] rvanlieshout: they've defined the languages method to return a hash for a given language
[09:38:13] goldbug: But why not just hash the hash, if you see what I mean?
[09:39:09] rvanlieshout: i agree with that languages is a strange method name
[09:39:15] rvanlieshout: language would be better imo
[09:42:12] goldbug: It's inconsistent too. The other main methods are called countries, country_code and language_code.
[09:43:09] rvanlieshout: that's not incosistent
[09:43:14] rvanlieshout: countries and languages
[09:43:18] afroboy: has joined #RubyOnRails
[09:44:14] goldbug: I suppose there is only one value per country_code and language_code.
[09:44:23] goldbug: Because they are international standard codes.
[09:45:05] chridal: has joined #RubyOnRails
[09:45:12] user083: has joined #RubyOnRails
[09:50:48] trosborn: has joined #RubyOnRails
[09:52:24] Ergo: has joined #RubyOnRails
[09:56:35] User458764: has joined #RubyOnRails
[09:57:27] annlewis: has joined #RubyOnRails
[10:00:21] dhjondoh: has joined #RubyOnRails
[10:00:49] gaussblurinc1: has joined #RubyOnRails
[10:02:39] dionysus69: got one theoretical question, I am using postgresql as suggested by the rails community, sometimes theres an information in DB that doesn't change often, meaning only once every week, so its there only for reading. In that case it would billion time better if information got loaded in RAM once at the boot (basically save db table into hash provided table isn't too large < 1000 records) instead of querying db everytime user refreshes a pa
[10:03:48] elaptics: dionysus69: can the pages where it's used just be cached then?
[10:04:10] nfk|laptop: has joined #RubyOnRails
[10:04:11] rvanlieshout: dionysus69: your db has caching too
[10:04:20] rvanlieshout: so there is not really anything sane to say about this with only that information
[10:04:51] sevenseacat: 1000 records is tiny
[10:04:52] dionysus69: does cache work for SQL query's though? if I send a get request and it expects the same answer that I got 10 minutes ago, you are saying it reads from cache instead of querying db using turbolinks ?
[10:05:06] sevenseacat: you have much bigger problems at that scale
[10:05:15] rvanlieshout: dionysus69: now you're just using some buzz words
[10:05:39] dionysus69: haha and that means ? :D
[10:05:46] d34th4ck3r: has joined #RubyOnRails
[10:05:50] rvanlieshout: that you've got no clue about what you're talking about
[10:05:59] dionysus69: well good if db has cache didn't know that, problem solved I suppose xD
[10:05:59] sevenseacat: he's not wrong.
[10:06:08] rvanlieshout: dionysus69: not per se
[10:06:22] rvanlieshout: your db has cache, but you might not want to use that cache for something tiny that's only updated weekly
[10:06:38] rvanlieshout: it's just not that your statement before has 1 solves-it-all answer
[10:08:02] dionysus69: well ye I guess I am lacking some clue ^^ I ll just ignore this then, I wanted to avoid querying thinking it loads db mindlessly. I have a "weak" server and trying to think of ways how to make db work less
[10:08:05] d34th4ck3r: I stupidly created index for my Post model (Using MongoID) with: index({message:1},{unique:true}) Now I removed the index using rake db:mongoid:remove_indexes and recreated index for other model by create_indexes. But I???m still getting following error : Btree::insert: key too large to index, failing f2b_website_development.posts.$message_1
[10:08:27] rvanlieshout: dionysus69: then do consider something to cache that data
[10:08:37] FDostoyevsky: has joined #RubyOnRails
[10:08:39] ebbflowgo: has joined #RubyOnRails
[10:08:54] danneu: it's perfectly reasonable to query some stuff that never changes on server boot and hold it in memory til next reset, or poll the db in a 12 hour interval, etc. there are certain things where it'd just be dumb to hit the db on every request
[10:09:03] nfk|laptop: has joined #RubyOnRails
[10:09:56] dionysus69: danneu: ye thats what I was asking actually, so can you shoot me a link that explains all that in detail? or what keyword should I google haha
[10:10:08] rvanlieshout: i would use redis for that, dionysus69
[10:10:30] danneu: well, what's the use case?
[10:10:55] danneu: redis is heavy for just basic "this shit never changes so lemme rarely poll it" style caching
[10:11:43] rikkipitt: has joined #RubyOnRails
[10:12:53] rikkipitt: hello everyone. I've got a few model methods across several models that require a couple of lines of code to be run before then after the actual method code. what would be the best way to abstract this out globally?
[10:12:57] dionysus69: well use case: I have a table with 500 records and it has a category column, there are about 20-30 categories, I want to "poll" it so I don't have to query db everytime user is filtering table by category
[10:13:17] stamina: has joined #RubyOnRails
[10:13:55] dionysus69: rvanlieshout: ye thanks redis is something I was looking for - in memory database xD
[10:14:15] danneu: dionysus69: how often are they filtering shit?
[10:14:27] srinidhi: has joined #RubyOnRails
[10:15:00] dionysus69: assume high load of 1 filter per 10 seconds
[10:15:19] danneu: seems like a weird optimization
[10:15:35] dionysus69: ok let that be average
[10:15:42] sevenseacat: running redis would be far more taxing on your server than performing one SQL query every 10 seconds
[10:15:43] danneu: but 500 records, you could just load that into an array and .filter it
[10:15:45] dionysus69: lets say 10 loads per 1 second peak
[10:17:11] sevenseacat: honestly, your db is not the bottleneck here
[10:17:21] sevenseacat: and on data of this size, never will be
[10:17:21] dionysus69: ye ye thats what I am saying I want to load whole db basically in array and use array instead of dealing with db alltogether and write to db once hour maybe, is there an addon for postgres that would do that? would redis be called an addon in this situation or is it a standalone db like postgres?
[10:18:26] danneu: dionysus69: you don't need a plugin or a tool
[10:18:35] danneu: data = db.queryMy500Rows()
[10:19:24] danneu: `every6hours { data = db.queryMy500Rows() }`
[10:19:30] sevenseacat: this conversation makes no sense
[10:19:31] _jbr: has joined #RubyOnRails
[10:19:39] [ddmp]: has joined #RubyOnRails
[10:19:51] dionysus69: well I am just exploring since I am interested in scalability :) I like to learn stuff that are resilient to most cases and thanks all will explore what redis is and that thing you wrote danneu just now :D
[10:20:44] danneu: dionysus69: well, can't really beat the scalability of loading your data into your ruby process
[10:21:25] bruno-: has joined #RubyOnRails
[10:21:55] dionysus69: one attribute at a time, saves the useless disk read writes
[10:22:32] jahbrewski: has joined #RubyOnRails
[10:22:39] bonemind: has joined #RubyOnRails
[10:24:21] RegulationD: has joined #RubyOnRails
[10:24:49] quazimodo: has joined #RubyOnRails
[10:25:00] elaptics: rikkipitt: can you gist your code? So I can understand what you've got better
[10:26:04] elaptics: dionysus69: I wouldn't worry about it until you have collected some actual data that shows it's a bottleneck, then you can worry about what to do to fix it
[10:26:18] rails690: has joined #RubyOnRails
[10:26:25] tetraktys: has joined #RubyOnRails
[10:28:31] rails690: i have a problem: I've got a multi-term search which exceeds the maximum GET request length -- for example, searching for 30 different people in the same search -- and so I'm forced to use POST. However, when I use POST, i lose the params of pagination and current view, etc. (im using AJAX). How do I preserve my pagination + current view + etc. params while using POST AJAX search?
[10:28:51] rails690: somone here suggested I use a search resource, which is a good idea because then I can save searches. He suggested it as follows:
[10:28:54] sadaf2606: has joined #RubyOnRails
[10:28:57] rails690: "POST /searches -> creates a search object"
[10:28:59] shapeshifter: has joined #RubyOnRails
[10:29:04] rails690: "GET /searches/5?page=5 -> returns the results"
[10:29:15] shinenelson: has joined #RubyOnRails
[10:29:21] dionysus69: elaptics: ok thanks :) was on mood of learning something new even though useless atm ))
[10:29:26] rails690: however i have no idea how to implement this because I have variables inside my people controller that are not available inside the searches controller and its just a big mess
[10:29:38] sevenseacat: why do you lose 'the params of pagination and current view etc' by using POST?
[10:30:09] rails690: sevenseacat: just a sec.
[10:33:42] it_tard: has joined #RubyOnRails
[10:33:54] danneu: well, you can't render on a POST unless you want your site to have awful UX
[10:34:16] danneu: "Do you want to resubmit this form" lol.
[10:34:33] TheMoonMaster: has joined #RubyOnRails
[10:35:25] sevenseacat: the mind boggles
[10:35:47] ddv: sevenseacat: <3
[10:36:04] sevenseacat: danneu: where do you get such bizarre ideas from"
[10:36:12] danneu: https://en.wikipedia.org/wiki/Post/Redirect/Get
[10:36:16] danneu: what are you talking about?
[10:36:18] rubyonrailed: has joined #RubyOnRails
[10:36:19] baweaver: has joined #RubyOnRails
[10:36:27] ldnunes: has joined #RubyOnRails
[10:36:32] sevenseacat: I'm well aware of post/redirect/get
[10:36:42] sevenseacat: so a user submits a form that's invalid - you wouldn't re-render the form?
[10:36:46] sevenseacat: what would you do?
[10:36:47] rikkipitt: elaptics: sure, essentially I have to do some Apartment switching before and after setting a delayed job
[10:36:53] rikkipitt: i'll get a gist up
[10:37:14] danneu: sevenseacat: redirect
[10:37:20] sevenseacat: danneu: to where?
[10:37:59] rvanlieshout: rikkipitt: apartment gem?
[10:38:09] FDostoyevsky: has joined #RubyOnRails
[10:38:14] rikkipitt: rvanlieshout: yep
[10:38:18] rvanlieshout: rikkipitt: https://github.com/influitive/apartment#delayedjob
[10:38:20] rvanlieshout: fully agree with that :)
[10:38:29] sevenseacat: danneu: you think rails does basic crud wrong, then?
[10:38:31] danneu: GET /register -> submit -> POST /users -> validation error -> 302 /register
[10:38:56] rikkipitt: rvanlieshout: ah a fellow DJ/Apartment user. bit of a nightmare isn't it?!
[10:38:58] rvanlieshout: danneu: it should be GET /register -> submit -> POST /users -> get new form with error -> POST /users
[10:39:04] rvanlieshout: rikkipitt: we don't use DJ
[10:39:04] sevenseacat: because a default Rails conrtroller will re-render new if create fails, and re-render edit if update fails
[10:39:12] sevenseacat: and they are both POST requests
[10:39:37] danneu: yeah, i would not do that
[10:40:12] sevenseacat: so you'd do what?
[10:40:42] rvanlieshout: he (assumption) doesn't want to use rails convention :)
[10:40:49] rvanlieshout: prefers a redirect with all benefits..
[10:40:55] danneu: i'd redirect back to the GET /form route
[10:40:56] rikkipitt: https://gist.github.com/rikkipitt/b234cfa37281763efda6
[10:41:00] rvanlieshout: danneu: that's wrong
[10:41:04] sevenseacat: danneu: and lose all the submitted data?
[10:41:07] rvanlieshout: and causes an extra unneeded request
[10:41:16] sevenseacat: make the user re-fill out the form? great UX
[10:41:21] danneu: lol, 'unneeded request' on a form submission
[10:41:32] danneu: sevenseacat: uh, save the params.
[10:41:42] sevenseacat: danneu: thats why i asked what you'd do and you didnt mention that
[10:41:50] ramfjord: has joined #RubyOnRails
[10:42:09] danneu: assumed it wasn't a quiz
[10:42:14] arup_r: how to refactor my .yml file ? because staging and production both are having same config
[10:42:18] danneu: this isn't really controversial stuff, guys
[10:42:21] sevenseacat: thats a lot more work - plus if the user comes back to the form later, all their data would be repopu;alated?
[10:42:26] rvanlieshout: danneu: why are you making this so big?
[10:42:30] sevenseacat: you're making so much extra work that doesn't make a lot of sense
[10:42:34] rvanlieshout: cause it's so so so easy to just render the form again
[10:42:49] danneu: rvanlieshout: well, there is a downside https://en.wikipedia.org/wiki/Post/Redirect/Get
[10:43:09] rvanlieshout: danneu: i know, that's why nobody here uses the redirect
[10:43:17] danneu: that's okay
[10:43:53] sevenseacat: well if you want to disagree with everyone on basic convention, you would expect to get quizzed on your unorthodox ways
[10:44:24] danneu: you're just being combative.
[10:44:36] rvanlieshout: rails leans on convention quite heavy
[10:44:38] rvanlieshout: it's an important thing
[10:44:45] sevenseacat: asking someone to justify an unconventional stance is combative?
[10:44:47] rvanlieshout: you can expect such response is you want to break convention
[10:44:53] sevenseacat: you havent provided any such justification, btw
[10:45:42] ramfjord: sup guys! I'm working on a rails 3.2 app, and I've got a polymorphic "Thresholds" model that is persisted to the database. All Thresholds < Thresholds::Base, and we keep them in the thresholds table. I'm having trouble building these without persisting them to the database, because task.thresholds.build(type: "ClassName::Blah") raises a "Can't mass-assign protected attributes: type". Using rails 4, this works, but upgrading the app at this precise
[10:46:08] danneu: rendering on POST has downsides. sometimes they don't matter. sometimes they do.
[10:46:13] rvanlieshout: ramfjord: have you googled what that error means?
[10:46:17] rvanlieshout: ramfjord: it's not related to persistence
[10:46:21] cac: has joined #RubyOnRails
[10:46:27] rvanlieshout: ramfjord: it's because you don't allow mass assignment of that attribute while you're trying to do so
[10:46:38] it_tard: has joined #RubyOnRails
[10:46:38] rvanlieshout: danneu: what downside?
[10:46:58] rvanlieshout: danneu: refresh = ok, they don't have to make a second request
[10:47:00] sevenseacat: danneu: yes, it has downsides. they do not warrant a blanket statement of 'never render on POST'
[10:47:09] ramfjord: rvanlieshout: I've also tried to attr_accessible that field, but even if we do it creates an instance of the Base class rather than the type I'm passing in.
[10:47:14] sevenseacat: 'rendering on POST is awful UX'
[10:47:30] danneu: well yeah, for POST /search
[10:47:39] sevenseacat: both statements designed to provoke. congrats, you got the attention.
[10:47:45] sevenseacat: danneu: no, you never said that.
[10:47:46] rails690: sevenseacat: ok i dont want to go thru my problems, instead i want to know what's the correct way to deal with a POST ajax search, while keeping pagination, and other GET params?
[10:48:18] sevenseacat: "danneu: well, you can't render on a POST unless you want your site to have awful UX"
[10:48:19] ramfjord: rvanlieshout: also - it's kind of clear that type is a special case, as attr_accessible isn't defined for anything, and everything else is mass-assignable by default
[10:48:33] wethu: has joined #RubyOnRails
[10:48:34] wethu: has joined #RubyOnRails
[10:49:05] danneu: sevenseacat: well, the person *right above me* brought it up. though i notice now they were talking about AJAX
[10:49:28] sevenseacat: the person right above you mentioned nothing about UX.
[10:49:34] sevenseacat: you derailed this conversation. well done.
[10:49:56] danneu: well, they did mention UX. they are losing pagination and keyword parameters
[10:49:59] rvanlieshout: ramfjord: !gist log and model
[10:49:59] helpa: ramfjord: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[10:50:00] danneu: you're made salty today
[10:50:14] rvanlieshout: how is loosing those parameters related to render on post?
[10:50:18] rvanlieshout: it's just a flaw in their application
[10:50:23] sevenseacat: indeed, that was my original question
[10:50:36] sevenseacat: [18:29:38] sevenseacat: why do you lose 'the params of pagination and current view etc' by using POST?
[10:50:40] rails690: could someone please tell me how to do POST ajax search, while preserving pagination, data view, etc. GET params at the same time?
[10:50:59] sevenseacat: rails690: if you can tell us where those parameters are being lost, we can help you not-lose them
[10:51:02] danneu: we're just shooting the shit til rails690 clarifies some key foundational tenets
[10:51:02] rails690: i dont know, my implementation is a mess
[10:51:03] Bloomer: has joined #RubyOnRails
[10:51:06] bruno-_: has joined #RubyOnRails
[10:51:11] rails690: i just want to know from the ground up
[10:51:32] sevenseacat: rails690: well from the ground up, you would preserve those parameters
[10:51:45] sevenseacat: we don't know how that's not happening for you
[10:51:59] rails690: im using Ransack fyi, i POST the search, it renders @people based on the params[:q]
[10:52:13] rails690: pagination works, it preserves the get params
[10:52:15] sevenseacat: danneu: me being salty would have kicked you a long time ago. this is me being reasonable.
[10:52:19] rails690: however, stuff like Delete, and change Data View don't
[10:52:32] sevenseacat: danneu: personal attacks aren't cool, btw.
[10:52:52] danneu: neither is rendering on POST
[10:53:09] sevenseacat: ok, you've said your bit about that. let's move on.
[10:53:24] ddv: wow is this still going on? :-)
[10:53:29] rails690: my change data view, link, for example is a link to 'view 2', view: 'list2', remote: true
[10:53:29] rvanlieshout: rails690: so you want to retain pagination where you delete an entry?
[10:53:45] sevenseacat: ddv: unfortunately.
[10:53:46] rvanlieshout: then you'll have to add the page param to that url
[10:53:59] rvanlieshout: page: params[:page]
[10:54:10] rails690: thats what i did
[10:54:23] rails690: but then it complains about id = search
[10:54:31] rails690: and i dont know hwo that happene dlol
[10:54:55] rvanlieshout: how did we get to id=search?
[10:55:07] rvanlieshout: add it again, gist full error, code and generated link
[10:55:08] sevenseacat: rails690: can you put together a gist of your code showing the problem?
[10:55:41] ramfjord: rvanlieshout: thanks for your time - if you don't know a good way I'll just hackily keep the thresholds in a separately instantiated collection that I know won't be persisted. Basically we need a .build(type: "KlassName") to work with any kind of STI model - I was hoping someone had faced this issue, but if not we are in a hackathon and can't devote much time
[10:56:09] rvanlieshout: i have several good ways
[10:56:23] rvanlieshout: but trying something and just giving up cause it seems to lead to an other error isn't one of them
[10:56:37] rvanlieshout: your nicks look way to similar
[10:56:55] rvanlieshout: ramfjord: also consider dropping STI
[10:56:58] sevenseacat: thats why i like textual, it gives colours to nicks to avoid confusion :)
[10:57:06] ddv: textual <3
[10:57:14] rvanlieshout: fair point :)
[10:57:26] ddv: sevenseacat is pink in my textual
[10:57:28] rvanlieshout: ramfjord: cause STI is used wrong by i would assume 99% of people who use it
[10:57:49] sevenseacat: I wouldn't go as high as 99%, but it's a very high number.
[10:58:08] ddv: I feel special for belonging to the 1%
[10:58:15] annlewis: has joined #RubyOnRails
[10:58:46] rvanlieshout: ddv: so you belong to those who actually studied their db for the difference in impact between having separate tables and storing all in one?
[10:59:00] rails690: oh i figure dout, its trying to render people#show
[10:59:24] rails690: when i click on the link_to 'view 2', its tryin gto render people #show
[10:59:43] rvanlieshout: <%= link_to 'view 2, %> would give a syntax error here
[11:00:05] ddv: rvanlieshout: Ya. I will usually start with an ERD before I create my Rails project
[11:00:15] rvanlieshout: ddv: an erd doesn't show that
[11:00:23] rvanlieshout: it'll just show you that you have 1 table and not 2
[11:00:27] rvanlieshout: why would 1 be better then 2?
[11:01:30] rails690: link_to 'view2', view: 'list2', page: params[:page], limit: params[:limit]
[11:01:41] rails690: clicking on that renders people#show instead of re-rendering people#index
[11:02:03] rvanlieshout: what's the url generated?
[11:02:28] ramfjord: rvanlieshout: I'm sure
[11:02:35] aganov: has joined #RubyOnRails
[11:02:55] rvanlieshout: ramfjord: about sti?
[11:03:29] rails690: "localhost:3000/en/people/search?view=list2"
[11:03:45] rvanlieshout: rails690: compare that to the output of rake routes
[11:03:54] rvanlieshout: and show us why that should not render the show action
[11:04:51] quazimodo: has joined #RubyOnRails
[11:05:19] blackmesa: has joined #RubyOnRails
[11:05:38] danneu: rails690: makes sure the /people/search route has precedence over /people/:id
[11:05:43] weckl: has joined #RubyOnRails
[11:07:01] rails690: search_people_path POST /:locale/people/search(.:format)
[11:07:09] rails690: people_path GET /:locale/people(.:format)
[11:07:12] rails690: person_path GET /:locale/people/:id(.:format)
[11:07:15] rvanlieshout: rails690: and what method is that link using?
[11:07:22] rails690: its using GET
[11:07:35] goldbug: Okay, stuck again. I'm trying to create a dropdown in simple_forms that allows me to switch locale and view/input different values in the form fields. Two problems: firstly, I don't have a :locale method in my model, so whatever label I use for the f.input in the form is coming up as "Undefined method". Secondly, I need to figure out some way to make the fields reload dynamically based on
[11:07:35] goldbug: the change to the locale dropdown, which I guess means Javascript?
[11:08:04] rvanlieshout: rails690: hence it's going to person_path
[11:08:17] rails690: so it has to use POST?
[11:08:37] rvanlieshout: rails690: read what you've just pasted again
[11:08:46] rails690: why tho, people_path is first
[11:09:04] rails690: oohh its saying id = search
[11:09:10] rails690: cuz its going to that route
[11:09:13] rvanlieshout: cause your seatch_people_patch doesn't match
[11:09:17] rvanlieshout: so it's moving on to the next
[11:09:22] rails690: ok so how do i solve that
[11:09:28] danneu: rails690: been a while since i've used rails, but try button_to
[11:09:35] rvanlieshout: rails690: either add a route for get or use post
[11:09:43] rvanlieshout: just add method: :post
[11:09:47] rvanlieshout: no need for button_to :)
[11:09:54] rails690: which is better? method: :post?
[11:10:15] rvanlieshout: i would add the route for get
[11:10:19] rvanlieshout: cause it's a search
[11:10:23] rvanlieshout: but you ran into the length, right?
[11:10:30] rvanlieshout: so you've made it post for that reason
[11:10:33] rvanlieshout: then use the method: :post
[11:11:04] rails690: yeah i used method: :post, now it doesnt preserve my pagination params
[11:11:12] rails690: it goes back to page 1, but successfully changes the view
[11:11:15] rvanlieshout: that's a separate problem for this
[11:11:20] rails690: even tho I have page: params[:page] in the link
[11:11:23] rvanlieshout: the link you pasted didn't include page
[11:11:29] rvanlieshout: is params[:page] set at the time that link is generated?
[11:11:57] rails690: yes, its link to 'view2', view: 'list2', page: params[:page], list: params[:list], method: :post, remote: true
[11:12:01] ibouvousaime: has joined #RubyOnRails
[11:12:06] rvanlieshout: and is that link rendered _after_ the page has been set?
[11:12:13] rvanlieshout: cause the link you've posted didn't include page=x
[11:12:19] rvanlieshout: so you don't even have to search further
[11:12:44] ibouvousaime: has joined #RubyOnRails
[11:12:45] rails690: it didnt have page =x cuz it was the first page of my search
[11:12:59] rvanlieshout: so the problem is still just that it renders show
[11:13:04] rvanlieshout: don't include other possible problmes yet
[11:13:08] rvanlieshout: just solve them one by one
[11:13:18] rvanlieshout: you can't fix everything at once
[11:13:39] rails690: ok so let me understand here
[11:13:59] rails690: method: :post, isn't ideal for this link, i should change it, or what should i do now?
[11:14:07] rvanlieshout: there is nothing wrong with :post for that link if you need it
[11:14:27] rvanlieshout: but it's kinda weird that you have a search form that doesn't fit in the get maximum length
[11:14:34] rails690: what it does is it thinks im creating a new search with :post, so it erases my params[:q]
[11:14:44] rvanlieshout: no it doesnt' do that
[11:14:45] rails690: thats cuz its a multi-term search
[11:14:48] rails690: i can search for 30 different people at the same time
[11:15:04] rvanlieshout: you're looking at all kind of places for things
[11:15:09] rvanlieshout: let's just start with this problem
[11:15:13] rvanlieshout: for now, there is nothing else
[11:16:11] rails690: if i think of it that way, it seems solved to me
[11:16:17] rails690: cuz its now rendering people#index
[11:16:50] rvanlieshout: now continue to the next problem
[11:17:29] rails690: the next problem is that it seems like it undoes my search when i click the link and shows all of the people again
[11:17:40] rails690: but correctly changes the view
[11:17:56] rvanlieshout: check that the generated link / form with that link includes your params[:q]
[11:19:07] rails690: it doesnt include it
[11:20:01] rails690: so if i do link_to 'view2', view: 'list2', q: params[:q], page: params[:page], limit: params[:limit], method: :post, remote: true, it tries putting the params in the URL (GET) and says it exceeds the GET request
[11:20:20] rvanlieshout: gist the generated link for that statement
[11:20:29] rickmasta: has joined #RubyOnRails
[11:21:58] nettoweb: has joined #RubyOnRails
[11:23:14] rails690: https://gist.github.com/anonymous/160947d2d4bacdad4813
[11:23:53] bmalum: has joined #RubyOnRails
[11:24:47] rvanlieshout: the full html
[11:24:52] rvanlieshout: and view source
[11:26:04] User458764: has joined #RubyOnRails
[11:26:06] rvanlieshout: because i want to see what actually is used and what actually happens
[11:27:20] cac: has joined #RubyOnRails
[11:28:00] rails690: thats too much for me, ive got to go in 5 minutes, basically i use a hack to do multi-term search using ransack, it gets the search params, splits it into an array, then searches each item in the array
[11:28:19] rails690: thats why the params are so big
[11:28:21] rvanlieshout: basically you expect people here to understand what you're trying to do without sharing anything sane
[11:28:59] rails690: can u guess anything based on what i said there?
[11:29:17] czerasz: has joined #RubyOnRails
[11:29:23] bruno-: has joined #RubyOnRails
[11:29:29] rvanlieshout: i don't guess
[11:29:38] rails690: someone suggested me to create a search object on search, and then display the search results on the GET of the search object
[11:29:44] rvanlieshout: that's not how developing works
[11:29:48] rails690: POST /searches -> creates a search object
[11:29:53] rails690: GET /searches/5?page=5 -> returns the results
[11:30:01] rails690: what do u think about that idea?
[11:30:07] rvanlieshout: you could have pasted by now :)
[11:30:24] rails690: im leaving in 1 min
[11:31:59] rails690: thanks for the help, bye
[11:34:43] rubyonrails476: has joined #RubyOnRails
[11:37:13] rubyonrails941: has joined #RubyOnRails
[11:37:23] Wobni: has left #RubyOnRails: ()
[11:37:52] norc: rvanlieshout: See, you helped him [understand the errors of his ways] and he was grateful.
[11:38:03] norc: What a wonderful day this must be.
[11:38:11] rvanlieshout: i only have wonderful days :)
[11:38:18] FailBit: undefined method `[]' for nil:NilClass
[11:38:39] w0bni: has joined #RubyOnRails
[11:38:42] norc: Dont call [] on nil I recommend.
[11:38:55] FailBit: undefined method `new' for NilClass:Class
[11:39:03] FailBit: I was expecting it to return nil
[11:39:04] yardenbar: has joined #RubyOnRails
[11:40:14] rvanlieshout: if you were expecting nil, why call [] or .new on it?
[11:40:26] norc: FailBit: The reason is NilClass is the singleton class of nil, rather than a normal class.
[11:40:27] artto: has joined #RubyOnRails
[11:41:14] FDostoyevsky: has joined #RubyOnRails
[11:41:38] norc: And since you should not be able to construct a singleton class this fails.
[11:41:53] norc: Would be a bit nicer to get a "TypeError: can't create instance of singleton class" here tho
[11:42:36] FailBit: ruby gets it wrong for repeating decimals like 0.333
[11:43:08] rvanlieshout: i think that's your console who gets it wrong
[11:43:15] rvanlieshout: but how did we get from [] on nil to that?
[11:43:50] FailBit: NilClass has a to_r method
[11:47:09] chridal: has joined #RubyOnRails
[11:49:31] syath: has joined #RubyOnRails
[11:49:33] krzkrzkrz: has joined #RubyOnRails
[11:51:19] cac: has joined #RubyOnRails
[11:51:21] Peteykun: has joined #RubyOnRails
[11:52:05] tetraktys: has joined #RubyOnRails
[11:52:27] DEA7TH: has joined #RubyOnRails
[11:52:53] blackmesa: has joined #RubyOnRails
[11:59:00] annlewis: has joined #RubyOnRails
[12:00:32] chrislotix: has joined #RubyOnRails
[12:00:34] pawnbox: has joined #RubyOnRails
[12:01:29] TDJACR: has joined #RubyOnRails
[12:03:43] chrislotix: When i signup properly on my signup page, it still renders errors that password cant be blank or too short. I checked in rails console and the user saves properly with the same credentials. What could be the possible reasons for that happening?
[12:06:47] roshanavand: has joined #RubyOnRails
[12:07:10] northfurr: has joined #RubyOnRails
[12:07:13] ddv: chrislotix: check if the paramters actually arrive from your signup page to the action
[12:07:33] sevenseacat: has joined #RubyOnRails
[12:10:53] chrislotix: ddv: lol thank you i found the culprit thanks to that :)
[12:11:01] chrislotix: "pasword"=>"foobar"
[12:11:46] njero: has joined #RubyOnRails
[12:14:18] FDostoyevsky: has joined #RubyOnRails
[12:14:29] Ergo^: has joined #RubyOnRails
[12:15:36] georges: has joined #RubyOnRails
[12:16:26] cac: has joined #RubyOnRails
[12:18:41] freezevee: has joined #RubyOnRails
[12:19:05] logius: has joined #RubyOnRails
[12:21:38] nfk|laptop: has joined #RubyOnRails
[12:27:22] spiman: has joined #RubyOnRails
[12:27:39] mices: has joined #RubyOnRails
[12:31:12] voker57: has joined #RubyOnRails
[12:31:19] spiman: hello, is it possible to provide a proc as a replacer function to the String#encode encoding_options hash? according to the docs (http://ruby-doc.org/core-2.0.0/String.html#method-i-encode) the :replace key must be a character, but is there a way I can trick it to use a proc that gets passed the original character as an argument?
[12:31:28] mices: does rails or other gems require sqlite even if i'm using mysql instead (or: is it safe to remove sqlite3 gem if i'm not using sqlite)
[12:31:45] ocx: has joined #RubyOnRails
[12:31:49] ddv: mices: you can remove it
[12:31:50] norc: mices: Your Gemfile defines the requirements. :)
[12:31:56] ocx: Routing Error No route matches [GET] "/api/events/user_past_events" Try running rake routes for more information on available routes. <-- any idea about sych errors
[12:32:04] mices: norc: that's the thing
[12:32:14] build22: has joined #RubyOnRails
[12:32:14] ocx: i am trying a GET request from the browser
[12:32:15] norc: ocx: Do as you are told and run rake routes. :p
[12:32:33] ocx: norc: is running a url in the browser same as a normal get request from code?
[12:32:36] ddv: ocx: are you appending .json?
[12:32:59] ddv: ocx: is it a json view?
[12:33:12] ocx: http://blahapi/events/user_past_events?access_token=42342365464578
[12:33:22] norc: ocx: Seriously, post the output for rake routes when you have routing issues.
[12:33:27] norc: And post your routes.rb along with it
[12:33:38] norc: Beats the guessing game.
[12:33:41] ocx: is the above a correct GET request?
[12:33:47] mices: norc: it's not listed in Gemfile but whenever i run bundle install rails remarks about ignoring sqlite3 because it's extensions haven't been built ... so then i run gem list and i see multiple versions of sqlite3, so it's seems the Gemfile's not in control of defining requirements?
[12:35:41] norc: mices: Run gem dependency -R to see which one is the culprit then
[12:37:05] adre: has joined #RubyOnRails
[12:37:25] moeabdol: has joined #RubyOnRails
[12:38:38] weihan: has joined #RubyOnRails
[12:41:13] tvw: has joined #RubyOnRails
[12:42:08] cac: has joined #RubyOnRails
[12:43:41] ramfjord: has joined #RubyOnRails
[12:49:07] cac: has joined #RubyOnRails
[12:49:08] darrencauthon: has joined #RubyOnRails
[12:50:53] Balllkenende: has joined #RubyOnRails
[12:50:58] bahar: has joined #RubyOnRails
[12:51:23] tknz: has joined #RubyOnRails
[12:53:18] dionysus69: any good practice suggestions appreciated, this is already ugly and I am going to add more filters to the index and this is going to go out of control, how do I optimize this? https://gist.github.com/webzorg/97cdb6b97ad455411fb7
[12:54:14] sankaber: has joined #RubyOnRails
[12:54:57] sankaber: has joined #RubyOnRails
[12:55:48] norc: dionysus69: The most simplistic approach would be to use scopes in your models.
[12:56:24] norc: dionysus69: Or you could utilize some of the search gems that take off portions of your logic (like ransack, squeel, etc)
[12:58:01] Cervajz: has joined #RubyOnRails
[12:58:47] elaptics: dionysus69: I would create a specific search object that takes a filter object (which encapsulates the filtering options of the search and the values provided by the user) and then all the logic, etc can sit in that search object
[12:59:45] annlewis: has joined #RubyOnRails
[13:03:22] bmalum: has joined #RubyOnRails
[13:03:39] Spami: has joined #RubyOnRails
[13:03:50] drbayer: has joined #RubyOnRails
[13:03:51] wethu: has joined #RubyOnRails
[13:03:56] build22__: has joined #RubyOnRails
[13:05:32] frzng: has joined #RubyOnRails
[13:06:05] chrislotix: has joined #RubyOnRails
[13:07:09] tvw: has joined #RubyOnRails
[13:10:21] Pazician: has joined #RubyOnRails
[13:11:02] tuelz1: has joined #RubyOnRails
[13:11:52] fgo: has joined #RubyOnRails
[13:15:44] hardtail: has joined #RubyOnRails
[13:16:37] jkamenik: has joined #RubyOnRails
[13:17:58] rikkipitt: has joined #RubyOnRails
[13:19:57] jscheel: has joined #RubyOnRails
[13:20:11] cac: has joined #RubyOnRails
[13:22:24] goodcodeguy: has joined #RubyOnRails
[13:23:47] roshanavand: has joined #RubyOnRails
[13:26:16] agoldboi: has joined #RubyOnRails
[13:26:16] dionysus69: has joined #RubyOnRails
[13:26:19] RegulationD: has joined #RubyOnRails
[13:26:23] mostlybadfly: has joined #RubyOnRails
[13:26:47] Balllkenende: has joined #RubyOnRails
[13:32:33] dionysus69: norc I actually did all that :D) it was just getting too complicated :s
[13:32:55] dionysus69: elaptics: i have trouble understanding by what you meant by search object
[13:34:38] Guest53: has joined #RubyOnRails
[13:36:27] elaptics: dionysus69: I mean a bit like this http://railscasts.com/episodes/111-advanced-search-form-revised
[13:36:35] cac: has joined #RubyOnRails
[13:37:47] build22: has joined #RubyOnRails
[13:39:01] Cervajz: has joined #RubyOnRails
[13:39:37] SamGerber: has joined #RubyOnRails
[13:39:58] dionysus69: ok thanks :) will dive in
[13:40:43] rickmasta: has joined #RubyOnRails
[13:43:56] Rodya_: has joined #RubyOnRails
[13:44:43] atomical: has joined #RubyOnRails
[13:44:44] pawnbox_: has joined #RubyOnRails
[13:44:58] tuelz1: has joined #RubyOnRails
[13:46:29] Balllkenende: has joined #RubyOnRails
[13:46:37] dstarh: has joined #RubyOnRails
[13:48:48] bmalum: has joined #RubyOnRails
[13:48:54] Sigfrid: has joined #RubyOnRails
[13:49:26] Macaveli: has joined #RubyOnRails
[13:51:54] ruurd: has joined #RubyOnRails
[13:53:22] oded: has joined #RubyOnRails
[13:53:32] oded: dionysus69: a bit late, but you can use scopes in the model and a constant stating which scopes can be used, and then the controller iterates over that constant. so it's all under the model's control
[13:54:19] oded: gday to u 2
[13:55:39] oded: in controller: Product::FILTERS.each { |filter| @products = @products.send(filter, params[filter]) if filter }
[13:56:29] oded: in model: FILTERS = [:giftbox, ...]; scope :giftbox, -> (param) { ... }; or def self.giftbox(param)
[13:56:50] ramortegui: has joined #RubyOnRails
[13:57:53] m712: has joined #RubyOnRails
[13:58:01] cac: has joined #RubyOnRails
[13:59:19] Pupeno: has joined #RubyOnRails
[13:59:19] Pupeno: has joined #RubyOnRails
[13:59:30] Megamos: has joined #RubyOnRails
[14:00:10] ruurd: has joined #RubyOnRails
[14:00:28] Cervajz_: has joined #RubyOnRails
[14:00:42] annlewis: has joined #RubyOnRails
[14:01:18] dionysus69: oded: ye thats my current approach I am using 2 scopes :)
[14:01:51] norc: dionysus69: http://www.justinweiss.com/articles/search-and-filter-rails-models-without-bloating-your-controller/
[14:01:52] jgt2: has joined #RubyOnRails
[14:01:55] norc: Take a look at that article. :)
[14:02:16] dionysus69: norc: thats exactly what I followed :) its a great guide :D
[14:02:45] dionysus69: i googled this a lot and that pops out quite allot of times
[14:03:43] cac: has joined #RubyOnRails
[14:04:41] Guest53: has joined #RubyOnRails
[14:04:50] spiman: has joined #RubyOnRails
[14:05:00] TheNet: has joined #RubyOnRails
[14:06:46] SamGerber: has joined #RubyOnRails
[14:07:52] kimegede: has joined #RubyOnRails
[14:08:19] Guest53: has joined #RubyOnRails
[14:08:38] big|bad|wolf: has joined #RubyOnRails
[14:09:18] jacobat: has joined #RubyOnRails
[14:09:35] jacobat: How do I tell Rails not to set a session cookie in certain controllers?
[14:09:47] treehug88: has joined #RubyOnRails
[14:10:05] sankaber: has joined #RubyOnRails
[14:10:41] ElFerna: has joined #RubyOnRails
[14:11:00] norc: jacobat: set an after filter and override request.session_options = {}
[14:11:11] norc: That should do the trick.
[14:11:19] rvanlieshout: jacobat: by not using the session
[14:12:03] rickmasta: has joined #RubyOnRails
[14:12:36] jacobat: rvanlieshout: I've got a complex codebase that probably uses the session somewhere :-/
[14:12:53] norc: "Probably" ?
[14:12:53] rvanlieshout: you cannot prevent that cookie and have a session
[14:13:06] norc: rvanlieshout: Oh, that thing is glued into Rack isnt it?
[14:13:09] rvanlieshout: and most people who say they have a complex codebase have just have a chaotic one
[14:13:12] jacobat: I don't want a session for requests hitting this controller
[14:13:22] jacobat: rvanlieshout: Let's call it chaotic then :)
[14:13:30] rvanlieshout: jacobat: so you shouldn't use the session for that controller
[14:14:06] SeanLazer: has joined #RubyOnRails
[14:14:15] jacobat: rvanlieshout: If only it was that simple
[14:14:33] SeanLazer: has joined #RubyOnRails
[14:14:55] rvanlieshout: you do need the session?
[14:15:03] rvanlieshout: and what's wrong with the cookie?
[14:15:10] umgrosscol: has joined #RubyOnRails
[14:15:19] jacobat: I don't need the session and I don't want the session for this controller
[14:15:23] drbayer: has joined #RubyOnRails
[14:15:26] rvanlieshout: ah.. the docs write: 'essions are lazily loaded. If you don't access sessions in your action's code, they will not be loaded. Hence you will never need to disable sessions, just not accessing them will do the job.'
[14:15:33] rvanlieshout: so then you must be accessing the session
[14:15:42] jacobat: I probably am somewhere
[14:16:09] rvanlieshout: then you cannot prevent that cookie
[14:16:20] rvanlieshout: so fix your codebase or stop worrying about that cookie? (why are you even so worried about it?)
[14:16:32] jacobat: Because we have a bug because of it
[14:17:08] jacobat: HTTP caching and sessions cookies do not play nicely together
[14:17:20] chridal: has joined #RubyOnRails
[14:17:28] rvanlieshout: thats a job for the caching software
[14:18:04] yuujinlee: has joined #RubyOnRails
[14:18:06] jacobat: Sure, I could tell the caching software to remove cookies - but it would be better if the Rails application behaved correctly
[14:18:15] ruurd: has joined #RubyOnRails
[14:18:16] sankaber: has joined #RubyOnRails
[14:18:28] rvanlieshout: rails won't if you won't use the session
[14:18:52] mag42c: has joined #RubyOnRails
[14:19:01] tetraktys: has joined #RubyOnRails
[14:19:03] nertzy: has joined #RubyOnRails
[14:19:12] jacobat: Right - fix my code
[14:19:26] rvanlieshout: well.. it clearly contains something you don't want
[14:21:23] ruurd: has joined #RubyOnRails
[14:21:25] jacobat: It contains many things I don't want - it's an old and crufty codebase
[14:21:43] rvanlieshout: it should just prefix his ssh commands
[14:21:52] rvanlieshout: wrong window :)
[14:23:23] renews: has joined #RubyOnRails
[14:27:34] ibouvousaime: has joined #RubyOnRails
[14:27:57] ruurd: has joined #RubyOnRails
[14:28:46] roshanavand: has joined #RubyOnRails
[14:29:26] Pazician: has joined #RubyOnRails
[14:30:11] m712: has joined #RubyOnRails
[14:31:38] smathy: has joined #RubyOnRails
[14:34:46] ruurd: has joined #RubyOnRails
[14:35:16] jacobat: So the session is accessed in a middleware
[14:39:54] jahbrewski: has joined #RubyOnRails
[14:40:45] Cyberheb: has joined #RubyOnRails
[14:40:52] Cyberheb: has left #RubyOnRails: ()
[14:41:51] bmalum: has joined #RubyOnRails
[14:41:52] build22: has joined #RubyOnRails
[14:42:04] RegulationD: has joined #RubyOnRails
[14:42:15] nfk|laptop: has joined #RubyOnRails
[14:42:19] cgfbee: has joined #RubyOnRails
[14:42:33] kp666: has joined #RubyOnRails
[14:42:55] cfloare: has joined #RubyOnRails
[14:44:45] yardenbar: has joined #RubyOnRails
[14:44:53] ruurd: has joined #RubyOnRails
[14:45:33] roshanavand: has joined #RubyOnRails
[14:45:43] aadam21: has joined #RubyOnRails
[14:46:11] roshanavand: has joined #RubyOnRails
[14:47:13] bdnelson: has joined #RubyOnRails
[14:47:30] krzkrzkrz: has joined #RubyOnRails
[14:48:31] sarink: has joined #RubyOnRails
[14:48:56] cac: has joined #RubyOnRails
[14:49:45] blackmesa: has joined #RubyOnRails
[14:50:22] georges: has joined #RubyOnRails
[14:55:21] ruurd: has joined #RubyOnRails
[14:59:00] axl_: has joined #RubyOnRails
[14:59:12] gavit: with nested forms you can create 1 entry of a model and several entries of a second model. This is assuming you need info from the user
[14:59:13] nya: has joined #RubyOnRails
[14:59:41] gavit: if I want to create two models where I specify the data for the second model based on the entries of the first model, how do we go about this?
[14:59:45] adavia: has joined #RubyOnRails
[14:59:52] polishdub: has joined #RubyOnRails
[14:59:56] okdas: has joined #RubyOnRails
[14:59:56] okdas: has joined #RubyOnRails
[15:00:06] gavit: I was thinking of just doing it in the controller
[15:00:37] gavit: how do I make sure the creation of the 2nd model fails when the first fails
[15:00:50] bratsche: has joined #RubyOnRails
[15:01:10] The_Phoenix: has joined #RubyOnRails
[15:01:13] Cache_Money: has joined #RubyOnRails
[15:01:23] annlewis: has joined #RubyOnRails
[15:03:51] Megamos: has joined #RubyOnRails
[15:04:37] tbuehlmann: gavit, sounds like you want some kind of a form object
[15:04:54] Megamos: has joined #RubyOnRails
[15:05:05] HalcyonicStorm: has joined #RubyOnRails
[15:07:12] ruurd: has joined #RubyOnRails
[15:10:06] The_Phoenix: has joined #RubyOnRails
[15:10:34] ruurd: has joined #RubyOnRails
[15:14:04] tetraktys: has joined #RubyOnRails
[15:14:57] lacrymol1gy: has joined #RubyOnRails
[15:15:14] momomomomo: has joined #RubyOnRails
[15:16:26] TheNet: has joined #RubyOnRails
[15:16:43] cfloare: has joined #RubyOnRails
[15:17:12] njero: has joined #RubyOnRails
[15:17:47] leonardoajim: has joined #RubyOnRails
[15:18:13] leonardoajim: has joined #RubyOnRails
[15:18:21] cgfbee: has joined #RubyOnRails
[15:18:28] kalusn: has joined #RubyOnRails
[15:18:31] roshanavand: has joined #RubyOnRails
[15:19:02] big|bad|wolf: has joined #RubyOnRails
[15:21:27] Peteykun: has joined #RubyOnRails
[15:21:42] hardtail: has anyone read https://leanpub.com/everydayrailsrspec ? is this a good book for a novice?
[15:22:58] User458764: has joined #RubyOnRails
[15:23:40] Fire-Dragon-DoL: has joined #RubyOnRails
[15:24:28] solars: has joined #RubyOnRails
[15:25:26] chridal: has joined #RubyOnRails
[15:26:20] bruno-: has joined #RubyOnRails
[15:27:23] P0w3r3d: has joined #RubyOnRails
[15:33:13] mrbubbles: has joined #RubyOnRails
[15:33:40] leonardoajim: has joined #RubyOnRails
[15:33:46] sinkensabe: has joined #RubyOnRails
[15:33:47] goldbug: Folks, I've got a dropdown on a form and I want the form to reload when something is selected from the dropdown. I also want the selection to be carried through as a variable to the reloaded page. How do I do this? I assume an :onchange => 'this.form.something' is involved?
[15:33:59] mrbubbles: hi folks, got a bit of a strange one. i???m using STI and it???s working fine on my local machine, but when I deploy to my staging server it???s saying that he single-table inheritance mechanism failed to locate the subclass: 'LatestValueWidgetType'
[15:34:12] mrbubbles: which is strange as I???m deploying using git/capistrano and I can see that the file is on there
[15:34:15] mrbubbles: permissiosn look okay too
[15:34:19] mrbubbles: anyone seen anything like this?
[15:35:31] RockLee: has joined #RubyOnRails
[15:36:14] teclator: has joined #RubyOnRails
[15:40:01] apg: has joined #RubyOnRails
[15:40:13] elaptics: mrbubbles: what rails version?
[15:40:27] chridal: has joined #RubyOnRails
[15:40:44] elaptics: mrbubbles: most likely something to do with autoloading http://guides.rubyonrails.org/autoloading_and_reloading_constants.html
[15:41:17] mordocai: has joined #RubyOnRails
[15:41:46] elaptics: mrbubbles: oh actually, do the values in the type field all relate to classes that exist? If it's changed since the server was reloaded it can cause issues
[15:42:00] mrbubbles: ooh that might be it
[15:42:05] mrbubbles: I???ll try restarting the server
[15:42:07] mrbubbles: thanks elaptics
[15:42:26] elaptics: mrbubbles: for example I have an old rails 2 app where we renamed a class that was used in STI and updated the DB values but it still caused issues until the server was restarted
[15:43:23] elaptics: goldbug: is it just a single dropdown - just have it send it as a query string on the url then it'll be available to be looked at on the reloaded page
[15:43:53] TheNet: has joined #RubyOnRails
[15:46:11] ramfjord: has joined #RubyOnRails
[15:47:17] mrbubbles: elaptics: ah I just tried to restart unicown and it says master failed to start, check stderr log for details, so I think that when I was deploying the latest version wasn???t getting pushed
[15:47:27] mrbubbles: or rather it was, but was unable to respawn
[15:47:33] infamos: has joined #RubyOnRails
[15:47:44] elaptics: maybe you have some other error then
[15:48:06] mrbubbles: Yep I think so
[15:48:11] mrbubbles: Where it says ???check stderr log for details??? what does that refer to?
[15:48:34] mrbubbles: oh unicorn.log :)
[15:48:46] renews: has joined #RubyOnRails
[15:49:06] blackmesa: has joined #RubyOnRails
[15:49:20] cac: has joined #RubyOnRails
[15:49:42] RegulationD: has joined #RubyOnRails
[15:50:43] mrbubbles: One of those days :) had an old serializer which I???d deleted but not committed which stil referenced an old parnet class
[15:50:50] theblang: has joined #RubyOnRails
[15:52:01] rodfersou: has joined #RubyOnRails
[15:52:06] logius: has left #RubyOnRails: ()
[15:54:56] The_Phoenix: has joined #RubyOnRails
[15:55:47] zpe: has joined #RubyOnRails
[15:57:00] baweaver: has joined #RubyOnRails
[15:57:12] i: has joined #RubyOnRails
[15:58:17] corioliss: has joined #RubyOnRails
[15:59:04] zpe: has joined #RubyOnRails
[15:59:06] Rodya_: has joined #RubyOnRails
[15:59:10] tuelz1: has joined #RubyOnRails
[16:01:03] apg: has joined #RubyOnRails
[16:01:03] apg: has joined #RubyOnRails
[16:01:09] mary5030: has joined #RubyOnRails
[16:02:03] annlewis: has joined #RubyOnRails
[16:02:47] ruurd: has joined #RubyOnRails
[16:02:53] mary5030: has joined #RubyOnRails
[16:03:15] tyl: has joined #RubyOnRails
[16:03:23] zpe: has joined #RubyOnRails
[16:06:17] Megamosaren: has joined #RubyOnRails
[16:08:36] arup_r: has joined #RubyOnRails
[16:09:23] nibbo: has joined #RubyOnRails
[16:09:29] centrx: has joined #RubyOnRails
[16:09:56] fedexo: has joined #RubyOnRails
[16:10:40] DanielN: has joined #RubyOnRails
[16:10:54] victortyau: has joined #RubyOnRails
[16:10:57] kies^: has joined #RubyOnRails
[16:11:57] ImmoveableOne: has joined #RubyOnRails
[16:14:02] momomomomo: has joined #RubyOnRails
[16:15:45] TheNet: has joined #RubyOnRails
[16:17:35] Bloomer: has joined #RubyOnRails
[16:17:48] gavit: Company has_many employees, is there a way to enumerate the employees of a company? aka, could I do mycompany.employees(3) or something similar?
[16:18:50] sarink: has joined #RubyOnRails
[16:18:58] gavit: hmm, apparently .first works
[16:19:45] bmalum_: has joined #RubyOnRails
[16:21:18] funkylaundry: has joined #RubyOnRails
[16:21:41] kitsuneyo: has joined #RubyOnRails
[16:22:10] chridal: has joined #RubyOnRails
[16:22:24] ELCALOR: has joined #RubyOnRails
[16:23:25] victortyau: has joined #RubyOnRails
[16:24:26] Aeyrix: has joined #RubyOnRails
[16:24:27] umgrosscol: has joined #RubyOnRails
[16:24:52] TheNet: has joined #RubyOnRails
[16:27:37] CanTonic: has joined #RubyOnRails
[16:28:48] atomical_: has joined #RubyOnRails
[16:28:49] MartinEl_: has joined #RubyOnRails
[16:29:09] cajone: has left #RubyOnRails: ()
[16:29:23] smathy: gavit, employees has a .each method on it too.
[16:29:53] cajone: has joined #RubyOnRails
[16:30:18] chridal: has joined #RubyOnRails
[16:30:44] disgrntld: has joined #RubyOnRails
[16:31:45] arthurix: has joined #RubyOnRails
[16:32:14] hhatch: has joined #RubyOnRails
[16:33:22] fgo: has joined #RubyOnRails
[16:34:15] Megamos: has joined #RubyOnRails
[16:34:34] apeiros: has joined #RubyOnRails
[16:34:37] abracadaniel: has joined #RubyOnRails
[16:35:24] The_Phoenix: has joined #RubyOnRails
[16:36:40] willardg: has joined #RubyOnRails
[16:37:18] gavit: smathy: not what i was looking for, but thanks
[16:38:14] momomomomo: has joined #RubyOnRails
[16:38:23] Cache_Money: has joined #RubyOnRails
[16:38:38] jxs_: has joined #RubyOnRails
[16:39:30] roshanavand: has joined #RubyOnRails
[16:39:53] gavit: my current_user is now associated with several companies. now in simple_form when I use association, but rather then Company.all I want it to associate with current_user.companies, will I have to specify this in all associations?
[16:40:02] EminenceHC: has joined #RubyOnRails
[16:40:10] AnoHito: has joined #RubyOnRails
[16:40:15] solars: has joined #RubyOnRails
[16:40:32] vanch: has joined #RubyOnRails
[16:40:37] jahbrewski: has joined #RubyOnRails
[16:40:46] Pupeno: has joined #RubyOnRails
[16:40:59] vanch: Hello, every1.
[16:42:51] vanch: What is the :person in <%= form_for :person do |f| %> expression? And how can this symbol has some fields? Why somewhere there is used @person, but else :person?
[16:43:05] Guest53: has joined #RubyOnRails
[16:43:20] atomical: has joined #RubyOnRails
[16:43:37] elaptics: gavit: you can just pass the collection you want, e.g. f.input :companies, collection: current_user.companies
[16:45:26] ivanskie: has joined #RubyOnRails
[16:46:13] njero: has joined #RubyOnRails
[16:46:25] vanch: elaptics, emm, I don't understand how symbols can be linked to objects, which are used in ror internal handling
[16:46:35] mrevd: has joined #RubyOnRails
[16:46:47] juhoh: has joined #RubyOnRails
[16:47:17] vanch: I'm even don't know how to ask :)
[16:47:53] mrevd: has left #RubyOnRails: ()
[16:48:24] juhoh: is it possible to inform between classes when an association is made from child to parent when child belongs to parent and parent has many children?
[16:48:28] A124: has joined #RubyOnRails
[16:48:38] juhoh: for example creation of child would notify the parent that the association has been made
[16:49:33] juhoh: without using callbacks from child that'd mutate the associated parent object
[16:49:48] nibbo: has joined #RubyOnRails
[16:51:17] juhoh: forget it, doesn't make sense at all. that would be exactly the same as using a callback within the child
[16:54:08] [Butch]: has joined #RubyOnRails
[16:55:43] cac: has joined #RubyOnRails
[16:56:21] EminenceHC: has joined #RubyOnRails
[16:58:02] relix: has joined #RubyOnRails
[16:58:48] bratsche: has joined #RubyOnRails
[16:58:56] cschneid_: has joined #RubyOnRails
[16:59:11] baweaver: has joined #RubyOnRails
[16:59:14] chridal: has joined #RubyOnRails
[16:59:39] darrencauthon: has joined #RubyOnRails
[17:00:52] Pupeno: has joined #RubyOnRails
[17:02:00] cac: has joined #RubyOnRails
[17:02:50] annlewis: has joined #RubyOnRails
[17:02:55] elaptics: vanch: the difference is about whether it can populate the values of the fields. If you only supply a symbol then it's just going to create the typical rails form structure, e.g. the form is going to scope the field names with, per your example "person". i.e. your name field would have a name attribute of person[name]
[17:03:32] jahbrewski: has joined #RubyOnRails
[17:03:34] elaptics: vanch: if you supply an actual person object then rails will assume that when you're saying name it should populate that name input with the result of calling the name attribute on the object
[17:04:43] willardg: has joined #RubyOnRails
[17:07:32] vanch: elaptics, eeemmm, thanks. I'll read this until I understand :)
[17:07:58] elaptics: vanch: easiest is to just try it out
[17:08:27] elaptics: vanch: test it with a simple edit/update
[17:08:38] njero: has joined #RubyOnRails
[17:09:03] baweaver: has joined #RubyOnRails
[17:09:09] vanch: elaptics, /me waiting for AWS account approval
[17:09:14] njero: has joined #RubyOnRails
[17:09:15] vanch: and i'll try
[17:09:19] chridal: has joined #RubyOnRails
[17:11:06] vanch: elaptics, and I think i should read about helpers
[17:12:12] aadam21: has joined #RubyOnRails
[17:12:24] arup_r: has joined #RubyOnRails
[17:12:43] vigintas1: has joined #RubyOnRails
[17:13:08] ahegyi: has joined #RubyOnRails
[17:13:15] mrchris: has joined #RubyOnRails
[17:15:36] EminenceHC: has joined #RubyOnRails
[17:15:38] towski_: has joined #RubyOnRails
[17:16:20] zpe: has joined #RubyOnRails
[17:16:26] mrchris: Could some one take a look at this paste and maybe enlighten me as to why its giving a NoMethodError http://pastie.org/private/mvr9m1uya5pmcomkfyusg
[17:17:12] ja: Hello people. Would you recommend I use ranked-model or acts_as_list? ranked-models sounds better since it's all ARel'd up, but I don't know...
[17:17:35] sarink: product.rb has_many :ingredients how do i say product.ingredients.pluck(<keys>) or product.ingredients.reject(<keys>) ?
[17:18:04] tbuehlmann: __chris, #kind is an instance method, you call a class method
[17:18:05] baweaver: has joined #RubyOnRails
[17:18:30] mrchris: thank you tbuehlmann
[17:18:42] __butch__: has joined #RubyOnRails
[17:19:36] sarink: i keep getting "undefined method pluck for #<Ingredient:0x..>"
[17:21:08] juhoh: has joined #RubyOnRails
[17:22:36] safety_cut: has joined #RubyOnRails
[17:23:33] foomanchu: has joined #RubyOnRails
[17:25:10] mooru: has joined #RubyOnRails
[17:26:53] udiudi: has joined #RubyOnRails
[17:27:39] sarink: Model.first.<what method do i call to select just some attributes??????????>
[17:28:33] recurrence: has joined #RubyOnRails
[17:29:35] safety_cut: has joined #RubyOnRails
[17:29:43] tbuehlmann: sarink, so Ingredient.first returns an ingredient. calling ingredient.attribute_name gets you the attribute with that name
[17:29:47] tbuehlmann: is that what you mean?
[17:30:03] sarink: tbuehlmann: i want all attributes except a blacklist
[17:30:15] sarink: Ingredient.first.reject() or something?
[17:30:18] tbuehlmann: so you don't want to retrieve them all from the db?
[17:30:31] njero: has joined #RubyOnRails
[17:30:33] sarink: ideally, yes
[17:30:53] tbuehlmann: Ingredient.select(list_of_attributes).first then
[17:31:09] t_silver: has joined #RubyOnRails
[17:31:16] purplexed-: has joined #RubyOnRails
[17:31:31] tbuehlmann: this will select the attributes mentionend and return an ingredient object with just these attributes
[17:31:32] marr: has joined #RubyOnRails
[17:31:40] nertzy: has joined #RubyOnRails
[17:31:58] sarink: tbuehlmann: my example was bad, it's actually a has_one, and i am on the other side of the relation
[17:32:23] sarink: so... say, um.... dog has_one :owner dog.owner.<get all attributes except for :last_name>
[17:32:41] umgrosscol: has joined #RubyOnRails
[17:33:12] tbuehlmann: I think you're doing it wrong. why do you want that?
[17:33:17] purplexed-: Hi all. I'm new to rails, and I'm having trouble with loading objects that have child objects: https://gist.github.com/sonicjolt/40c3198d66c3db5164df (if you need to see the migration scripts, they are here: https://gist.github.com/sonicjolt/4f9141e69b317dfc2220)
[17:33:24] Hates_: yeah, no reason to select all but one attribute
[17:33:50] sarink: i am trying to write a convenience function that returns only the attributes i care about
[17:33:52] sarink: for an API
[17:33:52] purplexed-: I think I might be missing maybe how to specify the foreign key constraint, or maybe I got the naming convention wrong..
[17:33:56] cornerma1: has joined #RubyOnRails
[17:34:00] sarink: and it's not just one attribute
[17:34:16] ja: purplexed-: I think it should be `server_group_id`, not `server_groups_id`
[17:34:25] sarink: we're talking about hundreds of statistics columns and i need to filter them down to just the ones that make sense for this context
[17:34:26] tbuehlmann: what ja says
[17:34:26] fgo: has joined #RubyOnRails
[17:34:31] tbuehlmann: also, it's ServerGroup.includes(:hosts) in your controller then
[17:34:36] sarink: in any case, is this possible?
[17:34:41] Guest53: has joined #RubyOnRails
[17:34:45] purplexed-: ja: so the constraint IS created for me, if I follow convention, correct ?
[17:34:48] ja: purplexed-: Also, you ought to use `t.references` instead of `t.integer`, I suppose
[17:35:18] tbuehlmann: or t.belongs_to (which is an alias), year
[17:35:25] ja: purplexed-: I'm almost certain it's not automatically created, but you can create it with t.references if you give it foreign_key: true
[17:35:26] sarink: tbuehlmann: i'm not doing it wrong, bc this is exactly what i need to do.
[17:36:01] tbuehlmann: sarink, you could also work with object.attributes.except, but well..
[17:36:03] purplexed-: ja: I see, .. thanks..
[17:36:13] infamos: has joined #RubyOnRails
[17:36:26] purplexed-: i'll try and recreate :)
[17:36:31] purplexed-: thansk for now
[17:36:56] agoldboi: has joined #RubyOnRails
[17:37:07] ja: purplexed-: no problem and good luck! :D
[17:37:14] FDostoyevsky: has joined #RubyOnRails
[17:37:19] Hates_: sarink: if it's for an api why not just override the as_json method
[17:37:31] Hates_: sarink: and filter what elements you want through that
[17:37:32] Guest53: has joined #RubyOnRails
[17:37:47] tbuehlmann: also an idea
[17:37:48] sarink: i was hoping to not grab all the items and then filter them
[17:37:55] The_Phoenix: has joined #RubyOnRails
[17:37:57] sarink: but only query the ones i want from the db
[17:38:12] sarink: maybe the logic should be placed elsewhere
[17:40:38] tyl: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[17:43:53] mikecmpbll: has joined #RubyOnRails
[17:46:43] Rodya_: has joined #RubyOnRails
[17:49:25] netzfisch: has joined #RubyOnRails
[17:49:53] purplexed-: ja: ohhh, I see now, I add it to the migration, AFTER the scaffolding
[17:50:10] djbkd: has joined #RubyOnRails
[17:50:51] MartinElvar: has joined #RubyOnRails
[17:52:32] mrtomme: has joined #RubyOnRails
[17:52:38] willardg: has joined #RubyOnRails
[17:53:22] Contigi: has joined #RubyOnRails
[17:56:00] sarink: tbuehlmann: what's the opposite of except?
[17:56:11] tbuehlmann: regarding a hash? slice
[17:56:32] juhoh: has joined #RubyOnRails
[17:56:34] robbyoconnor: has joined #RubyOnRails
[17:56:58] User458764: has joined #RubyOnRails
[17:57:34] Aherin: has joined #RubyOnRails
[17:57:43] ruurd: has joined #RubyOnRails
[17:57:57] Spami: has joined #RubyOnRails
[17:58:43] renews: has joined #RubyOnRails
[17:59:28] kalusn: has joined #RubyOnRails
[17:59:58] lemur: has joined #RubyOnRails
[18:00:14] Rodya_: has joined #RubyOnRails
[18:01:10] TheNet: has joined #RubyOnRails
[18:01:32] jas02: has joined #RubyOnRails
[18:01:55] rakm: has joined #RubyOnRails
[18:03:37] annlewis: has joined #RubyOnRails
[18:04:59] railsknight: has joined #RubyOnRails
[18:05:15] jobewan: has joined #RubyOnRails
[18:05:16] A124: has joined #RubyOnRails
[18:07:18] czerasz: has joined #RubyOnRails
[18:09:20] shinnya: has joined #RubyOnRails
[18:10:30] Maletor: has joined #RubyOnRails
[18:11:28] arthurix_: has joined #RubyOnRails
[18:13:35] aadam21: has joined #RubyOnRails
[18:14:31] purplexed-: ja: thanks again, that really helped me.. got it running
[18:17:56] romdi: has joined #RubyOnRails
[18:18:02] Spami: has joined #RubyOnRails
[18:19:05] northfurr: has joined #RubyOnRails
[18:19:28] ellisTAA: has joined #RubyOnRails
[18:19:36] dikaio: has joined #RubyOnRails
[18:19:55] ellisTAA: i???m building an api, and i???m trying to do tdd ??? should i put my tests in spec/requests instead of spec/controller?
[18:20:35] tbuehlmann: I prefer request specs over controller specs
[18:21:29] ellisTAA: tbuehlmann: cool
[18:21:33] ellisTAA: tbuehlmann: ty
[18:21:37] RegulationD: has joined #RubyOnRails
[18:21:37] SteenJobs: has joined #RubyOnRails
[18:22:11] Megamos: has joined #RubyOnRails
[18:23:19] yfeldblum: has joined #RubyOnRails
[18:24:09] Guest53: has joined #RubyOnRails
[18:25:35] Maletor: has joined #RubyOnRails
[18:25:41] chridal: has joined #RubyOnRails
[18:26:27] bdnelson: has joined #RubyOnRails
[18:26:56] roshanavand: has joined #RubyOnRails
[18:27:48] User458764: has joined #RubyOnRails
[18:27:56] willywos: has joined #RubyOnRails
[18:28:13] closer: has joined #RubyOnRails
[18:28:32] RegulationD: has joined #RubyOnRails
[18:30:43] Rodya_: has joined #RubyOnRails
[18:31:13] smathy: EllisTAA, request and controller specs are different.
[18:31:25] smathy: EllisTAA, so don't just put controller specs in spec/requests
[18:31:36] Pupeno: has joined #RubyOnRails
[18:31:45] roshanavand: has joined #RubyOnRails
[18:32:33] cluda01: has joined #RubyOnRails
[18:34:01] SteenJobs: has joined #RubyOnRails
[18:34:13] roshanavand: has joined #RubyOnRails
[18:35:23] tbuehlmann: I have to add that controller specs won't be encouraged using rails 5
[18:35:33] fgo: has joined #RubyOnRails
[18:36:00] DEA7TH: has joined #RubyOnRails
[18:36:21] ellisTAA: smathy: gotcha. since i???m testing the request & not the controller would i keep everything on line 3 and just change type to request? https://gist.github.com/ellismarte/cfe410d85028fa33345f#file-gistfile1-txt-L3
[18:36:58] recurrence: has joined #RubyOnRails
[18:37:33] kalusn: has joined #RubyOnRails
[18:39:07] th0m__: has joined #RubyOnRails
[18:40:28] tetraktys: has joined #RubyOnRails
[18:42:10] Spami: has joined #RubyOnRails
[18:43:54] ur5us: has joined #RubyOnRails
[18:43:57] Spami: has joined #RubyOnRails
[18:45:30] asianMike: has joined #RubyOnRails
[18:45:36] dikaio: has joined #RubyOnRails
[18:50:04] Rodya_: has joined #RubyOnRails
[18:50:28] blackmesa: has joined #RubyOnRails
[18:53:47] ruurd: has joined #RubyOnRails
[18:54:38] TheNet: has joined #RubyOnRails
[18:54:39] smathy: EllisTAA, you usually name/described a request spec after the workflow that you're testing, as is demonstrated in the rspec docs: https://www.relishapp.com/rspec/rspec-rails/v/3-3/docs/request-specs/request-spec
[18:55:38] jas02: has joined #RubyOnRails
[18:56:16] mrbubbles: has joined #RubyOnRails
[18:56:48] TheNet: has joined #RubyOnRails
[18:59:00] willardg: Anyone have experience with rbenv?
[18:59:26] dionysus69: has joined #RubyOnRails
[18:59:28] SteenJobs: has joined #RubyOnRails
[18:59:36] willardg: Not sure if there's a better channel for this topic.
[18:59:49] slash_part: probably a fine place... #ruby might be better
[19:00:00] dionysus69: has joined #RubyOnRails
[19:00:18] purplexed-: hi all. I'm using a a helper to generate a link to a resource. <%= link_to h.name, hosts_path(h)%> .. now in the documentation it says it should link to http://<site>/resource/<id>, but instead it links to http://<site>/resource.<id> --- is this correct ?
[19:00:32] chridal: has joined #RubyOnRails
[19:00:40] Pupeno: has joined #RubyOnRails
[19:00:47] lemur: has joined #RubyOnRails
[19:00:48] willardg: http://codeshare.io/SKxrk
[19:01:22] tbuehlmann: purplexed-, can you gist your routes?
[19:01:27] Rodya_: has joined #RubyOnRails
[19:01:33] tbuehlmann: ah, sorry, misread
[19:01:35] willardg: It thinks that I don't have 2.0.0 installed
[19:01:44] tbuehlmann: hosts_path(h) should be just h
[19:03:04] purplexed-: tbuehlmann: yes, that fixed it :)
[19:03:57] The_Phoenix: has joined #RubyOnRails
[19:04:09] jahbrewski: has joined #RubyOnRails
[19:04:24] annlewis: has joined #RubyOnRails
[19:05:14] bahar: has joined #RubyOnRails
[19:06:01] Axsuul: has joined #RubyOnRails
[19:06:08] mag42c: has joined #RubyOnRails
[19:07:49] hahuang65: has joined #RubyOnRails
[19:09:28] lucianosousa: has joined #RubyOnRails
[19:10:16] tubbo: willardg: you don't. you have, e.g., 2.0.0-p647 installed.
[19:10:20] chridal: has joined #RubyOnRails
[19:10:29] tubbo: and i'm not 100% on whether rbenv will just pick the highest patch version
[19:10:32] recurrence_: has joined #RubyOnRails
[19:11:42] harishreddy: has joined #RubyOnRails
[19:11:53] axl_: has joined #RubyOnRails
[19:13:54] ruurd: has joined #RubyOnRails
[19:14:04] nfk: has joined #RubyOnRails
[19:15:09] willardg: tubbo, the problem is that they don't really have just a 2.0.0
[19:15:20] chridal: has joined #RubyOnRails
[19:15:29] roshanavand: has joined #RubyOnRails
[19:15:36] netzfisch: has joined #RubyOnRails
[19:15:41] tubbo: willardg: so why not change your .ruby-version to 2.0.0-p647?
[19:15:46] dnewkerk: has joined #RubyOnRails
[19:16:04] aadam21: has joined #RubyOnRails
[19:17:50] ellisTAA: if i have a method called authenticate that takes an email, password for both new users and existing users, but i want to take address for new users, would i expect all arguments to come in the options hash? https://gist.github.com/ellismarte/aedfdd0dad2a17ef0c34
[19:19:44] yardenbar: has joined #RubyOnRails
[19:19:46] ddv: EllisTAA, the method is called authenticate, so let it do authentication and nothing more
[19:19:51] jkamenik1: has joined #RubyOnRails
[19:20:00] ellisTAA: ddv: boss said it does both
[19:20:13] ddv: EllisTAA, your boss is clueless
[19:21:20] atmosx: Is there any gem that will help generate seed data?
[19:21:26] tubbo: EllisTAA: what exactly is your question?
[19:21:40] tubbo: atmosx: seed_fu, but honestly i never found it super helpful.
[19:21:41] atmosx: I had factory girl in mind, but then https://robots.thoughtbot.com/factory_girl-for-seed-data
[19:22:06] dikaio: has joined #RubyOnRails
[19:22:06] atmosx: tubbo: so, you're saying it's better try my vim fu and manually create a huge seed file>
[19:22:09] ddv: atmosx, https://www.ruby-toolbox.com/categories/rails_db_bootstrapping
[19:22:22] EminenceHC: has joined #RubyOnRails
[19:22:28] ellisTAA: tubbo: i think i found the answer. i was asking to i make all arguments optional or just the optional one ??? sounds kinda dumb when i write it
[19:22:38] tubbo: atmosx: i like using fixtures for initial seed data, as much as i can.
[19:23:09] renews: has joined #RubyOnRails
[19:23:14] jkamenik: has joined #RubyOnRails
[19:23:17] apotry: has joined #RubyOnRails
[19:23:22] tubbo: EllisTAA: probably easier to use either the options hash or keyword arguments
[19:23:49] Jasaka: has joined #RubyOnRails
[19:26:09] atmosx: tubbo: I think I'll follow your advice
[19:26:29] lacrymology: has joined #RubyOnRails
[19:26:44] arup_r: When using 1.2.3 Deploy Keys ( http://capistranorb.com/documentation/getting-started/authentication-and-authorisation/ ) to communicate my server and github repo, how should I mention in Capistrano deploy.rb file the passphrase that I used to generate the SSH key ?
[19:27:18] arup_r: without passphrase server user wouldn't be able to clone from github
[19:28:29] ddv: arup_r, we don't use passphrases
[19:28:30] rhizome: arup_r: for capistrano there's really no reason to use keys with passphrases
[19:28:34] tubbo: arup_r: "Deploy keys are usually not protected by a passphrase, making the key easily accessible if the server is compromised." https://developer.github.com/guides/managing-deploy-keys/
[19:29:05] wcalderipe: has joined #RubyOnRails
[19:29:13] arup_r: I created the key using passphrase already..
[19:29:31] hahuang65: has joined #RubyOnRails
[19:29:32] arup_r: and the public get copied to the repo deply key section
[19:29:33] rhizome: if an attacker can get the key, they can get the passphrase conveniently recorded in deploy.rb
[19:29:34] smathy: Authenticate Non-Existing Users: when good code attacks.
[19:29:40] ddv: arup_r, recreate it
[19:29:49] rhizome: make a new one
[19:30:09] tuelz1: has joined #RubyOnRails
[19:30:18] arup_r: I was following a blog they said please use passphrase :/
[19:30:25] arup_r: they lie ..
[19:30:29] rhizome: what blog?
[19:30:33] nertzy: has joined #RubyOnRails
[19:30:36] arup_r: Linode blog
[19:30:43] tubbo: arup_r: link plz
[19:30:44] arup_r: They specifically mentioned to do it
[19:30:51] atmosx: arup_r: https://stackoverflow.com/questions/3269578/capistrano-asks-for-password-when-deploying-despite-ssh-keys#3643914 will this do?
[19:30:53] arup_r: sure tubbo I don't lie
[19:31:10] tubbo: arup_r: that's not what i was implying. i'm implying that you read the wrong information, because SSH is not cut and dry.
[19:31:23] ss_much: has joined #RubyOnRails
[19:31:53] arup_r: Generating Keys ( https://www.linode.com/docs/security/use-public-key-authentication-with-ssh )
[19:32:17] rhizome: yeah that's for ssh keys in general
[19:32:19] tubbo: arup_r: so "generating an SSH key" in that article is probably referring to your own personal SSH id_rsa key
[19:32:20] annlewis: has joined #RubyOnRails
[19:32:21] rhizome: for cap, no pw
[19:32:36] rhizome: for your personal use, yes pw
[19:32:53] tubbo: kinda like the difference between .bashrc and .bash_profile
[19:33:13] tubbo: one of which is meant to be run all the time, the other is only run when you're a human logging in
[19:33:19] ahegyi_: has joined #RubyOnRails
[19:33:20] arup_r: double work for me.. hehehe
[19:33:27] meoblast001: has joined #RubyOnRails
[19:33:49] atmosx: arup_r: run this command: ssh-add ~/.ssh/id_rsa
[19:33:59] atmosx: arup_r: then try running capistran, does it ask for you a password?
[19:34:03] arup_r: in Server
[19:34:04] lacrymology: params.require(:a_model).permit(:foo, :bar) makes a_model mandatory, and a_model.foo and a_model.bar optional, right?
[19:34:13] lacrymology: how do I make a_model.foo mandatory?
[19:34:28] atmosx: arup_r: no, in desktp
[19:34:44] atmosx: where is your key?
[19:35:01] nogic: has joined #RubyOnRails
[19:35:02] arup_r: atmosx: Inside the server I tried to clone the repo to test if deploy key is working fine or not. and then it ask me passphrase reason is "ME" .. desktop is fine..
[19:35:16] [Butch]: has joined #RubyOnRails
[19:35:43] arup_r: atmosx: I connect to server using my pub key placed in authorization key and then server connect to github using deploy key
[19:35:49] arup_r: there I did some mistake
[19:35:54] arup_r: I am going to recreate it
[19:35:58] tubbo: arup_r: you know github has a UI for creating this stuff right?
[19:36:14] tubbo: arup_r: if you're actually using github, there's a whole page in your repo settings for managing deploy keys
[19:36:14] djbkd: has joined #RubyOnRails
[19:36:34] arup_r: yes, I know but that is to add the key there.
[19:36:36] fgo: has joined #RubyOnRails
[19:36:46] smathy: lacrymology, you sure you need a_model.foo mandatory? It's almost always better to just handle that as validation within your model.
[19:36:48] tubbo: arup_r: https://github.com/aruprakshit/definitely_a_working_rails_app/settings/keys
[19:36:53] arup_r: but I need now to create another ssh key without paasphrase
[19:37:05] lacrymology: smathy: ok, didn't know that bit
[19:37:18] tubbo: arup_r: oh wait, sorry about that...thought that page actually created the key for you
[19:37:20] tubbo: never mind :P
[19:37:21] conta: has joined #RubyOnRails
[19:37:38] tubbo: arup_r: please follow the github guide, and nothing else. https://developer.github.com/guides/managing-deploy-keys/
[19:37:43] ruurd: has joined #RubyOnRails
[19:37:43] tubbo: it literally tells you, step by step, how to do this
[19:38:03] arup_r: yes, that is what I followed.. I now know what to do.. just double "work"
[19:38:07] tubbo: oh true ok
[19:38:50] gavit: where do gems place their files?
[19:38:58] mloy_: has joined #RubyOnRails
[19:39:13] tubbo: gavit: wherever your BUNDLE_PATH tells them to.
[19:39:20] jlebrech: has joined #RubyOnRails
[19:39:27] tubbo: gavit: if you're using bundler, otherwise RubyGems puts them in GEM_HOME
[19:39:28] gavit: I'm trying to add https://github.com/ict4g/toastr-rails-sass but it can't find @import 'toastr.min')
[19:39:58] tubbo: gavit: what if you just use @import 'toastr';?
[19:40:07] DasLumberJackYa: has joined #RubyOnRails
[19:40:21] gavit: tubbo: same :(
[19:40:22] build22_: has joined #RubyOnRails
[19:40:32] tetraktys: has joined #RubyOnRails
[19:40:35] tubbo: gavit: did you restart your server?
[19:41:02] gavit: good call ;)
[19:41:09] tubbo: i don't understand why people package minified versions of libraries in sprockets gems. it's the dumbest shit in the world.
[19:41:24] tubbo: sprockets does that for you already
[19:41:57] atmosx: arup_r: enable forwarding on your cap file: set :ssh_options, {:forward_agent => true}
[19:42:27] gavit: lol gem 'toastr-rails-sass'
[19:42:39] gavit: Your Gemfile requires gems that depend on each other, creating an infinite loop. Please remove gem 'toastr-rails-sass' and try again.
[19:42:40] infamos: has joined #RubyOnRails
[19:42:41] arup_r: atmosx: I had a worst time with agent forwarding.. last time.. so this time I am going to use deploy key
[19:43:01] atmosx: arup_r: do whatever suits you best ;-)
[19:43:56] Coldblackice: has joined #RubyOnRails
[19:44:26] kies^: has joined #RubyOnRails
[19:46:28] lacrymology: params.inspect: {"device_group"=>{"name"=>"foo", "description"=>"bar"}} DeviceGroup.new(params.require(:device_group).permit(:name, :description, :device_ids)), this is throwing ForbiddenAttributesError
[19:47:33] MartinElvar: has joined #RubyOnRails
[19:47:36] gavit: just gonna try tylergannon/toastr-rails and hope it works with sass
[19:47:58] smathy: lacrymology, you've got an attr_accessible in your model.
[19:50:37] lucianosousa: has joined #RubyOnRails
[19:51:01] mloy_: has joined #RubyOnRails
[19:52:16] wethu: has joined #RubyOnRails
[19:53:04] VeryBewitching: has joined #RubyOnRails
[19:54:36] Galas: has joined #RubyOnRails
[19:55:42] manfrin: has joined #RubyOnRails
[19:57:22] Guest53: has joined #RubyOnRails
[19:58:15] dikaio: has joined #RubyOnRails
[19:58:45] mooru: has joined #RubyOnRails
[19:59:12] youngbaks: has joined #RubyOnRails
[20:02:19] thither: has joined #RubyOnRails
[20:03:02] hardtail: has joined #RubyOnRails
[20:03:52] thither: Hey, I'm getting this weird error when tring to seed my database. http://pastie.org/private/pentzezz2mlp2m7l9kf2dg
[20:03:56] iateadonut: has joined #RubyOnRails
[20:04:20] thither: rake seems to think that imports is an array, but it is a hash (I confirmed this with byebug)
[20:04:43] northfurr: has joined #RubyOnRails
[20:05:19] Pazician_: has joined #RubyOnRails
[20:06:42] ivanskie: has joined #RubyOnRails
[20:08:14] tbuehlmann: when using .map, you get an array
[20:08:19] VeryBewitching: thither: It becoms an array
[20:09:04] thither: Huh, I dropped to an irb and was told that imports was a Hash still
[20:09:09] stamina: has joined #RubyOnRails
[20:09:15] thither: How do you map a hash to a hash then
[20:09:35] VeryBewitching: thither: thitherhttps://gist.github.com/bewitchingme/8a87f6ccf3f0f1b7ec84
[20:09:41] VeryBewitching: https://gist.github.com/bewitchingme/8a87f6ccf3f0f1b7ec84
[20:09:46] rakm: has joined #RubyOnRails
[20:10:23] thither: so hash.each.lamba{|k,v| hash[k] = true} ?
[20:10:29] FailBit: VeryBewitching: I think you wanted k => true
[20:10:59] VeryBewitching: FailBit: That was his code as an example so he could see the structure of the returned map
[20:11:54] VeryBewitching: Ah, kernel update, reboot time, bbiab
[20:13:10] SteenJobs: has joined #RubyOnRails
[20:14:00] inate: has joined #RubyOnRails
[20:14:09] tbuehlmann: keep in mind that altering a collection while iterating is undefined behaviour
[20:15:28] bvbrandon: has joined #RubyOnRails
[20:15:34] tbuehlmann: but you're not doing that, really, all good
[20:15:59] bvbrandon: if I add a gem to my gemfile and run bundle install, it should be placed in my vendor folder, correct?
[20:16:24] FailBit: if you add a gem to your gemfile and install, it either has a railtie or you need to require it manually to be able to use it in your app
[20:16:48] borodin: has joined #RubyOnRails
[20:16:49] aadam21: has joined #RubyOnRails
[20:17:07] kadoppe: has joined #RubyOnRails
[20:17:17] bvbrandon: ooh snap, so how do I require it manually?
[20:17:21] borodin: has joined #RubyOnRails
[20:17:30] bvbrandon: in my gemfile.lock?
[20:17:38] FailBit: require 'project'
[20:17:52] FailBit: you can also ask bundler to require the gem for you
[20:18:15] bvbrandon: how do I ask bundler to require it?
[20:19:02] northfurr_: has joined #RubyOnRails
[20:19:10] FailBit: actually, it is loaded by default
[20:19:39] FailBit: whether it is available to your app code normally depends on whether it has a railtie
[20:19:41] nertzy: has joined #RubyOnRails
[20:19:44] FailBit: this is where ruby gets annoying
[20:19:52] jas02: has joined #RubyOnRails
[20:20:34] tbuehlmann: as you said, the gems from your Gemfile are required by default, no need to do that yourself
[20:21:47] bvbrandon: ok heres the question, my gemfile says this gem 'ckeditor', '~> 4.1', '>= 4.1.4'
[20:21:47] jessemcgilallen: has joined #RubyOnRails
[20:21:49] baweaver: has joined #RubyOnRails
[20:22:13] bvbrandon: but after running bundle install, none of the assets from that gem exist in my project
[20:22:28] Maletor: has joined #RubyOnRails
[20:22:29] bvbrandon: I???m not getting an error and bundler is ssaying it???s installing the gem
[20:22:34] tbuehlmann: bvbrandon, did you follow the install instructions? have you added something to your application.js?
[20:22:37] VeryBewitching: has joined #RubyOnRails
[20:22:56] bvbrandon: ??????.I dont have one of those
[20:23:16] tbuehlmann: bvbrandon, just installing the gem is not enough
[20:24:17] tbuehlmann: https://github.com/galetahub/ckeditor
[20:24:31] tbuehlmann: have a look at the usage section
[20:24:36] yfeldblum: has joined #RubyOnRails
[20:24:55] bvbrandon: isn???t that j ust requireing a file that should already be installed?
[20:25:23] bvbrandon: /= require ckeditor/init
[20:25:24] VeryBewitching: bvbrandon: Adding the gem makes the file available to the asset pipeline, you still have to require it.
[20:25:36] bvbrandon: thats looking for a file called init.js right?
[20:25:49] bvbrandon: thats the way I understand it at least
[20:25:49] xploshioon: has joined #RubyOnRails
[20:25:55] tbuehlmann: I recommend reading http://guides.rubyonrails.org/asset_pipeline.html
[20:26:56] bvbrandon: yes, so it is looking for ckekditor/init.js
[20:27:04] bvbrandon: that file does not exist in my project
[20:27:35] bvbrandon: so the usage says, after installing the gem, I should require that file. I installed the gem and don???t have that file. That???s what I am trying to figure out
[20:27:51] tbuehlmann: bvbrandon, the gem has that file: https://github.com/galetahub/ckeditor/blob/a69dcdbe0babbd49085e9dc17efffc63297ab0b4/app/assets/javascripts/ckeditor/init.js.erb
[20:29:00] rubyonrailed: has joined #RubyOnRails
[20:29:14] bvbrandon: heres my origional question
[20:29:15] bvbrandon: if I add a gem to my gemfile and run bundle install, it should be placed in my vendor folder, correct?
[20:29:24] VeryBewitching: bvbrandon: +1 on reading about the asset pipeline before you use this gem.
[20:29:30] tbuehlmann: bvbrandon, no
[20:29:41] arup_r: has joined #RubyOnRails
[20:30:13] bvbrandon: when I search the entire project, there is no init.js
[20:30:17] recurrence: has joined #RubyOnRails
[20:30:26] VeryBewitching: bvbrandon: Adding the gem to your Gemfile causes bundler to make this gem available to your application. You *still* have to configure the application to make use of it. ckeditor/init is stored in the gem
[20:30:36] tvw: has joined #RubyOnRails
[20:30:43] tbuehlmann: bvbrandon, the gem is installed somewhere (check $ bundle show ckeditor). that's where that file is located
[20:30:46] VeryBewitching: bvbrandon: It's not part of *your* application, it's provided via the asset pipeline to it
[20:30:51] tbuehlmann: rails checks that directory for files, too
[20:31:10] bvbrandon: *realizes how dumb he is*
[20:31:22] willardg: has joined #RubyOnRails
[20:31:28] bvbrandon: I???ll be reading that link now
[20:31:31] hahuang65: has joined #RubyOnRails
[20:31:37] VeryBewitching: bvbrandon: Everything is arcane until it's mundane, don't stress out about it. :D
[20:31:47] bvbrandon: lol, thats a good one
[20:32:04] vigintas: has joined #RubyOnRails
[20:34:34] duncannz: has joined #RubyOnRails
[20:37:15] srinidhi: has joined #RubyOnRails
[20:37:18] naftilos76: has joined #RubyOnRails
[20:37:25] gavit: why is sass so badly supported. is it losing to less?
[20:38:00] fgo: has joined #RubyOnRails
[20:38:01] matt_d: gavit: is it? i don't feel that way.
[20:38:12] VeryBewitching: Losing to Less?
[20:38:29] gavit: matt_d: maybe my bad luck, I just googled it to see and you seem to be right that sass is more widely used
[20:38:37] annlewis: has joined #RubyOnRails
[20:40:50] renews: has joined #RubyOnRails
[20:40:56] blackmesa: has joined #RubyOnRails
[20:41:01] cac: has joined #RubyOnRails
[20:41:06] lipoqil: has joined #RubyOnRails
[20:41:09] naftilos76: Hi i am on rails 4.2 and i want to validate presence based on the value of an attribute. Here is what i did but does not work: validates_presence_of :source, :record_type, :target, :ttl if Proc.new {|dns_record| dns_record.record_type == "A"} . This validation should work only if dns_record.record_type equals "A" but instead it works on every other circumstance.
[20:41:25] ellisTAA: has joined #RubyOnRails
[20:42:01] naftilos76: How am i suppose to validate presence based on the content of an attribute?
[20:42:46] momomomomo: has joined #RubyOnRails
[20:43:07] wethu: has joined #RubyOnRails
[20:43:17] gavit: naftilos76: validate on presense and format?
[20:43:24] nogic: has joined #RubyOnRails
[20:43:32] FailBit: VeryBewitching: I always use ksplice
[20:43:36] reber: has joined #RubyOnRails
[20:43:46] FailBit: currently up 57 days, 1:41
[20:43:49] gavit: naftilos76: or acceptance
[20:43:53] naftilos76: gavit, i want to start with presence and then i will see
[20:43:54] FailBit: for kernel updates
[20:43:55] gavit: naftilos76: http://guides.rubyonrails.org/active_record_validations.html#acceptance
[20:43:56] FailBit: I use ksplice
[20:44:10] VeryBewitching: FailBit: On your workstation?
[20:44:15] gavit: naftilos76: you want it to fail on NON 'A; right?
[20:44:46] VeryBewitching: gavit: No, he wants it to fail if source, record_type, target and ttl are not present if record_type is a
[20:44:59] VeryBewitching: FailBit: I guess you never shut your PC down? :D
[20:45:06] naftilos76: gavit, i want validation on "A" and ignore validation on every other case
[20:45:26] FailBit: VeryBewitching: exactly
[20:45:30] FailBit: I use it to run my bouncer, in fact
[20:45:51] meoblast001: has joined #RubyOnRails
[20:45:56] VeryBewitching: FailBit: ksplice does look interesting.
[20:46:19] gavit: naftilos76: STI
[20:46:53] VeryBewitching: naftilos76: Write a custom validation method, probably the most direct solution.
[20:47:01] gavit: naftilos76: that will allow you to test on acceptance for a 'subclass'
[20:47:26] VeryBewitching: validate :a_type_presence
[20:47:37] tetraktys: has joined #RubyOnRails
[20:47:38] naftilos76: i am not sure i hve to do that, all i want is to use if with proc
[20:47:49] doctorly: has joined #RubyOnRails
[20:47:55] gavit: naftilos76: VeryBewitching makes a good suggestion too
[20:47:57] VeryBewitching: naftilos76: The class method is being called on the class, not on your instance
[20:48:42] VeryBewitching: naftilos76: validates_presence_of is a class method, you need to write a method to check values on the instance.
[20:48:45] doctorly: I am getting an error "can't write unknown attribute" when trying to use a virtual attribute. I am having a hard time finding an up to date guide on virtual attributes. Can someone link me?
[20:49:00] tbuehlmann: VeryBewitching, I'd have said it should work as is
[20:49:46] VeryBewitching: tbuehlmann: Then I'm quite terribly confused. Can you explain how it would work the way it is?
[20:50:00] tbuehlmann: the proc is called on the instance
[20:50:08] tbuehlmann: will check..
[20:50:24] Pupeno: has joined #RubyOnRails
[20:50:39] VeryBewitching: He's not using :if or :unless, he's using if
[20:51:12] tbuehlmann: oh, didn't see that, good catch
[20:51:17] tbuehlmann: then you're absolutely right
[20:51:29] FailBit: errything is klass
[20:51:41] VeryBewitching: http://guides.rubyonrails.org/active_record_validations.html#using-a-symbol-with-if-and-unless
[20:52:07] FailBit: even if you are not in any scope
[20:52:14] FailBit: self.class.to_s => Object
[20:52:46] TheNet: has joined #RubyOnRails
[20:53:06] VeryBewitching: naftilos76: You can use a Proc with :if, you have a slight change to make and it should work.
[20:53:25] VeryBewitching: brb, time for a smoke
[20:54:01] naftilos76: VeryBewitching, i am trying if with proc . It should work. I am not trying to do anything weird. :)
[20:54:20] ur5us: has joined #RubyOnRails
[20:54:50] tbuehlmann: naftilos76, change "if" to "if:", that's it
[20:55:31] naftilos76: tbuehlmann, yes this was the culprit
[20:56:06] Z00t: has joined #RubyOnRails
[20:56:40] vanch: has joined #RubyOnRails
[20:58:31] tds5016: has joined #RubyOnRails
[20:58:47] darrencauthon: has joined #RubyOnRails
[20:59:05] ivanskie: has joined #RubyOnRails
[20:59:16] willardg: has joined #RubyOnRails
[20:59:36] TheNet: has joined #RubyOnRails
[20:59:37] blackmesa: has joined #RubyOnRails
[21:00:48] dikaio: has joined #RubyOnRails
[21:01:09] momomomomo: has joined #RubyOnRails
[21:02:16] lemur: has joined #RubyOnRails
[21:04:03] rakm: has joined #RubyOnRails
[21:04:14] chridal: has joined #RubyOnRails
[21:05:46] EdwardIII: has joined #RubyOnRails
[21:08:29] RegulationD: has joined #RubyOnRails
[21:08:37] arup_r: I am seeing a link ( http://corlewsolutions.com/articles/article-10-how-to-deploy-rails-applications-using-capistrano-3-1-and-windows-7 ) and here it mentioned **the secrets.yml file does not be to be added because it does not need to exist on the production server.**
[21:08:41] arup_r: Is it true ?
[21:10:02] Rodya_: has joined #RubyOnRails
[21:10:13] bvbrandon: has joined #RubyOnRails
[21:10:21] robbyoconnor: has joined #RubyOnRails
[21:12:02] tbuehlmann: arup_r, have you tried?
[21:12:11] ahegyi_: has joined #RubyOnRails
[21:12:26] arup_r: No. I am seeting up something by reading lot of blogs..
[21:12:28] rakm: has joined #RubyOnRails
[21:12:38] arup_r: so asked.. here because it seems to odd me
[21:12:40] tbuehlmann: I suggest you simply try
[21:13:50] arup_r: tbuehlmann: That line stop me to do something. I thought of to put the file .gitignore and when I saw it, and I felt, "Ahh then I don't need"
[21:13:59] vanch: has left #RubyOnRails: ()
[21:14:11] s2013: has joined #RubyOnRails
[21:14:46] Coldblackice: has joined #RubyOnRails
[21:14:47] chouhoulis: has joined #RubyOnRails
[21:15:02] tbuehlmann: what's the question? running a rails app without a secrets.yml at all? or having a repo with that file being in .gitignore?
[21:16:46] jas02: has joined #RubyOnRails
[21:17:02] Spami: has joined #RubyOnRails
[21:17:47] arup_r: ok. He said, we don't need that for production. so I will keep the secret.yml as it is now. which is being tracked by Git. Now if it says we need it for production, then I will remove the file from version control and create a file in the shared/ folder and add the production key there.. so that way I will keep the secret things secreat
[21:18:29] arup_r: I will keep in source code like secret.yml.example...
[21:18:42] aadam21: has joined #RubyOnRails
[21:18:47] tetraktys: has joined #RubyOnRails
[21:18:58] mooru: has joined #RubyOnRails
[21:19:13] lacrymology: has joined #RubyOnRails
[21:19:35] lacrymology: has joined #RubyOnRails
[21:19:46] bvbrandon_: has joined #RubyOnRails
[21:20:53] oded_: has joined #RubyOnRails
[21:21:02] mooru: has joined #RubyOnRails
[21:23:24] naftilos76: tbuehlmann, this : validates_presence_of :source, :record_type, :target, :ttl, if: Proc.new {|d| ["A","AAA","NS","CNAME","PTR","TXT"].index(d.record_type) } works beautifully :)
[21:23:47] EdwardIII: has joined #RubyOnRails
[21:24:34] tbuehlmann: I think you don't even need the |d|
[21:25:41] bvbrandon: has joined #RubyOnRails
[21:25:48] Palsson: has joined #RubyOnRails
[21:26:49] rubyonrailed: has joined #RubyOnRails
[21:27:02] infamos: has joined #RubyOnRails
[21:28:59] dikaio: has joined #RubyOnRails
[21:29:15] axl__: has joined #RubyOnRails
[21:30:08] SteenJobs: has joined #RubyOnRails
[21:34:07] teclator: has joined #RubyOnRails
[21:37:04] willardg: has joined #RubyOnRails
[21:37:41] trosborn: has joined #RubyOnRails
[21:37:42] mloy: has joined #RubyOnRails
[21:38:46] gaussblurinc1: has joined #RubyOnRails
[21:38:52] fgo: has joined #RubyOnRails
[21:39:01] naftilos76: tbuehlmann, thanks! That looks even cooler. It wasn't in the guides. Procs i used in the past always included the |x| part.
[21:39:22] ur5us: has joined #RubyOnRails
[21:39:25] annlewis: has joined #RubyOnRails
[21:40:04] Glenny: has joined #RubyOnRails
[21:40:52] qejk: has joined #RubyOnRails
[21:41:35] renews: has joined #RubyOnRails
[21:41:53] EminenceHC: has joined #RubyOnRails
[21:42:09] slash_part: can someone help me get my spinner working right?... it's supposed to be david spade: https://drive.google.com/file/d/0B76vDRCAdXZHYzFkLTRSeG41bG8/view?usp=sharing
[21:42:17] bvbrandon: has joined #RubyOnRails
[21:42:30] shibabu: has joined #RubyOnRails
[21:43:37] jahbrewski: has joined #RubyOnRails
[21:44:03] SteenJobs: has joined #RubyOnRails
[21:45:19] mordocai: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[21:45:30] nickjj_: has joined #RubyOnRails
[21:46:20] s2013: hello. having some issue.. Lead.group(:code).order('count_id desc').count('id') returns me list of codes ordered from highest to lowest.. but how do i limit that result to the top 10
[21:47:25] oded__: has joined #RubyOnRails
[21:47:44] sinkensabe: has joined #RubyOnRails
[21:48:40] shock_one: has joined #RubyOnRails
[21:49:23] tubbo: s2013: guess
[21:49:30] s2013: dont know.. limit doesnt work
[21:49:34] tubbo: s2013: oh never mind :D
[21:49:38] tubbo: was gonna say limit()
[21:49:52] tubbo: s2013: are you seeing 'LIMIT 10' anywhere in your query?
[21:50:01] tubbo: ohh wait maybe that won't work with a GROUP BY
[21:50:10] Sigma00: s2013: you can add .to_sql() to see the query it generates
[21:50:20] s2013: yeah limit wont work
[21:50:23] s2013: i can add limit before it
[21:50:38] s2013: cause i basically want the top 10 codes
[21:50:46] tubbo: s2013: can you post the query that it generates with .limit(10) on the end?
[21:50:49] s2013: maybe there is a better way to do it than what im doing
[21:50:58] s2013: NoMethodError: undefined method `limit' for #<ActiveSupport::OrderedHash:0x007f9921c1f978>
[21:51:10] tubbo: ohh sorry
[21:51:13] Sigma00: right, you gotta do that before count()
[21:51:54] Sigma00: keep count out of it entirely for now, let's see the query
[21:52:50] s2013: yea htat works
[21:53:51] build22__: has joined #RubyOnRails
[21:56:54] oded: has joined #RubyOnRails
[21:56:57] rustymyers: has joined #RubyOnRails
[21:57:04] Cork: has joined #RubyOnRails
[21:58:46] asianMike: has joined #RubyOnRails
[22:02:52] nya: has joined #RubyOnRails
[22:02:55] rakm: has joined #RubyOnRails
[22:03:08] nogic: has joined #RubyOnRails
[22:04:13] purplexed-: has joined #RubyOnRails
[22:05:40] purplexed-: hey all. I'm having trouble trying to load the child-objects of an object. Since I'm a newb this might be really simple to fix: https://gist.github.com/sonicjolt/71640e01758e937274b5
[22:05:51] yardenbar: has joined #RubyOnRails
[22:06:41] Z00t: has joined #RubyOnRails
[22:07:44] tbuehlmann: purplexed-, turn that around: @host = Host.includes(:tasks).find(params[:id])
[22:09:22] infamos: has joined #RubyOnRails
[22:09:54] quazimodo: has joined #RubyOnRails
[22:10:07] hahuang65: has joined #RubyOnRails
[22:10:56] jas02: has joined #RubyOnRails
[22:11:27] atmosx: for SO-type tag autocompletion I need JS right?
[22:12:01] atmosx: it can't be done just with rails. I've done a Sinatra app with fuzzy-search sometime ago... hm. I might take a look at the code.
[22:12:07] Pupeno: has joined #RubyOnRails
[22:12:16] ebbflowgo: has joined #RubyOnRails
[22:12:26] atmosx: it was ruby passing results to JS and JS displaying the results with links and all..
[22:13:19] Coldblackice: has joined #RubyOnRails
[22:13:55] baweaver: has joined #RubyOnRails
[22:14:35] tubbo: atmosx: correct
[22:17:22] purplexed-: tbuehlmann: thanks... working on it :)
[22:19:03] atmosx: tubbo: I can write pure JS code. But I didn't spend any time with libraries yet and so I'm a little bit... hm I try to avoid it.
[22:19:38] Pazician: has joined #RubyOnRails
[22:19:50] aadam21: has joined #RubyOnRails
[22:23:27] ellisTAA: i???m trying to add columns to my labels migration ??? but i???m getting an error saying labels already exists ??? is there something wrong with my migration ??? https://gist.github.com/ellismarte/b810bf3b71b961c059c1
[22:24:17] smathy: EllisTAA, really?
[22:24:26] smathy: ACTION smells a Friday afternoon troll
[22:26:38] rubyonrailed: has joined #RubyOnRails
[22:28:11] yfeldblum: has joined #RubyOnRails
[22:28:24] danneu: EllisTAA: you have two migrations that both call `create_table`
[22:28:33] ellisTAA: danneu: yeah ???
[22:28:36] danneu: one of them needs to be `change_table`
[22:28:43] ellisTAA: danneu: i knew that thank u
[22:29:02] momomomomo: has joined #RubyOnRails
[22:29:12] s2013: did you create them by hand EllisTAA
[22:29:32] danneu: so it's not an issue anymore?
[22:29:40] danneu: can i close the ticket?
[22:29:45] s2013: danneu yes
[22:30:19] s2013: quick poll.. how long does it take for yall to deploy your code to production
[22:30:49] smathy: s2013, like how long does it take the deploy to execute? Or how much of my actual time?
[22:31:00] s2013: does it take to execute
[22:31:21] smathy: s2013, including the CI that happens beforehand?
[22:31:47] smathy: s2013, then it varies a lot depending on the number of tests.
[22:31:52] s2013: and without
[22:32:00] smathy: s2013, ~ 30 seconds.
[22:32:14] tuelz1: has joined #RubyOnRails
[22:32:32] smathy: s2013, obviously if there's a big DB data change then that will also vary, but those are rare.
[22:33:19] danneu: i've worked on large rails apps that took long enough to timeout on a heroku deploy
[22:33:28] danneu: which iirc is 60+ seconds
[22:33:54] s2013: man i wish mine took 60 seconds.. takes 10-12 mins without tests.. and with tests 10-12 mins cause we have 0 tests. woohoo
[22:34:05] danneu: rofl, yeah
[22:34:06] smathy: s2013, how/why so long?
[22:34:19] juhoh: has joined #RubyOnRails
[22:34:23] ivanskie: has joined #RubyOnRails
[22:34:41] s2013: i think it compiles the assets everytime .. when i have sometime ill look further into it.
[22:34:50] ivanskie: has joined #RubyOnRails
[22:35:32] smathy: s2013, oh like you don't keep your `public/assets` as a symlink to a location shared across your multiple deploys?
[22:35:50] danneu: yeah, that's a big change you can do. compile assets on a CI server or just do it locally
[22:36:07] smathy: Still very hard for me to imagine assets taking that long to compile.
[22:36:23] smathy: danneu, we compile ours in place in prod during the deply.
[22:36:25] Synthead: has joined #RubyOnRails
[22:36:27] s2013: i didnt set up the deployment and all taht.. all i just do is do cap deploy ..
[22:36:33] aadam21: has joined #RubyOnRails
[22:36:37] TheNet: has joined #RubyOnRails
[22:36:40] s2013: but yeah was just curious how long it takes you guys..
[22:36:46] danneu: smathy: yeah, it's bewildering when something takes so long but it doesn't surprise me anymore
[22:36:46] smathy: s2013, your deploy.rb is within you control though.
[22:36:57] purplexed-: Hi all again, I'm still having trouble loading child objects of an object... and it seems to be about pluralization.. I'm not quite sure what is the reason: https://gist.github.com/sonicjolt/a6d209cba290c68ecc8f
[22:37:12] bruno-: has joined #RubyOnRails
[22:37:20] s2013: yeah i know.. i modified it once to see if it sped up, it didnt.. havent bothered with it since then. no one at work seems to give a shit
[22:37:24] s2013: so i stopped caring too
[22:37:33] smathy: danneu, my point was that the change should be to make public/assets a symlink to a common location, rather than compiling assets elsewhere - that's an added complexity that's not necessary.
[22:37:39] purplexed-: if you notice, there is a difference between "host_id" and "hosts_id"
[22:37:43] tubbo: s2013: ours takes like a few minutes
[22:37:54] n00bDev: has joined #RubyOnRails
[22:38:00] s2013: before "deploy:assets:precompile", "deploy:secondary_symlink" there is this line
[22:38:08] s2013: tubbo cool. are you still at the same company?
[22:38:08] smathy: purplexed-, !gist-usage - for next time.
[22:38:08] helpa: purplexed-: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[22:38:42] s2013: whats the relationship between host and task purplexed-
[22:38:56] purplexed-: s2013: Host has many tasks
[22:39:00] smathy: purplexed-, add your model, and show the actual code you ran to get that error.
[22:39:07] s2013: to be conventional it should be host_id
[22:39:13] danneu: smathy: yeah, but it's also the default
[22:39:17] smathy: Oh, sorry, that's it from the controller right?
[22:39:19] s2013: host belogns to task?
[22:39:27] purplexed-: no, task belongs to host
[22:39:31] smathy: danneu, what's the default?
[22:39:40] purplexed-: let me make a better gist, sorry
[22:40:04] smathy: purplexed-, actually, nevermind. Your field is mis-named.
[22:40:10] smathy: purplexed-, in your DB it's called `hosts_id`
[22:40:11] fgo: has joined #RubyOnRails
[22:40:11] annlewis: has joined #RubyOnRails
[22:40:17] smathy: purplexed-, it should be called just `host_id`
[22:40:26] n00bDev: hi whats the best approach to modify date format for different countries for input? eg: australia uses ddmmyyyy and america uses mmddyyyy
[22:40:49] smathy: n00bdev, for display?
[22:40:52] danneu: smathy: i'm rusty here, but iirc doesn't rails asset pipeline compile assets on boot when env==production by default?
[22:40:56] purplexed-: sorry, I'm very noobish, so if you assume I should know something, I probably don't :)
[22:41:02] purplexed-: <-- works on a new gist
[22:42:10] tetraktys: has joined #RubyOnRails
[22:42:43] smathy: purplexed-, not sure what you think you need to know to understand what I just said. You created a table called `tasks` in your DB and in that table there's a field/column named `hosts_id`. That's the wrong name for that column, it should be named `host_id`
[22:42:45] n00bDev: smathy: yes
[22:42:54] smathy: n00bdev, so probably you want http://guides.rubyonrails.org/i18n.html#adding-date-time-formats
[22:43:19] oded: has joined #RubyOnRails
[22:43:39] ruurd: has joined #RubyOnRails
[22:43:57] smathy: danneu, on boot of your rails app? No, definitely not.
[22:44:20] smathy: danneu, that's why you need to do it in the deploy process, which is what s2013 was saying was taking a lot of time.
[22:45:07] danneu: oh yeah, now i remember. heroku default
[22:45:08] smathy: danneu, the trick is that if the assets from the previous run are already in `public/assets` then running `rake assets:precompile` will only compile assets that have changed.
[22:45:41] smathy: danneu, problem is that if you don't set `public/assets` up as a symlink then each deploy will have an empty public/assets folder, and so the `assets:precompile` task will have to compile everything each time, whether or not it changed.
[22:46:09] smathy: (assuming capistrano-style deploy where each new version of your app gets its own new directory)
[22:46:17] smathy: purplexed-,
[22:46:20] purplexed-: smathy: so I should just rename the column
[22:46:29] smathy: purplexed-, yep.,
[22:46:35] purplexed-: okay, lemme try that
[22:47:20] smathy: purplexed-, if this app hasn't been deployed yet, the simplest way is to actually edit the db/migrate/TIMESTAMP_create_labels.rb migration and then run: `rake db:migrate:reset`
[22:47:30] smathy: (you'll lose all your dev data)
[22:48:32] ellisTAA: i can???t figure out why the submit button is showing up where it is instead of at the end of the page: https://labelprinter.herokuapp.com/
[22:48:36] ellisTAA: https://gist.github.com/ellismarte/ed05288dd51970a1e53d
[22:49:59] ebbflowgo: has joined #RubyOnRails
[22:50:30] purplexed-: smathy, you were absolutely correct. I did ActiveRecord::Migrate.rename_column ..... and that fixed it :)
[22:50:49] purplexed-: sorry, I have only used rails for 1 day
[22:51:09] smathy: EllisTAA, something to do with your CSS.
[22:51:21] smathy: purplexed-, no problem.
[22:51:34] purplexed-: rails seems to be alot more convention driven than ASP.NET MVC
[22:52:02] purplexed-: but I'm really enjoying the console
[22:52:06] purplexed-: very powerful
[22:52:33] danneu: EllisTAA: knowing nothing about the grid framework you're using, i'd venture a guess that you should nest the button inside a <row> and then inside a <col> that spans the width
[22:52:50] ellisTAA: danneu: interesting ill try that
[22:53:01] chridal: has joined #RubyOnRails
[22:53:33] danneu: the classes wrapping the submit button just dont seem to match the <row><col> <col> <col></row> cadence in the surrounding structure
[22:54:09] ruurd: has joined #RubyOnRails
[22:55:06] smathy: purplexed-, yes, convention over configuration is a Rails tenet.
[22:55:11] ruurd: has joined #RubyOnRails
[22:55:18] RegulationD: has joined #RubyOnRails
[22:57:04] dethos: has joined #RubyOnRails
[22:57:06] purplexed-: very impressed so far, compared to ASP.NET MVC
[22:57:39] purplexed-: it's so easy
[22:59:14] Rodya_: has joined #RubyOnRails
[22:59:18] darrencauthon: has joined #RubyOnRails
[22:59:37] Axsuul: has joined #RubyOnRails
[23:00:22] chridal: has joined #RubyOnRails
[23:03:22] jessemcgilallen: has joined #RubyOnRails
[23:05:39] arthurix: has joined #RubyOnRails
[23:06:01] bvbrandon: has joined #RubyOnRails
[23:06:43] tetraktys: has joined #RubyOnRails
[23:08:34] rubyonrailed: has joined #RubyOnRails
[23:08:51] ebbflowgo: has joined #RubyOnRails
[23:09:35] exadeci: has joined #RubyOnRails
[23:09:40] smathy: purplexed-, yes, very easy.
[23:10:29] stannard: has joined #RubyOnRails
[23:11:04] simkessy: has joined #RubyOnRails
[23:12:57] VeryBewitching: purplexed-: Ruby is also design for developer happiness; it's quite expressive.
[23:13:08] simkessy: Hey obviously this is the wrong place to ask but how would I open another channel without having to restart the tab and login again?
[23:13:22] VeryBewitching: simkessy: /leave
[23:13:43] VeryBewitching: simkessy: Is how you leave a channl, /join to join
[23:14:01] simkessy: ohhhh so simple thanks
[23:14:12] freezevee: has joined #RubyOnRails
[23:14:49] VeryBewitching: Obviously having issues typing today, keep leaving out key letters.
[23:15:07] railsknight: has left #RubyOnRails: ()
[23:15:10] smathy: simkessy, /help for help
[23:15:17] railsknight: has joined #RubyOnRails
[23:15:17] smathy: (goes to the Status tab)
[23:15:37] Pazician: has joined #RubyOnRails
[23:16:16] simkessy: smathy: sounds good thanks for the heads up
[23:17:19] crdpink: has joined #RubyOnRails
[23:17:24] riotjones: has joined #RubyOnRails
[23:17:56] MartinElvar: has joined #RubyOnRails
[23:20:13] arthurix_: has joined #RubyOnRails
[23:20:19] lacrymology: I'm having a weird issue with strong params. Does this make sense to anyone? http://dpaste.com/1VH7Q6A
[23:20:46] bruno-_: has joined #RubyOnRails
[23:21:56] ellisTAA: i???m trying to hit this api & it talks about using curl but i???m using httparty ??? can someone help me figure out how my httparty call is different from this curl stuff https://gist.github.com/ellismarte/4a63868d9b99d7c2039a
[23:21:58] smathy: lacrymology, nope, it makes no sense why people would use dpaste.
[23:22:44] n00bDev: has joined #RubyOnRails
[23:23:17] smathy: EllisTAA, well what do you think the differences are?
[23:23:37] ellisTAA: smathy: not sure ??? maybe i???m using json ???
[23:23:58] smathy: EllisTAA, excellent. So there's the first thing I'd start with.
[23:24:14] ellisTAA: smathy: so get rid of the headers in my httparty call?
[23:24:34] goodcodeguy: has joined #RubyOnRails
[23:25:00] smathy: EllisTAA, well I'd start by actually researching the API and whether or not it will accept JSON.
[23:25:11] ellisTAA: smathy: it doesn???t say
[23:26:05] smathy: EllisTAA, well if it doesn't say that it supports JSON, then I would assume it didn't.
[23:26:23] smathy: ...especially seeing as the example is a standard HTTP form POST.
[23:26:24] SteenJobs: has joined #RubyOnRails
[23:26:29] railsknight: has left #RubyOnRails: ()
[23:26:39] railsknight: has joined #RubyOnRails
[23:27:32] smathy: EllisTAA, so as well as dropping the headers, you'll need to construct a CGI query string instead of your JSON string.
[23:30:50] ellisTAA: smathy: could u tell me what d & u mean at the beginning of these lines? https://gist.github.com/ellismarte/4a63868d9b99d7c2039a#file-instructions-txt-L2-L3
[23:31:24] railsknight: Hello, anyone here know how hard it is to get a Rails Job?
[23:31:37] railsknight: I imagine its hard for jr developer especially
[23:31:54] smathy: EllisTAA, curl is a command line utility, those are options passing in each argument as a data element.
[23:32:55] smathy: EllisTAA, you can run `man curl` in a Terminal window to see the help for curl.
[23:33:03] lipoqil: has joined #RubyOnRails
[23:33:15] bvbrandon: has joined #RubyOnRails
[23:33:17] smathy: railsknight, depends where you are.
[23:33:34] smathy: railsknight, you in San Diego? Pretty easy there.
[23:34:55] railsknight: Doesn't seem so, maybe not looking hard enough
[23:35:17] smathy: railsknight, check out the SD Ruby crew: http://www.meetup.com/sdruby/ You can even join the mailing list and post about your skills and availability.
[23:36:36] MartinElvar: has joined #RubyOnRails
[23:37:17] smathy: railsknight, FWIW, there are definitely more opportunities up in Irvine or further north.
[23:37:28] aadam21: has joined #RubyOnRails
[23:38:02] railsknight: Good to know with Irvine, since I am much closer
[23:38:17] railsknight: How open are they for Telecommute you think? I guess it depends.
[23:38:56] shathoma: has joined #RubyOnRails
[23:39:17] smathy: railsknight, honestly, in my experience, you have nearly 0% chance to find a remote gig as a junior.
[23:39:26] shathoma: Can a model/controller have many kinds of views and different forms? Is there a rails word for this?
[23:39:28] railsknight: That is expected
[23:39:54] shathoma: Like I have a form for creating an employee...but then I would like to assign locations where that employee works.
[23:39:57] smathy: shathoma, yes, the word is "rails"
[23:40:08] teclator: has joined #RubyOnRails
[23:40:08] smathy: Ie. it's very normal.
[23:40:30] sarink: has joined #RubyOnRails
[23:40:52] shathoma: LOL okay. Fair enough, I am obviously over thinking this.
[23:40:59] annlewis: has joined #RubyOnRails
[23:41:44] shathoma: okay maybe a better question is I have a join table, is it normal that people create models and views and controllers to handle these join tables? or just create the join tables?
[23:41:53] shathoma: is it a matter of preference?
[23:42:01] pydave6367: has joined #RubyOnRails
[23:42:03] fgo: has joined #RubyOnRails
[23:43:01] sar1nk: has joined #RubyOnRails
[23:43:04] freezevee: has joined #RubyOnRails
[23:43:23] shibabu: has joined #RubyOnRails
[23:43:32] DanielN: has joined #RubyOnRails
[23:44:02] shathoma: I think someone suggested creating all the model and that for a join table cause I will end up using it anyway.
[23:44:04] smathy: shathoma, well because a join table contains, by definition, the foreign keys of other records and usually is basically meaningless without values for those fkeys, then generally any join table will tend to create both the associated records as well as itself.
[23:44:55] shathoma: Well I guess I am trying to figure out the right way to do a ui (view/controller) where a join table is concerned, I have one side created, the other side too I just need to connect them up
[23:45:04] armyriad: has joined #RubyOnRails
[23:45:09] hahuang65: has joined #RubyOnRails
[23:45:13] lacrymology: smathy: I come from django. And about the parameters error?
[23:45:38] bvbrandon: has joined #RubyOnRails
[23:45:51] shinnya: has joined #RubyOnRails
[23:46:31] smathy: shathoma, not sure what you mean by "connect them up" - but are you aware of nested forms? http://guides.rubyonrails.org/form_helpers.html#nested-forms
[23:47:28] shathoma: yes I have those, I guess it is ultimatley what I want. I think I am letting the details of the UI get in the way of my thought process. By connect them up an example is: I have a provider (employee) that can work for a group (employer). So I just created an employee (in the show action) and I would like to attach them to a group.
[23:47:40] shathoma: Okay, great maybe a button on the show form says 'add a group'
[23:47:40] doctorly: has joined #RubyOnRails
[23:48:37] shathoma: i click that and it takes me to some form view (which controller am I in at this point?) that knows I want to add provider 1 to any selected group... (so a list of groups) and I can add this provider to many groups. So would have a form that says you are trying to add Bob to... (select many groups in a select option box with multiple true)
[23:49:09] rhizome: where is the issue
[23:49:15] shathoma: or this form says "You have Bob drag from one list of all groups they could work at over to the list that bob is working at" like a drag and drop...
[23:49:41] shathoma: this issue is: Once I create my employee and save it, and say "I would like to go ahead and assign a group to him" is that in the employee controller or the group controller?
[23:49:50] shathoma: is it governed by how my model is set up?
[23:50:05] rhizome: you could do it either way. add group to user or add user to group
[23:50:31] rhizome: either, both. up to you
[23:51:02] smathy: lacrymology, no matter where you come from you should read the topic upon joining any IRC channel, but re your problem - I don't even know how you got a Customer instance in your params, so I don't know where to start helping with that. The device_ids error is because you've specified a scalar value and the params themselves contain an array value. You should read the docs closer: http://api.rubyonrails.org/classes/ActionController/Parameters.
[23:51:11] uberjar: has joined #RubyOnRails
[23:51:23] trosborn: has joined #RubyOnRails
[23:51:48] shock_one: has joined #RubyOnRails
[23:52:14] shathoma: thanks rhizome. It is true. Some groups have multiple locations, so I think I could figure out when you do the adding that says "oh wait this has multiple locations....which one specifically?" and that would do like a modal dialogue for a choice to be selected.
[23:52:27] RegulationD: has joined #RubyOnRails
[23:53:39] railsknight: whois railsknight
[23:53:52] railsknight: Oops I guess I did that wrong
[23:54:01] rhizome: you've used websites before, you know what you want to be able to do on a given page
[23:54:09] rhizome: ACTION hands railsknight a /
[23:54:38] railsknight: Thanks Rhizome
[23:54:55] railsknight: Trying to see if I can mask my ip
[23:55:17] smathy: railsknight, you need to register with nickserv, look on the freenode website for how to.
[23:55:17] shathoma: Zomg. I just had the dumbest aha moment. Derp I can make any number of actions in my controller that can have any number of views with any number of partials(as forms) that i want.
[23:55:19] Radar: Too late for that :)
[23:55:31] Radar: railsknight: I use a ZNC bouncer which inadvertently does this for me.
[23:55:41] smathy: shathoma, yeah, like I said, the word for that is "rails"
[23:56:01] Radar: shathoma: just keep in mind that it shouldn't be "one controller to rule them all"
[23:56:02] smathy: Any actual IRC client will do it for you too railsknight
[23:56:18] smathy: ...that's called Sinatra
[23:56:33] shathoma: as in don't let my controllers try to do everryyhthing
[23:56:52] smathy: shathoma, don't let a single controller do everything.
[23:57:00] shathoma: but split it up tangibly. Like in my case above, sure let the providers controller (employees) make an employee but why not also let it add that employee to groups
[23:57:25] doctorly: I am having a hard time getting a virtual attribute to work. I am calling the setter before validation, and it sets my attribute 'self.start_date'. It passes validation, but doen't actually save the attribute to the database. Any ideas how I can get passed this hump?
[23:57:30] Radar: doctorly: !rule0
[23:57:30] helpa: doctorly: 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.
[23:57:47] Radar: 4sec response time. pretty good.
[23:58:05] doctorly: What exactly do you want me to show though, where would the problem reside?
[23:58:13] shathoma: Does one always need a model for a controller (since it is MVC)? Or is a controller just governed by the routes?
[23:58:27] Radar: doctorly: "I am calling the setter before validation, and it..." seems like you know the answer to this question already?
[23:58:32] Radar: doctorly: Show.
[23:58:35] Radar: doctorly: !gist
[23:58:35] helpa: doctorly: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[23:58:55] smathy: shathoma, there are different schools of thought. The resource approach has mostly a one-one mapping between controllers and models.
[23:59:08] recurrence: has joined #RubyOnRails
[23:59:21] Oog: has joined #RubyOnRails
[23:59:26] smathy: ...which is the approach that the Rails helpers/generators/etc. generally follow.