#RubyOnRails - 30 October 2018
« Back 1 day Forward 1 day »
[01:44:56] cmhobbs: hey folks! i'm working on moving an old rails 3.2 codebase to a different server for upgrades and i'm running into some asset pipeline problems
[01:45:34] cmhobbs: however, after i precompile the assets in production, i'm getting this error in my browser: Loading failed for the <script> with source “http://stage.myneatonewserver.com/assets/application/application.js”
[01:45:47] cmhobbs: that application.js exists in public/assets/application.js but not public/assets/application/application.js
[01:46:02] cmhobbs: making a symlink to the assets subdirectory doesn't seem to work (could be permissions)
[01:46:35] cmhobbs: the application works just peachy on heroku at the moment (migrating it off of heroku to work on upgrading it to rails 5)
[03:54:03] mhb: er, let me redact that, is it possible to click on a checkbox with ActionDispatch::IntegrationTest?
[08:06:20] dionysus69: I am trying to access constant defined in environment.rb inside the application but it gives constant undefined. any ideas how can I share constant in both of those locations?
[08:08:52] dionysus69: sevenseacat: https://gist.github.com/webzorg/0889b59acfe54a3eb2a77616efc5e8dc
[08:10:52] tbuehlmann: and `DOCKERIZED = File.exist?("/.dockerenv") ? true : false` could just be `DOCKERIZED = File.exist?("/.dockerenv")`
[08:11:24] dionysus69: anyways, I tried defining the constant before requiring application, still the same error
[08:11:43] dionysus69: I obviously need to define constant inside the application, which is where? source code? :S
[08:14:24] tbuehlmann: if not, you could simply put it in a config in application.rb: config.x[:dockerized?] = File.exist?('/.dockerenv'); Rails.configuration.x.dockerized? # => true/false
[08:15:57] dionysus69: thus now I just defined constant on top of application.rb file, now it is available both in environment.rb >> config.ru
[08:28:31] dionysus69: now I can do config.logger = ActiveSupport::Logger.new(STDOUT) if DOCKERIZED, even conditional url in database.yml, exciting :D
[10:27:09] hammer065: Hey, I am using FormHelper to create a form. This form has an attribute "modules" which is an array type. Now I want to generate checkboxes for all possible modules, but I dont know how to nest it properly
[10:56:17] dionysus69: hammer065: https://teamtreehouse.com/community/nested-params-rails-4 this is for nested strong parameters
[12:54:04] hightower3: Hey, how do I access configuration stored in Rails.application.configure...? Do I do it via Rails.configuration.key_name ?
[20:01:46] hightower3: I'd like to add a new method to RSpec's DSL so that it becomes available to the tests in "it" blocks. Any hints how to do that?