#RubyOnRails - 25 October 2018
« Back 1 day Forward 1 day »
[03:06:25] orbyt_: It was a private function is ApplicationController. I was able to get access to it in my test via `controller.send`, though it feels a bit hacky.
[03:33:21] skwurl: im getting a bunch of random these " #<Note:0x00007fdb4151a1e8> " on my view instead of the string im expecting. how can i convert this .to_s ?
[04:48:24] Robdgreat: 183 nicks by my counting. I have no idea what a Note is to advise how to handle it
[04:50:48] Robdgreat: people tend to idle on irc. Sometimes channels are active, other times they're dead. It's something of an asychronous medium sometimes
[04:52:37] helpa: skwurl: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[05:10:50] Robdgreat: https://stackoverflow.com/questions/12463254/iterating-through-an-activerecordrelation-array I think this is the pattern you want
[05:13:18] tbuehlmann: skwurl: I suggest you run `rails generate scaffold Project name:string` in your terminal, followed by `rails db:migrate` and then inspect app/controllers/projects_controller.rb and the corresponding views in app/views/projects
[05:14:00] Robdgreat: DarkainMX: tbuehlmann I haven't touched Rails in the better part of a decade. I'm glad I'm not the only one trying to give aid :)
[05:15:13] skwurl: right im familair as i want to be with genrate scaffold at the moment. trying to do it from scratch.
[06:30:56] Psy-Q: is it normal that i have to set Rails.application.routes.default_url_options by hand if i run in API mode? it seems the URL helpers can't construct URLs otherwise, i get "Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true"
[06:52:17] Psy-Q: which is inconvenient when you put the thing behind e.g. Passenger under multiple ServerAliases
[14:56:21] droctothorpe: Anyone here? I have a quick question that pertains to gems and the C compiler.
[15:07:30] jhass: just ask your question and stick around for a couple of hours, if anybody can answer they will ;)
[15:25:23] droctothorpe: Thanks! I received good helpful answers from the Rails Slack channel. Cheers!
[15:31:13] Andr3as: hello all.. i have a little issue with an "after_create".. i need to create associations (has_many through) when i create a certain element.. thats working great.. now i started to implement paper_trail to have an undo function
[15:31:51] Andr3as: i was able to get it working with associations too.. though that after_create is a bit wrong in that case as the associations will be recreated by paper_trail
[15:33:09] Andr3as: determining the "caller"? (e.g. which controller called for the (re)creation of that element?)
[16:07:59] TvL2386: hi all! I've been reading about getting metrics out of a rails application and been reading this post: https://www.robustperception.io/instrumenting-a-ruby-on-rails-application-with-prometheus
[16:32:02] CGibsonmm: I have a question about building a forum, i have a subjects model, a thread model, and a posts model. I want to keep my subjects and thread separate from each other/ resources nested, but I want to only create a new thread after routing through a certain subject, the thread model belongs_to a subject and a subject has many threads, but i do not want their resources nested, how can i link through subjects-> to thr
[17:15:10] Skull0Inc: Just sharing another resource: https://thoughtbot.com/upcase/practice they recently release all content for free learning instead of subscription based.
[18:40:37] comjf: Howdy! I have an issue with initializers trying to read secrets that I define in my environmets/production.rb -- is there any way for me to tell rails to first load that file bfore anything in the initializers folder?
[18:41:41] comjf: Specifically ```config.secret_key = Rails.application.config.secret_key_base``` yet it fails because application.config isn't loaded yet (apparently)
[18:43:07] nate-^: is there a way with will_paginate to get the page number of an item from the list?
[19:47:37] orbyt_: If I do gem list my_gem in my rails app directory, I see 2 versions listed under "Local gems". If I then run `bundle show`, only 1 version is displayed for the gem in question
[19:55:50] TvL2386: orbyt_: running `gem list my_gem` will just print what gems are installed on your local machine. Has nothing to do with the fact that you are running that in your rails app dir
[19:56:10] TvL2386: orbyt_: `bundle show my_gem` will print the version of that gem that is used in your rails app
[20:01:34] samort7: Can anyone tell me why my schema doesn't contain the values from my migrations, even after doing rails db:reset?
[20:01:44] samort7: migration: https://github.com/tliss/battlefield-one/blob/kit-models/db/migrate/20181025180009_create_kit_lists.rb