#RubyOnRails - 03 October 2015
« Back 1 day Forward 1 day »
[00:06:45] pwnd_nsfw: Is it an acceptable practice to just not give a shit about the specs if the code you're testing works through a manual test??????????????????????????????????????????????????
[00:09:16] bricker: pwnd_nsfw: what's not acceptable is delivering a feature late because the test was giving a false failure
[00:22:39] pwnd_nsfw: You're right, but... like... really, you'll laugh if I show you what's got me stuck.
[00:23:55] simkessy: smathy: I was doing some reading on the session store question I asked earlier. I came across this article that says storing sessions in the DB will cause issues as a site grows in popularity http://blog.remarkablelabs.com/2012/12/activerecord-sessionstore-gem-extraction-rails-4-countdown-to-2013
[00:24:23] simkessy: Right now my site only has 4 active users (testing) and I'm already hitting a CookieOverflow...that's not normal right?
[00:24:24] bricker: I have definitely deleted tests before because they weren't passing. They were providing little value, or were already covered in another test, and after trying for 15-30m to get it working just decided it wasn't worth the time. You need to choose your battles.
[00:26:22] Mattx: Is it possible to define a method with the same name as an attribute, and still be able to save the model?
[00:26:45] bricker: pwnd_nsfw: spending this much time getting a test to pass is not a very good example ;) Tests are supposed to be quick and mindless to write
[00:27:17] Mattx: for instance, if I have a string attribute "list" with value "a,b,c", I would like to do myobj.list and receive ["a", "b", "c"]
[00:27:54] FailBit: simkessy literally wtf are you putting in your session that causes a cookie overflow
[00:28:39] Mattx: bricker, I know that would work TO READ the attribute, I can do read_attribute(:list) too
[00:28:46] simkessy: FailBit: I just installed Devise and Omniauth and let that handle login, I haven't done anything with cookies (ever actually). It's pretty new to me
[00:29:29] FailBit: simkessy: devise on its own should not cause a cookie overflow. never heard of omniauth but I suspect that's the issue
[00:29:53] Mattx: rails ends up calling the method with the attribute name to validate it, not the attribute itself
[00:30:29] bricker: Mattx: no. It sounds like you want to use `serialize :list, Array` anyways, which handles all of this for you.
[00:31:13] simkessy: ill take a look at their github and see if they have anything regarding cookies
[00:35:12] simkessy: FailBit: guessing this is the issue session["devise.google_data"] = request.env["omniauth.auth"]
[00:35:32] Synthead: I am using PostgreSQL and Que for ActiveJob jobs. When I do a .perform_later on a task, it never runs. Should I be running a daemon for this or something? I'm using "rails server" in development mode.
[00:37:02] smathy: Synthead, sorry, you're right, it doesn't mention it explicitly because it depends which backend you chose.
[00:37:15] smathy: Synthead, whichever backend you chose, go read that to see how to setup the workers?
[00:37:23] hightower4: Hey, when I have f.field_container and the form is shown, existing values are already pre-filled. How can I manually retrieve the current value of a field to modify its actual value: before display?
[00:38:17] hightower4: (Like, for the purpose of a dropdown -- I would like to retain current selection, or select a default entry if no current value exists)
[00:38:27] Mattx: bricker, just in case someday I come along a case in which I REALLY want to use a method with the same name as an attribute (like described above). is there a way to avoid the validation error on save()?
[00:39:01] smathy: simkessy, ignore that article, you can find an article that will say just about anything. It's trivial to change your session store later if you ever need something more performant.
[00:40:12] smathy: simkessy, using your DB is a very simple change and will get you app back up and running with zero new software required on your server.
[00:40:38] simkessy: smathy: okay, well I'll do both, I'll reduce the cookie and tryout the DB if performance doesn't degrade then it's win win
[00:40:43] Mattx: class MyClass; validates :foo, inclusion: [0, 1, 2] def foo; self[:foo].to_s + "!"; end; end;
[00:41:31] smathy: Mattx, !gist your actual code and the console session showing the crash and error.
[00:41:31] helpa: Mattx: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[00:46:44] helpa: NO FAKE CODE. If you're under an NDA, we cannot help you with your problem. Go hire a consultant.
[00:50:09] Mattx: it will break apart for a reason that has nothing to do why my real model. rails tries to validate the attribute "foo", but it uses the value of the method "foo", instead of using read_attribute(:foo) or something
[00:51:46] Radar: If I have to ask you more than 3 times to follow the channel rules, that's a paddlin'.
[01:17:23] FailBit: ActionController::RoutingError (No route matches [POST] "/dis/the-time-wasting-thread/post/55a951b2636872504900098e/trackback"):
[01:17:25] helpa: FailBit: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[01:21:50] pontiki: if they have a discernable source and/or pattern, you can even toss them before they get to the app server
[01:27:12] pontiki: well, hmm. you should still be able to rescue that error, and you should have the entire request object at that point, i think
[01:32:13] hightower4: Hey, how do I retrieve the current URL in a rails app, or more specifically, how would I change the locale? E.g. if the user is on /en/profile/show and wants to switch to locale "de", how would I redirect him to /de/profiles/show?
[01:35:56] pontiki: hightower4: to get the current URL, look at http://api.rubyonrails.org/classes/ActionDispatch/Request.html
[01:37:18] hightower4: pontiki, right, I was hoping there would be some more automated way, but this will certainly do. Thanks
[01:39:01] hightower4: Sigma00, right, sure, but I need to replace the current locale with a new one, while not redirecting the user to the main page but reloading the page they are currently on
[01:40:52] Fuzai: How does one use mongoid from a rake task to update a database? I've been looking all over and having no luck, all the examples seem to start their own connection to the database server and I would rather use Mongoid.
[01:40:54] pontiki: using the example at http://guides.rubyonrails.org/i18n.html#setting-the-locale-from-the-url-params, you could modify that :set_locale callback
[01:42:25] Fuzai: I'm too new to be able to answer that, I think that's a no, this is my first rake task. :)
[01:42:30] hightower4: pontiki, yes, right, the issue is that I use a method with /LL/path instead of path?locale=LL, and so if I append ?locale=LL at the end of the URL, the /LL setting takes precedence and makes ?locale=LL ineffective. So I do need to find out the current path (which I'll do with request.fullpath), and replace the locale in it
[02:10:59] mices: if i'm gonna add a column what's the benefit of using migration vs direct to database
[02:25:24] linoge: Hi, I chose SpreeCommerce for an eCommerce website I'm building and I'm a bit lost about how to edit views in both frontend and backend. I would like to do full customization of those, but it feels a bit... unnatural?
[02:47:27] diegoviola: https://github.com/diegoviola/movies/ <-- source, let me know if I can do something better...
[02:47:29] bonhoeffer: i???m adding a second theme ??? witih custom layout ??? how do i get bootstrap integrated?
[03:07:27] hightower4: Hey, how can I throw a validation error from a before_save? I am doing errors.add :fieldname, :msg, but it is letting the save go through without stopping it
[04:01:33] chipotle: i wanted to know how you pick your stack? MEAN seems to be very popular today, which is js, so is ang js, backnone etc. so how do you pick your tech stack if you use js instead of RoR (i'm coming from a drupal background)
[04:08:45] Fuzai: I've got a rake task that I would like to have run every 10 minutes in production. What is the best way to go about automating this if I don't have access to cron?
[04:12:29] dnewkerk: hey chipotle - I???m a former Drupal person too. For me my boss picked Rails (we started with Drupal though and rebuilding in Rails)??? and I???m very grateful :P
[04:13:57] creature: Fuzai: Do you have a job queue? There's resque-scheduler for Resque, Sidekiq has scheduling stuff in it too.
[04:14:34] Fuzai: I don't, do either of those require an external service? I'm trying to deploy this to Openshift
[04:15:04] chipotle: dnewkerk: nice! what would you say the main changes are, or the philosophy being different? any tips?
[04:16:04] creature: Fuzai: No external services, but I don't know if they're supported on Openshift. http://sidekiq.org/ will probably be the best intro to it (and is probably a better pick than Resque these days)
[04:18:43] creature: Actually, the Github project is probably a much better intro. https://github.com/mperham/sidekiq
[04:21:28] havenwood: Fuzai: I recall a discussion of the why on Ruby Rogues: https://devchat.tv/ruby-rogues/221-rr-sidekiq-with-mike-perham
[04:22:19] Fuzai: The problem with redis for openshift is that it is community supported only with no updates
[04:40:51] mices: FailBit: when will my app refer to shema.rb and what if i've been manually altering my table structures without migrations, i forgot what command do i run to bring my schema.rb into sync with my true table structures
[04:44:57] Radar: Your other question was "[13:56:30] <chipotle> so how do i choose what to build the app?
[04:45:10] chipotle: seamless.com in nyc and grubhub.comm otherwise, hate talking on the phone because they don't speak english well at most plcaes in nyc and they get orders wrong or address wrong
[04:45:31] chipotle: i wanted to know how you pick your stack? MEAN seems to be very popular today, which is js, so is ang js, backnone etc. so how do you pick your tech stack if you use js instead of RoR (i'm coming from a drupal background)
[04:45:48] chipotle: and of course there is also nodeJS, but i know the main contributor left so i don't know if it's used much anymore
[04:48:18] chipotle: Radar: so what about js vs ror then? what is the reason people decide one or the other?
[05:17:16] dnewkerk: mices I???ve heard it said, it???s better to be a ???developer??? who uses languages (they come and go). Don???t let your tools define you
[05:20:03] cycliam: Hello. Basic question here. I have an object of a model class, like t = Thing.new. I have a method of the Thing class that I want to operate on self. I call t.func(), update attribute like self.x = "y" inside func, but when func returns, t.x is still nil. How can I fix?
[05:20:29] helpa: cycliam: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[05:20:35] helpa: cycliam: NO FAKE CODE. If you're under an NDA, we cannot help you with your problem. Go hire a consultant.
[05:20:58] mices: things are always changing, advancing, but for now mvc is great leap towards getting organized
[05:22:40] pontiki: anything you think is new now, martin fowler wrote about 2 decades ago, at least
[05:22:40] Radar: Turns out, putting things in the same (or similar) place across different applications makes working with those applications easy. Who would've thought?
[05:23:56] baweaver: be very careful not to treat something that religiously without reading into it more
[05:25:25] Radar: pontiki: agreed. That problem that "couldn't possibly be a timezone issue" that you spend 8 hours debugging... well, it could be a timezone issue ;)
[05:25:28] cycliam: no, that prints what we want. the problem is that when the function returns, the object it was called on does not have those values
[05:26:22] baweaver: you should not name something get_* if it's setting items. That's lying to your consumer
[05:29:01] mices: if i had a perfectly good app and i deleted schema.rb and then ran rake db:shema:dump i should then have a correct shema.rb created that matches my database?
[05:29:57] cycliam: Radar: You're right. I think it's failing to set due to incompatible types. last_flight_duration is not an int. The other data DOES get set. Thanks.
[05:39:23] thejamespinto: hey, can anybody help me with a question that I won't even begin composing until I get some validation because I'm really insecure? :D
[06:03:52] absklb: while I was running rails in developement mode my OS crashed due to some other reason. When I log back in and try try to run rails s it complaintsn that some other rails is running and using port hence cant run. i delete the pid/server.pipd something
[06:05:56] absklb: /var/canvas/vendor/bundle/ruby/2.1.0/gems/eventmachine-1.0.4/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
[06:31:53] chipotle: thejamespinto: initially it's coming for us. you can ask but ask again noon eastern time, you'll be fine
[06:59:18] thejamespinto: I'm usually the best guess on movie endings in all my friends circles and I'm often bored as hell cause the plots seem stupid to me
[08:32:38] naftilos76: Hi, i am trying to figure out ways to optimize the process of fetching thousands of rows from the database and still get a completely rendered page in less than 2-3 seconds. This has got to be done by converting the instance that has the database rows in a raw json data object passed to a js var in my js view and then build a table with js/jquery. This is my approach so far but the thing is that i do not want to keep all that data fetched in a
[08:32:38] naftilos76: table but instead keep it in a js var and selectively copy paste to the actual visible table to the user. Do you have any suggestions regarding ways to further optimize this procedure?
[09:14:22] absklb: how can i concatenate link to so that i will have root_path/courses/id where in my loop i keep changing id?
[09:18:14] absklb: jhass: i have to create a link to my text which will point to http://localhost:90/courses/5
[09:19:55] absklb: thats just for one course. as example. i have to do it many times in loop where 5 will be provided by a variable.
[09:21:44] absklb: thats why i was going step by step where you would have understood, but since you directly want to jump....
[09:26:46] arup_r: if you are not using resource or resources .. then use as: option to define the route helper
[09:28:49] absklb: what if the loop from where i am printing does not iterate through Course model? what if itns 100% completely differant and inside that i am manually making relation to course?
[09:33:59] jhass: absklb: then you didn't provide a good justification for doing so and we tell you that it's a bad idea but that you can just pass your variable to your route helper (probably course_path)
[09:54:52] absklb: all my courses have a route as http://localhost:90/courses/5 that means there should be a root called "courses_path" which will be /courses/:course_id/" right? but i dont find it in my rake routes?
[09:57:33] tbuehlmann: absklb, assuming a regular `resources :courses` in your routes.rb, you will have a couses_path routing to /courses
[09:58:41] bonhoeffer: what is the purpose of making my assets with a sha style tag at the end: url(/assets/blog/home-bg-bf3e5cd50e2a0f051728a1c2936b6a4a.jpg);?
[09:59:25] bonhoeffer: i???m wondering both out of curiosity, as well as trying to troubleshoot why the image isn???t showing
[09:59:36] tbuehlmann: bonhoeffer, see http://guides.rubyonrails.org/asset_pipeline.html#what-is-fingerprinting-and-why-should-i-care-questionmark
[09:59:56] bonhoeffer: ah ??? found the latter, and tbuehlmann thanks for the link ??? fingerprinting was the key phrase
[10:02:49] absklb: jhass: i just saw that only. and since its too much long list i tried to use grep and .txt
[10:18:34] absklb: if i do <%= link_to "Resume", courses_path(crss.id)%> it prints courses.4 if i do <%= link_to "Resume", courses_patcourses_id => crss.id)%> it prints courses?courses_id=4. How can i make it print courses/4 ??
[10:47:42] bonhoeffer: has anyone ever seen this: app.edit_blog_article_path(u, Blog::Article.last) -> "/blog/articles/1/edit.4"
[11:22:31] raunicolae: has left #RubyOnRails: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[11:29:17] arup_r: when you have a ActionController::Parameters object and you want to get all keys except say the key "email" .. what method to use ?
[11:55:09] bonhoeffer: curious if anyone has figured out to how to speed up rails in development . . . i have to wait so long for reloads
[12:13:26] arup_r: I need some refactoring tips: context, I am using InvitationController to invite users to onboard in our system. That's fine. Now, we do soft delete to our users. a soft delted user can be restored again, and I am using in this case the same form, which I use to create. all works. But the code looks very bad, and how can I improve it ?
[12:40:44] DEA7TH: Is it acceptable to populate a DB with mock data with my own script at lib/tasks/db.rake written in Ruby? I already did that (took 240 loc) and it seems quite okay actually, but there are these data generator tools...
[12:41:54] DEA7TH: I have like 12-15 tables in my DB and a lot of them have strict requirements about their contents.
[13:52:17] chipotle: anybody here use foundation? is it good? how does it compare with twitter bootstrap
[13:58:50] chipotle: looks like foundation is trying to sell stuff, i wonder if they will make the app server cost money sometime? that is worrisome
[14:01:27] sevenseacat: hmm, i wonder how that compares with twitter bootstrap then... lets try 100% unrelated
[14:04:25] chipotle: sevenseacat: why the sarcasm. i live on the west side by columbia. it took me 15 mins in a car to get there
[14:11:58] chipotle: sevenseacat: i'm not stupid but i am a newbie. everyone says to ask questions when you have problems. i don't understand, i am just asking questions so i can launch a RoR app i made
[14:12:10] pontiki: while you're looking at frameworks, also read through smacss, which isn't a framework, but more a philosophy of writing frameworks.
[14:12:57] sevenseacat: the conversation was fine until you derailed it with that, and then going on about columbia, whatever that means
[14:14:47] chipotle: i got the book css and the 2011 book that covers html and css and is quite popular
[14:14:59] chipotle: i thought i could learn both because html/css is very different than coding in ruby
[15:38:06] lalalaaa: Anybody ever gotten "This site may be hacked." on Google? Pretty sure my site isn't hacked.
[16:09:32] mehwork: rails new myapp -d mysql then http://localhost:3000 says "Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord)."
[16:10:35] mehwork: why doesn't rails add the right minimum version automatically to Gemfile to prevent this error? Instead it just puts gem, 'mysql2' with no version
[16:28:55] mehwork: it's because it installs an outdated/incompatible version of mysql2 by default 0.4.1
[16:32:21] mehwork: it would be cool if bundler could figure out if a version was incompatible before installing stuff. I imagine they don't do that for the sake of speed though
[16:32:22] arup_r: mehwork: before 1 week or so.. I saw a similar discussions here.. universa1 was involved in that
[16:32:59] arup_r: They somehow figured out.. that latest version has some issues. and as far as I remember, the OP degraded it and it worked.
[16:48:23] mloy: arup_r mt means mistell, I said that to the wrong chat. Meant to do it in an empty channel just to see if I was connected because my IRC client is being weird right now.
[17:49:04] lalalaaa: Setting up https:// instead of http:// has nothing to do with Rails right? It should all be part of ones Nginx configuration?
[18:10:25] mehwork: are there any good conventions for not having to type 'bin/cmd' (bin/rails, bin/rake, etc) all the time? But NOT putting a project's bin/ dir in PATH?
[18:11:07] mehwork: i'm using rbenv, so i guess i can use that but not sure if it's bad or not to do that
[18:18:08] VeryBewitching: I've never encountered a scenario where I had to relatively specify the path to the binstubs
[18:49:45] mehwork: this says you should always type bin/whatever http://notes.jerzygangi.com/what-is-the-bin-director-in-a-ruby-on-rails-project/
[18:54:35] VeryBewitching: thejamespinto: Amen. The Debian package manager is why I'm on Kubuntu. I can't abide by RPM anymore.
[18:55:06] thejamespinto: I used Kubuntu for a while, then I got a new computer and totally ignored it for like 3 months, when I turned it on I looked at KDE and I felt like I had found a fossil
[18:56:06] thejamespinto: I often have a very pleasant experience when I'm using XFCE for either Debian or Ubuntu
[18:59:13] VeryBewitching: thejamespinto: https://dl.dropboxusercontent.com/u/1422687/kubuntu_papirus_dark.png for dark and https://dl.dropboxusercontent.com/u/1422687/breeze_light.png for light
[19:00:03] thejamespinto: XFCE makes me feel like I'm on win95/98, when your OS was focused on having a simple organized interface. Now most OS focus on giving you a "responsive experience", (and so do most websites... sigh) God damn it! It's my personal computer, not a dog!
[19:02:28] thejamespinto: It's main focus should be on opening apps, it's not a TV, it's not a jukebox, it's not a Photo & Video gallery to share my important moments with my Family & Friends, it's not a personalized phone to save me clicks when I'm TWD. It's my personal computer! It's the means to open apps!
[19:03:11] lalalaaa: Choose OpenBSD for your Unix needs. OpenBSD -- the world's simplest and most secure Unix-like OS. Creator of the world's most used SSH implementation OpenSSH, the world's most elegant firewall PF, the world's most elegant mail server OpenSMTPD, the OpenSSL rewrite LibreSSL, and the NTP rewrite OpenNTPD. OpenBSD -- the cleanest kernel, the cleanest userland and the cleanest configuration syntax.
[19:03:32] thejamespinto: jeez it felt good to let it out, I've been having that hanging on my throat since I first used Windows ME
[19:10:16] thejamespinto: arup_r: do you need to set it to AV to use it as a computer, or is it the other way around?
[19:29:37] mehwork: this is so confusing. even my rails book says rails 4 users should use the binstubs in bin/ and always shows using 'bin/rails' yet even though bin/bundle works they just say to use 'bundle install' not bin/bundle install
[19:30:06] mehwork: i thought rails community was all about consistency and convention. Just a heads up from a noob, it's confusing hehe
[19:32:16] mehwork: lalalaaa: that's a bad idea according to the last paragraph of http://notes.jerzygangi.com/what-is-the-bin-director-in-a-ruby-on-rails-project/
[19:32:39] FailBit: PATH: /home/derpibooru/.rbenv/shims:/home/derpibooru/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
[19:32:56] mehwork: FailBit: right, i'm using rbenv so i don't know why i wouldn't just use what that puts
[19:33:22] mehwork: apparently i'm not the only one who is confused since everyoen seems to be doing things differently hehe
[19:36:15] lalalaaa: mehwork: I think doing path+= like that will ensure it appears first in your PATH load order
[19:41:04] mehwork: rbenv already automatically uses PATH so if you're already using rbenv i think it makes sense to just install gems to the same version of ruby your rails is expecting
[19:42:44] lalalaaa: last i checked wasn't everyone in favor of dropping rbenv / rvm in favor of ruby-install?
[19:43:35] mehwork: https://github.com/sstephenson/rbenv/wiki/Understanding-binstubs#adding-project-specific-binstubs-to-path
[19:47:11] mehwork: there needs to be an acronym like If It Works Use It IIWUI or If it's Working It's Fine IWIF
[19:57:49] lalalaaa: Trying to switch to HTTPS. Used https://www.digitalocean.com/community/tutorials/how-to-create-an-ssl-certificate-on-nginx-for-ubuntu-14-04. Now turns out I have to buy a SSL certificate. Is there no way around that?
[20:27:35] lalalaaa: Shouldn't https://github.com/kjvarga/sitemap_generator automatically create a sitemap based on routes.rb? Looks like I have to manually add stuff to config/sitemap.rb..
[20:29:16] Radar: Rails integration provides access to the Rails route helpers within your sitemap config file and automatically makes the rake tasks available to you
[20:36:03] lalalaaa: wuuut.. the URL in `public/robots.txt` doesn't work.. http://www.robotstxt.org/wc/norobots.html
[20:59:14] rhizome: fans of better_errors, et al stay safe: http://arstechnica.com/security/2015/10/patreon-was-warned-of-serious-website-flaw-5-days-before-it-was-hacked/
[21:14:20] Scient: undefined method `respond_with' for #<RSpec::ExampleGroups::APIController::POSTDestroy::Failure:0x007f824f0eadc0>
[21:25:46] mehwork: is there a way to get gems to install in a local directory in the project, like how npm does with node_modules?
[21:26:55] lalalaaa: Exactly how do I access `robots.txt` and `sitemap.xml.gz` from `public/` with Nginx? This doesn't seem to work: https://gist.github.com/dt1973/2d2ba36f85db30addac8
[21:30:40] lalalaaa: doesnt seem to be.. my config was like that earlier actually.. i added that one location and moved / first based on http://stackoverflow.com/questions/22978503/rails-not-serving-my-robots-txt-and-sitemap-xml-gz-on-production
[21:40:37] comm64x: I'm trying to figure out the best way to make a link_to. The page I'm linking to, i.e. the href should be href="/topics/subtopic/article". What I've got so far is <%= link_to 'Article Name', '/topics/subtopic/article' %>, but is there a better way to do this?
[21:43:04] comm64x: I checked the docs and none of the examples given match. The only alternative I can think of is to restructure my entire site which I really dont want to do lol.
[21:50:18] mloy: vi is cool too I have nothing against it, I just prefer emacs. I could write my own mode but just seeing what people use :)
[21:50:55] comm64x: routing helpers are new to me, but I googled it and it mentioned using them in your models
[21:51:51] C0L0R: How do I access a json object that Instagram is sending via POST? I have tried params["_json"]["data"]["media_id"] but I couldn't access it. Here is a dump of the POST: http://pastie.org/private/h6zuwimzzmpydfbaf6td5a
[21:52:38] comm64x: idk thats what came up when I googled routing helpers...I've never heard of them before
[21:55:13] mloy: lalalaaa: lol neovim seems cool. Idk, I just learned emacs when I was obsessed with learning Common Lisp and I'm past the point of no return.
[21:55:51] comm64x: ah okay, yeah thats what I found when looking through the docs but I couldnt find an example that would work with my site structure, for example image_path(@image) would give images/:id or something like that but I need something that will give topic/subtopic/:id. Topics is the controller, so would I have to have an action for every subtopic? that wouldnt be very RESTful though
[22:00:25] mehwork: is there a flag or anything like npm's --save like 'npm install foo --save', that installs a gem and writes it to the Gemfile at the same time?
[22:01:49] mehwork: looks like this can do it http://jaketrent.com/post/save-gem-to-gemfile-from-terminal/
[22:03:14] FailBit: lalalaaa: if that timeout didn't happen the request would take 65s and transfer 6 MB of HTML
[22:04:35] FailBit: but instead of waiting 65s, nginx cuts it off after 30s and renders this page https://derpibooru.org/error_50x.html
[22:08:52] mehwork: how do you make a binstub for rspec? I ran 'gem install rspec && bundle binstubs rspec' but it says 'Could not find gem 'rspec'
[22:10:55] arooni: seeking suggestions for a simple backend for a one product ecommerce site. i'm selling press passes to get into events/clubs/bars etc. requirements: user should be able to upload their photo & give me their full name / checkout + cart / pay with credit card (probably thru square or braintree) / ability to track or integrate with an affiliate platform. suggestions?
[22:11:37] mehwork: i think i assumed too much about rails required no configuration that i assumed i wouldn't need to edit config files much. TIL
[22:18:08] baweaver: C0L0R: context: http://pastie.org/private/h6zuwimzzmpydfbaf6td5a - earlier question on accessing JSON
[22:23:26] mehwork: i assume since rspec is a dependency of rspec-rails, Gemfile.lock saying rspec would be enough explicitness?
[22:24:38] lalalaaa: i'd imagine nothing but little girls but something tells me thats far from the truth
[22:26:41] FailBit: ah but I always forget the 4chan/8ch asswipes that occasionally drop by and get themselves hellb&
[22:28:16] lalalaaa: i just recently completed mine and have about.. 10 users.. any tips on how to grow would be much appreciated
[22:29:23] lalalaaa: right now im just walking down the street till my feet stank asking people to "please come check out my site"
[22:42:12] gambl0re: if i had a form inside a nested resource like /posts/comments i would create the form such as "form_for(@posts, @comments") ?
[22:43:17] gambl0re: and i'd do the same thing if i had 3 nested resources /nested1/nested2/neste3 i would do "form_for(@nested1, @nested2, @nested3) " ?
[22:48:30] FailBit: thejamespinto: I picked it up after jumping into the codebase I currently occupy
[22:48:33] thejamespinto: FailBit: please, teach me where you get such massively wonderful amounts of information, I want to drink from that fountain
[22:48:57] quintus: Hi there. I'm trying to dynamically change the background image on only one static page. My <body> tag is in application.html.erb, and I'm trying to pass a variable @background_image from a method within my static pages controller through to the application layout.
[22:49:14] FailBit: if you are willing to >do it for free and work with art of small cartoon horses I can guide you
[22:49:38] quintus: Right now, the application layout can't see the @background_image contents, though I'm setting them in the static pages controller.
[22:49:41] Radar: quintus: Do you have a question or are you just telling us that's what you're doing?
[22:49:46] helpa: quintus: 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.
[22:51:14] quintus: Radar: I was describing in detail to avoid the XY problem. I want to pass information from a static pages controller to the application layout, but as of now, the application layout can't see it. The question would be: Why can't the application layout see it?
[22:52:17] thejamespinto: gambl0re: here's the information you are looking for, use that website, there not a single thing of Rails that's not described in it. http://guides.rubyonrails.org/form_helpers.html#nested-forms
[22:52:28] FailBit: (not a complicated one! just a simple one that generates a parse tree from some simple grammar)
[22:55:33] Radar: quintus: you should be using <%= @background_image %>. <% only evaluates code, it doesn't output the result to the template
[23:02:33] FailBit: http://www.computerworld.com/article/2490996/microsoft-windows/microsoft-slashes-ie-support--sets--huge--edict-for-jan--2016.html
[23:05:37] FailBit: http://www.computerworld.com/article/2988860/operating-systems/microsofts-browser-upgrade-decree-proves-disastrous-for-ie.html
[23:19:19] mehwork: how come 'gem uninstall rspec' didn't uninstall a lot of the stuff that 'gem isntall rspec' installed? Docs, Gems, etc?
[23:31:52] mehwork: i guess the point is to never manually run 'gem install' unless it's to install something that is outside the scope of your project. Thus a Gemfile is like package.json and not using bunlder is like npm install -g
[23:37:36] mehwork: the thing that still confuses me is that even if i use bundler, if i switch to another project and were to 'bundle uninstall', and that project's Gemfile had 'rspec' then it would install rspec for all my projects right
[23:38:45] mehwork: so i guess that means if each project needs a different version of rspec, then i'd not run the global rspec, i'd run bin/rspec (after binstubbing) it
[23:38:55] Radar: mehwork: Bundler doesn't install the dependencies for the project into the project itself.
[23:39:05] mehwork: ok hopefully i have enough of this stuff learned that i can get on to learning rails and not just bundler all days, jeesh
[23:39:05] Radar: It just picks and chooses the RIGHT dependencies for the project from the global batch of dependencies
[23:39:55] Radar: mehwork: Yeah, or Bundler.setup / Bundler.require in a file that's loaded in that Ruby process.
[23:40:17] mehwork: now i have to look ingo those Bundler. commands, the quick-sand continues to suck me in
[23:40:49] mehwork: it doesn't feel right to use any framework without understanding the package manager stuff first
[23:55:31] benlieb: I have a question about this code in the rails guides: before_create do self.name = login.capitalize if name.blank? end
[23:55:52] benlieb: why is the first name self.name and the second name.blank? have no self? Is there a benefit here?
[23:57:05] mehwork: since there is no 'bundle uninstall' command that still means that i have to manually 'gem uninstall' each individual dependency right?
[23:58:09] mehwork: there may come a time when i don't need that dependency any more, or at least older versions
[23:58:32] mehwork: i know i can just delete it from the Gemfile, but then it's still around on disk including any commandline binaries