Activity Graph

Page 1 of 6 | Next »


[13:17:29] brazenbraden: has joined #RubyOnRails
[13:18:16] brazenbraden: hey guys. i would like to check the authenticiy token sent by the form and what it is being compared with. how do i do that?
[13:18:52] brazenbraden: session information is stored server side, so would have to be done at controller level
[13:19:08] brazenbraden: just want to puts out what the session auth token is and what the form sent to compare
[13:21:12] brazenbraden: decode it from what to what?
[13:24:42] brazenbraden: also the place you come when all SOs and docs havent yielded results
[13:25:58] brazenbraden: matthewd, ok. So i decode the auth_token submitted by the form. once i have that, what do I compare it against?
[13:29:05] brazenbraden: matthewd, right you are.
[16:10:05] brazenbraden: Quit: Leaving


[01:35:02] brazenbraden: Ping timeout: 244 seconds
[07:03:08] brazenbraden: has joined #RubyOnRails
[11:48:03] brazenbraden: does config.assets.quiet exist in rails 4.2? or is it new in 5?
[15:50:35] brazenbraden: Quit: Leaving


[12:30:48] brazenbraden: has joined #RubyOnRails
[12:32:25] brazenbraden: hey guys. trying to upgrade to rails 5. followed the upgrade guide. identified and removed incompatible gems, etc. App runs, but when I access it online, it shows me Not a directory @ rb_sysopen - /app/tmp/cache/assets/development/sprockets/v3.0/Wy/WyeU9jNO...
[12:32:54] brazenbraden: tried clearing browser cache, rake tmp:clear, restarting app
[12:33:33] brazenbraden: done that too
[12:33:46] brazenbraden: also ran precompile (which shouldnt do anything cos im in dev mode)
[12:35:20] brazenbraden: its breaking on my first =styleshee_link_tag in my app.haml
[12:36:59] brazenbraden: yea, its a tmp file generated by sprockets with is a long hash
[12:38:39] brazenbraden: hmm. im not seeing the dir Wv. there are a tonne of other dirs though all generated on first load of page
[12:44:17] brazenbraden: both css and js
[12:44:26] brazenbraden: but only mine. doesnt care about cdn links
[12:52:27] brazenbraden: still breaks on the now empty application.css.scss. all other files were removed
[12:53:12] brazenbraden: no, different one
[12:53:20] brazenbraden: now a /bs/ folder
[12:53:30] brazenbraden: and thats exactly what this is, bs. lol
[12:55:24] brazenbraden: cleared the cache. all files disappeared. reload page, boom, 100 files. but still the error
[13:01:18] brazenbraden: i read that rails 5 now uses puma over webrick as the dev server but i have been using unicorn. will that be a problem?
[13:01:57] brazenbraden: ok so unicorn is fine
[13:02:18] brazenbraden: also discovered that gem remotipart isnt compatible with rails 5 so had to remove that
[13:04:02] brazenbraden: is sprockets meant to generate a folder called v3.0 in the tmp/cache/assets/sprockets folder with a hundred files? or I have got something misconfigured?
[13:08:26] brazenbraden: i've put the files back as even an empty css file threw the same error
[13:11:01] brazenbraden: should be. did a bundle update to get all the gems updated including rails from 4.2 to 5.
[13:11:20] brazenbraden: sprockets is at 3.6.3
[13:12:12] brazenbraden: AimlessRaven, check the request param for .post? or .delete?
[13:13:38] brazenbraden: yea, so, if request.delete?; do some stuff; end;
[13:14:01] brazenbraden: although why do both in one action?
[13:14:13] brazenbraden: thats not restful
[13:14:42] brazenbraden: i know the feels
[13:20:37] brazenbraden: i dont understand
[13:28:55] brazenbraden: matthewd, i generated a rails 5 app, added in a stylesheet, all works fine o.O
[13:29:40] brazenbraden: matthewd, easier said than done lol
[13:30:54] brazenbraden: it includes gems which arent windows friendly and setting up a vagrant box and provisioning with docker just to bundle install sounds like a bit of a pain
[13:31:11] brazenbraden: matthewd, its probably that but i dont know which
[13:32:36] brazenbraden: nothing out of the ordinary. just added a couple paths
[13:33:53] brazenbraden: yup. but my app is in a debian based docker container
[13:40:50] brazenbraden: there is clearly something i've configured wrong. will go through my configs and disable things one at a time, maybe find the culprit.
[13:59:03] brazenbraden: doesnt seem any of my configs are the problem. also noticed that the tmp sprockets dir and file changes on every refresh
[13:59:13] brazenbraden: as expected though since there is no caching
[14:18:20] brazenbraden: hmm.. my assets:precompile are also breaking with the same error
[14:46:48] brazenbraden: not having much luck. This is the log when i run assets:precompile:
[14:53:40] brazenbraden: matthewd, actually, i dont think it ever worked (since the update)
[14:55:28] brazenbraden: from rails 4 to 5
[14:57:41] brazenbraden: i know sprockets is a dependency of rails but will changing the version work if i specify it in my gemfile under the rails gem?
[14:59:25] brazenbraden: should i change the version of sprockets or sprockets-rails ?
[15:00:25] brazenbraden: ok, will try that out
[15:04:33] brazenbraden: matthewd, the older version of sprockets i used to use is no longer compatible with sass-rails and a dependency called 'tilt'


[11:44:25] brazenbraden: has joined #RubyOnRails
[11:47:02] brazenbraden: hey folks. attempting to upgrade to rails 5 but getting the error that BUndle could not find a compatible version of rack. This is the error log and my gemfile:
[14:02:05] brazenbraden: hey folks. attempting to upgrade to rails 5 but getting the error that BUndle could not find a compatible version of rack. This is the error log and my gemfile: . I have tried gem installing rack 2.0.1 manually and adding it into my gemfile. no cigar.
[17:34:09] brazenbraden: Quit: Leaving


[13:56:56] brazenbraden: has joined #RubyOnRails
[13:58:02] brazenbraden: i have accept_nested_attributes_for :socials, reject_if: :all_blank, however, validation is failing even though all social fields are indeed blank. is it because im doing create!() instead of create()?
[14:01:33] brazenbraden: fox_mulder_cp, thanks for the response. I'm using cocoon (well, a modified version but same idea) which means i dont need to build a set number of fields_for
[14:02:10] brazenbraden: fox_mulder_cp, changed occupations since the end of x-files? :P
[14:04:13] brazenbraden: a worthy quest
[14:05:05] brazenbraden: im a tad out of the media loop
[16:05:42] brazenbraden: Quit: Leaving


[14:13:54] brazenbraden: has joined #RubyOnRails
[14:15:05] brazenbraden: hey folks. little question here, wondering how to pass a block to a method. (i know this is a common thing but i'm not fully getting it). I have an example of what i would like to do here:
[14:16:51] brazenbraden: yea i know, but i would like to pass the whole thing to another function
[14:18:48] brazenbraden: the map call inside the all function. so, when i call all(), it will in turn call the return_stuff function, passing in the contents of the all function
[14:20:12] brazenbraden: let me update the gist with what i mean. one sec
[14:21:18] brazenbraden: updated... that sorta concept.
[14:22:09] brazenbraden: yea, so in this case, what would end up being returned by return_something() would be that array
[14:23:21] brazenbraden: let me add an extra example. one sec
[14:26:11] brazenbraden: ok, does that sorta make more sense?
[14:28:51] brazenbraden: ive added the actual repository class.
[14:31:42] brazenbraden: some methods need to work with the @@records but after they done their work, the @@records must be set to nil. Now, I can do that in each method that needs that (for example, all(), first(), last() etc) but wouuld be nice to extract that out and just pass along the work that needs to be done.
[14:35:42] brazenbraden: ive updated my base repo class with what i would need to do to have it work
[14:41:01] brazenbraden: Ping timeout: 244 seconds
[14:43:55] brazenbraden: has joined #RubyOnRails
[14:44:04] brazenbraden: back.. internet died
[14:44:15] brazenbraden: did i miss anything?
[16:08:32] brazenbraden: Quit: Leaving


[09:52:48] brazenbraden: has joined #RubyOnRails
[09:53:59] brazenbraden: hey guys. first time i've hit into this. i have an edit form with method: :patch. the html that gets generated is a form with method 'post' but a hidden field called method with value patch however when i submit the form, it says no route matches POST. what have i done wrong?
[09:57:19] brazenbraden:
[10:00:26] brazenbraden: sevenseacat, wait, let me add my controller and routes.. doing things a little differently
[10:01:34] brazenbraden: oh my bad. one sec
[10:02:35] brazenbraden: ok. universa1 : button added. sevenseacat : routes and controller added
[10:03:02] brazenbraden: workmad3, yea sorry, it is. just missed typing it
[10:04:15] brazenbraden: workmad3, tell me about it
[10:05:12] brazenbraden: sevenseacat, the reason i am doing things this way is to properly simulate the get, post, redirect pattern
[10:05:27] brazenbraden:
[10:08:33] brazenbraden: sevenseacat, sure, however my routes and "weird" way of doing things are correctly set up and work everywhere else where i have a form. something else is the cause here. the hidden _method field is not "overriding" the actual method. I could fix this my just making it a post (seeing as PATCH is not a valid request type anyway)
[10:11:51] brazenbraden: universa1, is patch is all valid, then why is the form generated with a method: 'post' and a hidden _method field for patch instead of just having method: 'patch' in the form definition?
[10:12:48] brazenbraden: right, my confusion there. apologies. but going with that flow, would i be wrong to use post instead of patch?
[10:14:51] brazenbraden: sevenseacat, not really.. i get these fong kong errors which apprently is a chrome bug but nothing directly from my code
[10:15:00] brazenbraden: workmad3, it is in the gist
[10:15:36] brazenbraden: oh right. sure, but all you will see is a mount
[10:16:50] brazenbraden: workmad3, added
[10:20:48] brazenbraden: sevenseacat, yea... and the object is a Virtus entity which includes ActiveModel to get forms to work with it... I recently started turning my mappers into singletons. perhaps something has gone wrong there
[10:21:31] brazenbraden: just trying to do things the uncle bob way instead of the rails way
[10:23:14] brazenbraden: workmad3, that is an interesting argument and you may very well be correct. let me dig into that a bit.
[10:24:01] brazenbraden: i think the culprit is in the decorator with the button builder. that add_options: {} hash... trigger: submit.. that shouldnt be there...
[10:25:33] brazenbraden: bad abstractions? how? using repositories, mappers, usecases, entities. my core logic is rails independent at the moment. i could pop my core folder into a cli app and it would all still work. that is the plan.
[10:27:08] brazenbraden: workmad3, true that adding all this has added a LOT of extra files and code to the app, and it can get a bit difficult finding where things are going wrong but thats my fault as I had this app written before (and it was badly done) and I am still in the process of converting things over so some things are still hidden away on old code.
[10:28:03] brazenbraden: sevenseacat, and if it is decided to rather use Mongo? ATM all i need is to write a mongo repo adapter and poof, all works.
[10:28:44] brazenbraden: workmad3, i have. but like i said, its still a work in progress :)
[10:29:22] brazenbraden: this is programming. hell is never far behind :P
[10:29:36] brazenbraden: ok guys, thanks for the input and suggestions. i will dig around and figure it out.
[10:30:30] brazenbraden: workmad3, yes, because it comes from the old code which is many months old. i cant remember every aspect of everything unfortunately
[10:32:04] brazenbraden: he usually does ;)
[19:09:34] brazenbraden: Quit: Leaving


[09:36:04] brazenbraden: has joined #RubyOnRails
[09:37:23] brazenbraden: i keep getting the error: Errno::ENOTDIR - Not a directory @ rb_sysopen - /app/tmp/data/meta_request/d885df6b-1c60-4805-85f8-5f7e8be8882a.json -- and i dont know how to get rid of it. i've cleared the sessions table, deleted cookies, reloaded the db schema, restarted the app multiple times. what do I do?
[10:07:23] brazenbraden: i've tried manually deleting the meta_request folder in the tmp folder and that ends up with me just getting a plain white screen on refresh. have to restart the app after which, greeted with the same error (and a whole lot more meta_request .json junk generated)
[10:08:54] brazenbraden: i dont know. thought it was rails
[10:09:39] brazenbraden: yea i have come across that (as that is the only thing that mentions meta_request
[10:09:52] brazenbraden: i dont use rails panel
[10:10:16] brazenbraden: i will add the gem anyway and see
[10:10:40] brazenbraden: actually it is already there
[10:11:23] brazenbraden: universa1, will remove it and see what happens
[10:23:17] brazenbraden: universa1, its back up and running. what a pain in the tooshie.
[12:27:20] brazenbraden: "updated_at"=>Mon, 09 May 2016 11:38:44 WAT +01:00}}]" meanwhile I want it to look like: "phones_attributes"=>{"1462790308286"=>{"id"=>"", "_destroy"=>"0", "number"=>"0818603625", "phone_type_id"=>"1", "primary"=>"0"}, "1462790308287"=>{"id"=>"", "_destroy"=>"0", "number"=>"0818654452", "phone_type_id"=>"1", "primary"=>"0"}}. how do i basically extract out each hash and << into the params[:phones_attributes] key (which doesnt exist until after
[12:27:20] brazenbraden: " but that results with the hash of attributes inside of an array like ":phones_attributes=>[{0=>{"id"=>1, "number"=>"0818603625", "primary"=>false, "phone_type_id"=>1, "contact_id"=>5, "created_at"=>Mon, 09 May 2016 11:38:44 WAT +01:00, "updated_at"=>Mon, 09 May 2016 11:38:44 WAT +01:00}}, {1=>{"id"=>2, "number"=>"0818654452", "primary"=>false, "phone_type_id"=>1, "contact_id"=>5, "created_at"=>Mon, 09 May 2016 11:38:44 WAT +01:00,
[12:27:20] brazenbraden: got a silly question (but i always get fandangled by these things). im trying to build a hash that matches what params look like using an AR model object. im currently doing " params[:phones_attributes] = model_object.phones.collect.with_index {|item, index| {index => item.attributes}}
[12:27:27] brazenbraden: this assignment currently)
[12:27:45] brazenbraden: universa1, alrighty
[12:29:43] brazenbraden: universa1, does this help?
[12:30:46] brazenbraden: alrighty, will look that up. thanks
[12:34:06] brazenbraden: universa1, can you do something like each_with_object({}).with_index {||} ?
[12:36:01] brazenbraden: fascinating. will give that a test. thanks
[12:36:58] brazenbraden: universa1, a very valid point :P
[12:37:20] brazenbraden: i was initially going hash.size (inside the loop)
[14:45:36] brazenbraden: Read error: Connection reset by peer


[10:29:04] brazenbraden: has joined #RubyOnRails
[10:30:03] brazenbraden: im getting an error when trying to load my app. "Not a directory @ rb_sysopen - /app/tmp/data/meta_request/af98fd93-cf4b-455d-88a5-cbb798bb7623.json". I have run rake tmp:clear to get rid of old tmp files and restarted everything but alas, no cigar. what do i do?
[10:34:58] brazenbraden: tried clearing browser cache and also accessing via incognito mode, no diff
[11:11:10] brazenbraden: fooey still no luck
[17:01:05] brazenbraden: Quit: Leaving


[13:33:13] brazenbraden: has joined #RubyOnRails
[13:37:28] brazenbraden: :development.
[13:37:28] brazenbraden: hey guys. im implementing the Repository Pattern, using Uncle Bob's blog as a resource ( I am registering my repositories in the engine.rb file (as each engine has its own set of repos) and it works but for a limited time. After about 10 or so requests all of a sudden the repos have been "forgotten". Don't know if I've done something wrong or it is a quirk of being in
[15:47:52] brazenbraden: Quit: Leaving


[14:09:07] brazenbraden: has joined #RubyOnRails
[14:09:59] brazenbraden: hi all. im having a little trouble permitting the phone params. im not using AR so my params come back a little differently. have I mis-formed them?
[14:11:46] brazenbraden: oh, the extra comma? removed it.
[14:12:35] brazenbraden: that is the real code (bar params for emails which Im still working on). you want to see the full controller? or view?
[14:14:31] brazenbraden: oh sorry, my bad. the resulting "permitted_params" for phones is {} (empty)
[14:18:33] brazenbraden: updated gist with form partial and full controller. logs dont say anything except spitting out the request with the params. im breaking in my new action and testing via better_errors
[14:19:25] brazenbraden: k. gimme a sec
[14:21:27] brazenbraden: updated with logs. its obviously breaking at xxx cos im halting execution there to check what per_params gives me
[14:24:07] brazenbraden: i will store the perm_params in a variable then break after. hang on.
[14:26:01] brazenbraden: sevenseacat, updated. its not permitting the random numbers (which it shouldnt)
[14:27:06] brazenbraden: if i dont generated the random numbers for the fields, then only the last one gets sent :(
[14:27:42] brazenbraden: since im not using AR, im not using accepts_nested_attributes so I have to do this all manually
[14:28:08] brazenbraden: i will give that a shot
[14:28:37] brazenbraden: i see. wish the hours of googling would have highlighted that lol
[14:28:48] brazenbraden: lemme update the code and see what happens.. gimme a sec
[14:30:11] brazenbraden: doing them in JS (unfortunately)
[14:32:41] brazenbraden: why is NFS so slooooowwwww
[14:33:29] brazenbraden: just a side rant
[14:33:37] brazenbraden: wasnt asking for solutions lol
[14:33:56] brazenbraden: sevenseacat, i could hug you
[14:34:02] brazenbraden: but thank you!!!
[14:34:20] brazenbraden: ACTION heavy breathing
[15:07:01] brazenbraden: Quit: Leaving


[10:09:06] brazenbraden: Ping timeout: 240 seconds


[14:20:00] brazenbraden: has joined #RubyOnRails
[15:21:09] brazenbraden: Quit: Leaving


[12:39:13] brazenbraden: has joined #RubyOnRails
[15:26:17] brazenbraden: Quit: Leaving


[09:58:36] brazenbraden: has joined #RubyOnRails
[09:58:36] brazenbraden: has joined #ruby
[10:00:40] brazenbraden: i've created a mountable engine for my application and would like to have tests for the engine within the engine folder structure. Having read through the Rails Guides on engines, they say the tests need to be in the route of the application because it needs to know about the overall application (like routes etc). I came across the "combustion" gem which allows for setting up testing environments inside engines. is this the right approach to
[16:30:38] brazenbraden: Quit: Leaving


[17:07:47] brazenbraden: has joined #ruby
[17:07:47] brazenbraden: has joined #RubyOnRails
[17:13:10] brazenbraden: having a little trouble getting sidekiq to talk to redis in my dockerized app. here is a gist of the bits. basically, docker is setting up redis in the hosts file correctly and the initializer makes that connection but sidekiq fails to find the url and looks for the database on What have i missed?
[17:24:03] brazenbraden: smathy, thanks, will dig around further
[17:32:57] brazenbraden: if im starting sidekiq from an init script, will it know about the redis address? does it by default know where to look?
[23:53:29] brazenbraden: Quit: Leaving


[13:17:36] brazenbraden: has joined #RubyOnRails
[13:17:36] brazenbraden: has joined #ruby
[16:30:35] brazenbraden: Remote host closed the connection


[13:26:09] brazenbraden: has joined #RubyOnRails
[13:26:09] brazenbraden: has joined #ruby
[13:26:35] brazenbraden: question.. why are my css files like application.css.scss and not just application.scss?
[16:19:44] brazenbraden: Quit: Leaving


[10:05:08] brazenbraden: has joined #RubyOnRails
[10:05:08] brazenbraden: has joined #ruby
[10:05:42] brazenbraden: can i have custom groups in my gemfile (ie. group :engines do) and use them in bundler like 'bundle install --without engines' ?
[10:06:34] brazenbraden: rvanlieshout, i am
[10:06:49] brazenbraden: rvanlieshout, getting ' The command '/bin/sh -c bundle install --without engines' returned a non-zero code: 13'
[10:06:57] brazenbraden: and google not being clear
[14:43:31] brazenbraden: i have two Gemfiles. I run 'bundle install --gemfile=gemfile2' after running bundle install (which installs from the main gemfile) however it seems like the original gems are "disappearing" and im only left with the gems from the second gemfile. how can i get all of them installed?
[15:43:54] brazenbraden: Quit: Leaving


[08:02:03] brazenbraden: has joined #RubyOnRails
[08:02:03] brazenbraden: has joined #ruby
[15:26:47] brazenbraden: Quit: Leaving


[11:50:05] brazenbraden: Quit: Leaving
[13:27:09] brazenbraden: has joined #RubyOnRails
[13:27:09] brazenbraden: has joined #ruby
[13:36:44] brazenbraden: anyone have some good resources about setting up and configuring Resque for a ruby scripting "app"? All I find is rails integration.
[18:13:14] brazenbraden: Quit: Leaving


[10:36:41] brazenbraden: i have a ruby project comprising of scripts which do work and send emails and such (no rails). looking for a good mail queue gem (like Rescue Mailer) but is for plain ruby code. any suggestions? (i am using gem mail for email sending)
[10:47:24] brazenbraden: jhass, will research if those suite my needs.
[21:21:31] brazenbraden: Remote host closed the connection


[20:19:00] brazenbraden: eam, i thought the whole point of having these containers was to not have all these issues lol. i wonder if it has something to do with doing a bundle install --path
[20:20:11] brazenbraden: that for sure
[20:20:37] brazenbraden: weird thing is that i have a container environment set up for another project and dont have any problems -.-
[20:22:50] brazenbraden: eam, so, my on my host machine is in my user folder .rvm as I use rvm to manage my rubies.. but the docker image my dockerfile is pulling builds it
[20:28:10] brazenbraden: eam, i am able to ls the files in the container but no clue where is stored
[20:31:46] brazenbraden: eam, umm.. when i run that in my container, I get "No such file or directory" O.o
[20:32:38] brazenbraden: eam, yea the ldd
[20:33:04] brazenbraden: yea, its a docker ruby image
[20:33:09] brazenbraden: FROM ruby:2.2.3
[20:33:38] brazenbraden: that would be awfully strange for a ruby image lol
[20:35:01] brazenbraden: eam, i can run ruby -v and I get ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
[20:36:17] brazenbraden: eam, the ldd didnt work.. but "which ruby" shows me /usr/local/bin/ruby
[20:36:45] brazenbraden: might be the case. these images supposed to be light weight
[20:37:16] brazenbraden: and its not even the slim version lol
[20:38:16] brazenbraden: will try.. dont know if the container will stay alive long enough
[20:39:37] brazenbraden: eam, easier than that, will just re-provision the containers including binutils in the build. anything else i should include while im at it?
[20:56:18] brazenbraden: eam, i got the container up and running.. looks like doing bundle install --path my/path was the problem :S