Activity Graph

Page 1 of 2 | Next »


[08:09:21] dojobo: Ping timeout: 276 seconds
[08:12:11] dojobo: has joined #ruby
[08:12:50] dojobo: Client Quit


[05:16:42] dojobo: Ping timeout: 240 seconds
[05:23:25] dojobo: has joined #ruby


[20:21:06] dojobo: *.net *.split


[09:28:44] dojobo: has joined #ruby


[13:56:31] dojobo: has joined #ruby
[13:56:34] dojobo: has joined #RubyOnRails
[22:37:50] dojobo: Quit: Leaving


[13:17:42] dojobo: has joined #ruby
[13:17:46] dojobo: has joined #RubyOnRails
[15:08:12] dojobo: i'm confused about testing patch in rspec
[16:48:50] dojobo: anyone have an idea what is wrong with my controller spec for patch :update?
[16:49:00] dojobo: test in question is the second one, all the way at the bottom of the gist
[16:49:18] dojobo: getting ArgumentError: wrong number of arguments (0 for 1)
[16:49:46] dojobo: which is easy to parse, but i can't figure out what's wrong with my patch request
[18:23:30] dojobo: anyone have an idea what is wrong with my controller spec for patch :update?
[18:23:33] dojobo: getting ArgumentError: wrong number of arguments (0 for 1)
[18:24:14] dojobo: i feel like i don't understand the patch method, but it's hard to even find the documentation
[18:28:59] dojobo: i've seen stuff calling .update_attributes(params[:user]) instead of .update, but i wonder if that isn't just for older versions of rails
[18:30:33] dojobo: d'oh, i left off params
[19:49:40] dojobo: boo, i thought not_exist was an rspec matcher
[19:56:11] dojobo: looks like expect{}.to change is the way to go
[22:05:23] dojobo: Quit: Leaving


[14:22:13] dojobo: has joined #ruby
[14:22:17] dojobo: has joined #RubyOnRails
[22:12:25] dojobo: Quit: Leaving


[19:04:55] dojobo: has joined #ruby
[19:04:58] dojobo: has joined #RubyOnRails
[19:22:10] dojobo: Quit: Leaving


[16:33:52] dojobo: has joined #RubyOnRails
[16:33:57] dojobo: has joined #ruby
[20:50:24] dojobo: Ping timeout: 246 seconds
[20:58:17] dojobo: has joined #RubyOnRails
[20:58:17] dojobo: has joined #ruby
[22:27:24] dojobo: Quit: Leaving


[17:04:12] dojobo: has joined #RubyOnRails
[17:04:18] dojobo: has joined #ruby
[20:01:17] dojobo: Quit: Leaving


[14:10:19] dojobo: has joined #RubyOnRails
[14:10:26] dojobo: 'morning all
[14:11:00] dojobo: has joined #ruby
[14:15:28] dojobo: i'm an admin in a bottle~
[14:54:35] dojobo: so, i'm trying to use rspec+factorygirl to test a carrierwave uploader:
[14:54:58] dojobo: the problem is around line 7 of factories.rb. i'm getting a nilclass (for Rails.root i think)
[15:11:01] dojobo: anyone have an idea about why Rails.root seems to return nil in this gist?
[15:12:55] dojobo: i'm using this as reference
[15:14:40] dojobo: sure
[15:15:59] dojobo: because i don't know what i'm doing :D
[15:16:07] dojobo: i probably saw it in an example
[15:17:31] dojobo: kegan_, great, glad to help :)
[15:18:33] dojobo: tubbo: i think you might be right. took it out, now the test runs with a failure for uninitialized constant Factory, but it's progress :)
[15:18:36] dojobo: thanks tubbo
[15:20:07] dojobo: d'oh, thanks
[15:22:30] dojobo: and urgh, i see the code i posted isn't even consistent since i had started changing things, embarassing :P
[18:08:32] dojobo: sounds like a job for Array#map
[18:08:56] dojobo: adaedra++
[22:15:55] dojobo: honestly it depends on your goal
[22:16:12] dojobo: if you really just want a blog you could do wordpress, it's very easy to setup and very customizable
[22:19:14] dojobo: in that case, sounds like you should do it from scratch just using rails?
[22:19:27] dojobo: although admittedly i'm not familiar with octopress or jekyll really
[22:20:00] dojobo: but those sound like works-out-of-the-box solutions, and you want to prove you can create a blog in rails
[22:27:54] dojobo: baweaver++
[22:29:19] dojobo: "it's not a blog, it's an authoring platform" <- me, in interview with njero
[22:31:07] dojobo: the mouseover is great too
[22:31:51] dojobo: "not plain html" is also a huuuuuge range of things
[22:33:15] dojobo: i recently learned about the "hairy arms" concept, pretty great
[22:43:00] dojobo: it's design slang:
[22:43:22] dojobo: tl;dr deliberately putting something unattractive in your design so that the boss can remove it
[22:43:30] dojobo: rather than remove/change something you actually want
[22:43:39] dojobo: (boss can == client)
[22:43:52] dojobo: because you know they'll want to change it in some way
[22:45:43] dojobo: could be, or the example in the anecdote above is adding hair to mickey mouse's arms (when he was originally designed)
[22:46:09] dojobo: so the boss can say "ew, take the hair off. ok, that looks better now" and feel content
[22:46:43] dojobo: so it can be expressed on a more detailed level, but yeah sounds similar to TCM
[22:48:19] dojobo: oh, or you're saying that TCM has also been adopted as design slang--i thought you were making an analogy to the card game directly
[22:48:51] dojobo: good to know
[23:00:40] dojobo: fwiw i would think that File.join(Rails.root, 'assets/images/foo.jpg') would do it
[23:01:25] dojobo: Quit: Leaving


[15:21:50] dojobo: has joined #RubyOnRails
[15:21:58] dojobo: any carrierwave experts around?
[15:37:30] dojobo: thanks tubbo
[15:38:55] dojobo: i've installed carrierwave (gemfile + bundle) and successfully added it to my model (successful = was able to upload files in the browser, got a success msg, could see uploads displayed in the view).
[15:40:07] dojobo: but now i'm trying to write rspec tests and i'm getting an "uninitialized constant (NameError)" on my uploader
[15:40:15] dojobo: this is what i'm basing the tests on
[15:40:59] dojobo: the uploader i generated is called ImageUploader, and that's the class i'm getting the nameerror for (MyUploader in the github example)
[15:41:58] dojobo: so, i can't get rspec to include the app/uploaders/image_uploader.rb file. but if i run bin/rails console i'm able to call methods on the ImageUploader class.
[15:43:45] dojobo: maybe i can get away with not testing the uploader since i 'know' it works, but i'm wondering if it won't cause problems when testing my models/controllers
[15:45:15] dojobo: thanks tubbo
[15:51:13] dojobo: ok here's my gist for the carrierwave/rspec nameerror issue
[16:12:35] dojobo: ok, slight progress--describe ImageUploader should be describe 'ImageUploader'
[16:14:58] dojobo: ...but now the spec fails with the same nameerror
[16:15:11] dojobo: (i.e., spec would not run at all previously; not it runs and fails)
[16:21:40] dojobo: smathy++ # thanks!
[16:22:17] dojobo: norrin: i have seen "agile web development with ruby on rails" and "the rails 4 way" strongly recommended
[16:22:37] dojobo: i've used the latter a little bit; i really like it as an in-depth reference
[16:23:00] dojobo: yeah, def not a tutorial-type book
[16:23:51] dojobo: IMO rails crash course by anthony lewis is pretty good for what you're looking for
[16:24:15] dojobo: tubbo, they don't take any longer to read than an article on the web?
[16:24:30] dojobo: smathy: thanks for looking it over. spring stop?
[16:25:37] dojobo: agreed! although, i'm a librarian, so maybe i have a bias in favor of books ;)
[16:29:54] dojobo: smathy, spring stop didn't work :(
[16:30:09] dojobo: Norrin, good luck! i am still a rails newb myself
[16:32:03] dojobo: my experience has been that rails seems easy to get going because of scaffolding, and of how MVC separates components for conciseness
[16:32:25] dojobo: but then you start trying to add new models and controllers and suddenly it gets complicated
[16:33:48] dojobo: yeah that's ORM for you, i think it's easier for people who know no SQL, but harder for people who do
[16:33:53] dojobo: (that's my newb take anyway)
[16:38:36] dojobo: smathy: yes
[16:40:54] dojobo: Norrin fwiw you can write more SQL if you want to
[16:41:26] dojobo: smathy: no worries, i just added that to the gist. and actually i only learned about the "test" console option in trying to figure out this problem
[16:42:45] dojobo: Norin:
[16:43:52] dojobo: i will say, i find it more convenient to update object attributes than i do to write an UPDATE statement
[16:47:10] dojobo: thanks smathy and tubbo for looking at my code, it makes me feel better that the problem is at least not obvious to y'all
[16:48:21] dojobo: i'm a self-taught coder so getting stuck on something like this is really discouraging and makes me question whether i should be trying at all :P
[16:52:04] dojobo: creature:
[16:52:45] dojobo: now i'm slightly embarassed for being seen mixing single and double quotes in my gemfile, heheh
[16:54:27] dojobo: creature: thanks for the tip. that migrate was actually way overdue, haha, but i still get the nameerror for ImageUploader
[16:56:21] dojobo: ooo, creature i think that might've done something
[16:56:42] dojobo: added require 'rails_helper', test fails now but for a different reason
[16:57:18] dojobo: kegan_: i think it does, as long as you're not trying to call anything private
[16:57:36] dojobo: (i.e. anything defined in the model after the 'private' keyword)
[16:58:25] dojobo: now it's telling me that @uploader in the spec is nilClass, so i need to do some more work. but at least it's seeing my uploader now!
[16:58:36] dojobo: creature++
[16:59:36] dojobo: ahh. i need to do more reading on helpers then
[17:00:03] dojobo: i've done a few tutorials but this is my first from-scratch rails app
[17:00:31] dojobo: so the things the tutorials gloss over are starting to bite :)
[17:00:56] dojobo: yeah, but you have to start somewhere
[17:02:00] dojobo: ok, thanks
[17:03:14] dojobo: my main source of headache right now is (i think) adapting my first, scaffolded model after adding a parent model
[17:04:20] dojobo: i.e. i scaffolded A, added some stuff and tested, then i generated model B and gave it a has_many A relationship (and added A belongs_to B), along with nesting the resource in routes.rb
[17:05:09] dojobo: but i've been having controller/form? issues for A to work now. after going in circles i think i just need to meticulously unit test
[17:06:19] dojobo: i started the project with a TDD approach, but haven't kept it up, and since i stopped i've just been confused
[17:08:24] dojobo: mices: yes, @picture is an object, and it is also an instance variable
[17:08:40] dojobo: ( @ means instance variable)
[17:08:57] dojobo: you want the @ there so that you can access the object in your view
[17:09:24] dojobo: 'picture =' creates a local variable that can only be used in a local context
[17:10:26] dojobo: or you can think of it as an object that is an instance of the Picture class, with "@picture" as its name
[17:20:33] dojobo: mices, if you've worked with perl, i can see how the variable symbols would confuse. in ruby they're used only to indicate context, not type
[17:23:46] dojobo: kegan_: are you committed to nifty attachments?
[17:24:22] dojobo: yeah, or rather whether you'd be willing to use a different one
[17:24:51] dojobo: that one looks new and only has a couple of contributors
[17:25:04] dojobo: it seems like paperclip and carrierwave are the standards
[17:25:43] dojobo: personally, i ran into trouble with paperclip and have switched to carrierwave
[17:25:46] dojobo:
[17:28:56] dojobo: kegan_: it's hard to tell. for one thing, the only snippet i see (the pastebin) is from your controller, and if you're having trouble seeing the attachment then it might be a view problem
[17:29:45] dojobo: for another, since the gem is not widely used or well documented, it could easily be an issue with the gem
[17:30:41] dojobo: kegan_: if you decide to use carrierwave
[17:32:02] dojobo: kegan_ can you put up a gist of the model?
[17:33:05] dojobo: it depends on the gem as to whether you need a migration (the readme should tell you), but you probably need one
[17:34:04] dojobo: because the gem will probably deal with data that you want to be persistent--you want the app to remember it when the server restarts. that means it should live in the DB, which means you need a migration
[17:34:45] dojobo: did you try bin/rake db:rollback ?
[17:35:26] dojobo: that will try to undo a migration... but i'm not sure if it revives dropped tables (and of course there's no recovering actual data from dropped tables)
[17:38:15] dojobo: ah. generate nifty:attachments:migration should create the table structure you need, i'd think
[17:38:28] dojobo: you can always check db/schema.rb to see what the table looks like
[17:40:41] dojobo: oh, to answer your earlier question, you do need the attachments to me in .permit
[17:41:13] dojobo: because the controller will not accept anything that is not listed in permit, it's a security feature
[17:42:01] dojobo: mmm, i dunno, but i don't think it would be hard for you to scrap nifty and go to carrierwave instead :P
[17:43:00] dojobo: kegan_ i dunno, i'm pretty new myself, so my comments are just pretty cursory--i wouldn't be able to tell you if it's your code or the gem's, honestly
[17:43:24] dojobo: but at least with a widely used gem you have more support
[17:43:38] dojobo: and more confidence that it works as it should
[17:46:26] dojobo: you'll find out soon enough once you implement a different gem
[18:28:22] dojobo: how much time/effort investment is required to start using factory girl?
[18:28:40] dojobo: (vs writing specs without it)
[18:31:23] dojobo: is it pretty straightforward?
[18:55:33] dojobo: smathy: thanks, checking it out :)
[21:09:11] dojobo: is railscasts still active?
[21:09:24] dojobo: as in, new episdoes
[21:13:16] dojobo: yeah looks like railscasts stopped a couple of years ago :P does anyone have a current alternative (gorails, codeschool) they like?
[21:45:13] dojobo: thanks x-light
[22:09:11] dojobo: Quit: Leaving


[14:00:41] dojobo: has joined #RubyOnRails
[14:02:05] dojobo: can i really not use paperclip to persist file uploads? (so i don't get validation errors when the user is updating another part of the record)
[21:59:34] dojobo: Quit: Leaving


[00:02:52] dojobo: has joined #RubyOnRails
[00:04:18] dojobo: i'm trying to iterate over each result in an ActiveRecord::Relation and increment a particular attribute by one
[00:04:51] dojobo: heh, thanks :)
[00:07:06] dojobo:
[00:07:21] dojobo: "slides" as in for a slideshow, if that helps
[00:08:21] dojobo: my spec is not showing display_order going up
[00:10:45] dojobo: initially i was trying to treat the relation like a regular array, but looking around, i read something saying .find_each should do the trick
[00:11:05] dojobo: Relation#to_a also didn't seem to make a difference
[00:24:02] dojobo: hmm, maybe display_order ought to be expressed in slidelist anyway
[02:58:42] dojobo: Quit: Leaving
[15:12:15] dojobo: has joined #RubyOnRails
[17:13:35] dojobo: anybody here used the acts_as_list gem?
[22:16:44] dojobo: Quit: Leaving


[22:20:40] dojobo: Quit: Leaving


[16:36:37] dojobo: has joined #ruby
[16:36:51] dojobo: anyone have trouble getting cron and nokogiri to work together?
[16:38:50] dojobo: yeah i've got a script that uses nokogiri to do some transformations on an rss feed and save it as a new file
[16:39:12] dojobo: and i want to run it in cron so that it does it every few hours
[16:39:22] dojobo: (since the rss is continually updating of course)
[16:40:01] dojobo: i'm using rvm and i've done another script using the wrappers, so i don't think that's the problem
[16:41:03] dojobo: i'm getting the 'cannot load such file' error even though doing `rvm use 2.1.5` and `require 'nokogiri'` => true
[16:41:16] dojobo: (and i'm using the 2.1.5 wrapper obviously)
[16:43:38] dojobo: thanks Senjai, i'll look into this :)
[16:43:58] dojobo: i'm guessing having both rvm and chruby will cause problems?
[23:03:31] dojobo: Quit: Leaving


[15:19:26] dojobo: has joined #ruby
[15:20:16] dojobo: i'm getting "no such file or directory" with open-uri (using a local path, not a url) even though i can cat the very same path just fine. ideas?
[15:21:00] dojobo: (also, the script worked fine in windows, now i am trying to run it in linux--with an appropriate filepath of course)
[15:30:00] dojobo: thanks shevy and adaedra, was afk for a few, will try those
[15:33:56] dojobo: hrmmm... File.exists? is returning false with both file:// and the bare path
[15:36:47] dojobo: shevy: but "cat ~/file/path.rss" prints the file
[15:37:10] dojobo: ah so maybe that's my problem
[15:38:02] dojobo: a-ha, now it returns true
[15:38:39] dojobo: shevy: yes, that worked for me too
[15:39:17] dojobo: although since these are just paths i'm throwing in a yaml, i'll do abs paths, but expand_path is good to know
[20:14:06] dojobo: i'm failing to load nokogiri on a cron job
[20:14:24] dojobo: i'm using rvm with 2.1 so it should work?
[20:15:14] dojobo: thanks havenwood, i did use that
[20:16:37] dojobo: yeah, my rvm path seems to be ~/.rvm
[20:16:53] dojobo: (in crontab i'm using the absolute path though, not ~)
[20:17:41] dojobo: i'm gonna try 2.0 in case there's some funkiness with the 2.1/nokogiri install
[22:01:11] dojobo: Quit: Leaving


[17:19:14] dojobo: has joined #ruby
[17:54:54] dojobo: hexchat doesn't show those emojis :/
[17:56:17] dojobo: nah, windows port of the linux app
[17:56:31] dojobo: wish i could use linux at work though
[22:57:29] dojobo: Quit: Leaving


[15:08:24] dojobo: how do you mean?
[15:08:53] dojobo: that would replace lines 15-25
[15:09:06] dojobo: once i added in the nlst to that paste, anyway
[15:09:37] dojobo: this is very educational, i can't parse it yet :)
[15:12:49] dojobo: so the nlst call is an argument of the concat call? am i reading that right?
[15:16:02] dojobo: thanks so much jhass :)
[15:16:18] dojobo: i'm sure my code is very amateur, i'm self-taught
[15:17:54] dojobo: i use stackoverflow a lot
[15:18:11] dojobo: but with this particular problem i couldn't even decide how to google it ;P
[15:28:43] dojobo: jhass: i think it's faster now :)
[21:53:07] dojobo: is great for testing and reference btw
[22:01:47] dojobo: weaksauce++
[22:12:59] dojobo: Quit: Leaving