#RubyOnRails - 21 June 2018
« Back 1 day Forward 1 day »
[04:01:44] haxx0r: https://thepasteb.in/p/2RhK443ZyO7s4 why is the .average() function returning 1/100ths of the real result? that's weired tho
[04:06:51] helpa: haxx0r: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) or Hastebin (https://hastebin.com) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[04:23:05] haxx0r: i need to pull power-consumption stats from our facility and need to log them for billing purposes. i just wanted to create AmpStats. i had the idea to use influx DB (and grafana). is it useful to save the stuff in mysql aswell and after the record is created push it over to influxdb or is it best practice so save it directly there?
[06:48:33] fabiob: Hi, If you have a nested resource (say authors nesting books), what's the best practice when creating a new book? POSTing to /author/:id/books or POSTing to /books and pass the author someway (I think that would require a new non-resourceful with a new bound parameter, like POST /books/:author/)?
[07:49:38] za1b1tsu: haxx0r: I've read about ActionDispatch::Request.new(ENV), but I can't get it to work
[07:58:39] za1b1tsu: haxx0r: I can override the devise mailer yes, but I can't change how it's called. That's what I need right? Put a param in the calling method
[12:03:16] mauro1254: Hi folks, are there alternatives to ActiveResource / Her supporting associations with activeRecord models?
[13:17:48] pavelz: why is tha when I move module to app/lib it starts to resolve and not throw NameError ?
[13:26:33] nzst: yea, that might work out for you, you can probably search more about it, though https://stackoverflow.com/questions/38198668/rails-5-load-lib-files-in-production
[16:21:25] cagomez: when using Dalli for Rails.cache, does `exist(key)` still make a network request?
[21:42:45] baweaver: That said I don't know nearly enough about Django to speak to its strengths and weaknesses.
[21:43:19] havenwood: merpnderp: Ruby is a more flexible language than Python, and Rails takes advantage of that in that it modifies the Ruby language to suit its purposes.
[21:43:52] havenwood: merpnderp: Rails is more widely used, and there's a vaster array of web app related libraries to lean on.
[21:44:36] havenwood: merpnderp: Django had solid WebSocket support first with Twistd. Rails now has ActionCable. Django has a built-in admin panel.
[21:47:58] merpnderp: This is interesting: https://trends.google.com/trends/explore?geo=US&q=%2Fm%2F0505cl,%2Fm%2F06y_qx
[21:49:41] havenwood: merpnderp: I don't think it works like that. It thinks Django Jane and Rails Steakhouse.
[21:52:36] merpnderp: Try it yourself. See the list of dropdowns asking you to clarify which ones you mean.
[21:53:18] havenwood: merpnderp: That doesn't mean it properly identifies "Rails" searches as Ruby on Rails. A quick sanity check of different terms seems to show it's all over the place.
[21:57:16] havenwood: merpnderp: It looks to me like Rail's current version has more downloads than Django for all time. That seems like too much. Mmm.
[21:58:52] havenwood: merpnderp: Rails and Django are both wildly popular. Don't worry about either's popularity.
[22:25:22] Radar: [07:38:36] <merpnderp> Why is rails better than django? <- because our underlying language doesn't introduce changes that break > 50% of the ecosystem... and not to mention that we get a new language release every Christmas.
[22:28:08] Radar: If you want something more explicit but with just as nice syntax then I would suggest looking at Elixir's Phoenix.
[22:28:34] Radar: Rails strives for optimising "developer happiness" at the cost of a little _too much_ magic.
[22:28:59] Radar: putting "resources :posts" in your routes file generates 8 routes that route towards 7 actions these days. Because this makes sense to most people.
[22:29:21] Radar: form_with(@post) <- this will generate a form that goes to the create action or the update action, depending on if @post represents an object persisted in the database or not.
[22:29:44] Radar: redirect_to @post <- this will redirect to /posts/1 due to more of that magic we talked about.