#RubyOnRails - 08 August 2017
« Back 1 day Forward 1 day »
[00:56:45] i8igmac: i am working on a web interface for a router. im working on displaying live console output to multiple clients with out creating multiple instances of a console application
[00:59:10] i8igmac: for example, i can display wifi signal strength via `iwconfig` and with a a progress bar i can give it a nice live streaming look of a moving progress bar
[00:59:54] i8igmac: but if multiple people view the page, there will be multiple process's running of `iwconfig`...
[07:49:05] emers2n: Is it possible to get the development error pages on product (heroku app)? http://i.imgur.com/nVxJCz9.png
[09:06:16] dionysus69: hmm I have a potential problem. I have a list of cities for user to choose from, there are like 800 records and it takes 1000ms + to just render form. That is a problem isn't it? if couple people open up the form at the same time precious resources would be wasted or the whole app could just hang ?
[09:07:05] dionysus69: is there a way to cache the data? because select items are pretty much static
[09:48:12] tbuehlmann_: dionysus69: rails can cache things, see http://guides.rubyonrails.org/caching_with_rails.html
[10:04:24] fugee: when adminstrating users i can use the original scaffold controller? what about the whitelist in the controller? (i'm using devise_for :users, resources :users)
[10:04:59] fugee: i know i can whitelist from application_controller.rb but what about the whitelist in the scaffold controller?
[10:08:00] tbuehlmann_: fugee: either adapt the user_params method so the values depend on the role that is doing an update, or simply have an additional Admin::UsersController instead
[10:09:19] dionysus69: tbuehlmann_: I didn't know I had to turn caching on with this in dev, rails dev:cache. now the view render time is down from 1 second to 80ms :)
[10:12:48] fugee: tbuehlmann_: whitelisting is gonna be through application controller or users controller?
[10:13:07] fugee: if application controller then what do i do with the whitelist in the users controller
[10:13:43] fugee: then the whitelist in application controller is only for new registrations, not for edits?
[11:22:02] araddd: Hi, I'm new to paperclip gem, I was trying to upload a file and instead of the paperclip format in which it should come, the params gave just the file name
[11:22:57] araddd: This is the exact issue that I'm facing ---> https://stackoverflow.com/questions/10033425/paperclip-exception-paperclipadapterregistrynohandlererror
[18:47:10] benlieb: Given an AR record, is there way to determine if there is a resource route for it?
[18:47:44] benlieb: I have a helper that makes links but some AR objs don't have resource routes (undefined method `lesson_activation_path') I'd like to do something smart in this case instead of manage what AR objects go into the helper
[18:51:17] panzi: where do I put my own custom middleware so that it is available from config/application.rb?
[19:28:25] fryguy: you can CHOOSE to do that, explicitly, there is no automatic mapping of controllers to models, even for restful resources. Baking that assumption into your architecture is going to cause you problems
[19:30:54] benlieb: in the same way it would be trivial to write code that, given a model, checks for the existence of the route
[20:02:37] funburn: this is super weird. rails migration specified a string type for the col but mysql made it a TEXT/BLOB??? https://gist.github.com/mtuckerb/415747e5d8bdca3a3f7ace87ad95c5ac
[20:07:39] gthank: Is it possible to use protobuf-activerecord with .proto files instead of defining the messages as classes? I'm interested in protocol buffers specifically because of language interop
[20:08:01] gthank: And .proto files are way better for those purposes than redefining the same message in each language I want to use
[20:35:37] funburn: I specified a *string* type but got a BLOB upon rake db:migrate. HELP (please). https://gist.github.com/mtuckerb/415747e5d8bdca3a3f7ace87ad95c5ac
[22:01:58] daveomcd: is there a rails gem that would offer my users the ability to see Pronunciations of last names?
[23:28:41] ocpysh: I'm new to rails, and I just added bootstrap 4 to my gemfile and run 'bundle', all ok
[23:29:25] ocpysh: I changed assets/stylesheets/application.css to .scss and added @import 'bootstrap';
[23:29:48] ocpysh: Yarn executable was not detected in the system. Download Yarn at https://yarnpkg.com/en/docs/install
[23:31:54] mrbubbles: Rails 5.1 apps use Yarn as a package manager so you need to have it installed locally
[23:38:06] ocpysh: however, now I'm getting the following err: File to import not found or unreadable: bootstrap
[23:45:42] mrbubbles: Looks pretty good. TBH I got a bit braindead after HAML, it's just another thing to think about
[23:50:19] mrbubbles: ocpysh Is that something where you just get a Digital Ocean box, run some software and it provisions it and then you can deploy to it with a git push?
[23:51:26] mrbubbles: There are two that I know of. Dokku and Flynn. I've played with both: found Dokku to be a bit unreliable but Flynn is ace
[23:52:00] mrbubbles: I've been running it in production for about 6 months. If you've used Heroku it's basically a self-hosted clone of that. You do it all from the command line: deploy (git push), sync databases, etc
[23:57:12] mrbubbles: Yeah it can be. Otherwise you should consider Flynn, really. It's probably half an hour to setup but once you've done that you're away and it's super quick to deploy apps
[23:57:30] mrbubbles: You can do it on a $10 Digital Ocean box so it's pretty good, I've had 10+ apps running on there https://flynn.io/docs/installation/manual