« Back to channel list

#RubyOnRails - 01 June 2016

« Back 1 day Forward 1 day »
[00:00:12] bratsche: has joined #RubyOnRails
[00:01:12] mikecmpbll: goodnight \o.
[00:03:01] xlegoman: has joined #RubyOnRails
[00:03:21] Cohedrin: has joined #RubyOnRails
[00:04:01] arBmind: has joined #RubyOnRails
[00:04:26] lightt: has joined #RubyOnRails
[00:04:32] codergeek: has joined #RubyOnRails
[00:08:47] manfrin: has joined #RubyOnRails
[00:12:11] manfrin: has joined #RubyOnRails
[00:12:45] hightower3: has joined #RubyOnRails
[00:12:45] datanoise: has joined #RubyOnRails
[00:15:45] blackmesa: has joined #RubyOnRails
[00:16:09] smathy: has joined #RubyOnRails
[00:16:52] ksoze: has joined #RubyOnRails
[00:17:48] hcnewsom: has joined #RubyOnRails
[00:20:01] triangles: has joined #RubyOnRails
[00:20:17] Rodya_: has joined #RubyOnRails
[00:24:25] idefine: has joined #RubyOnRails
[00:25:44] refinerysource: has joined #RubyOnRails
[00:26:30] infinitone: has joined #RubyOnRails
[00:28:38] DoctorMonocular: has joined #RubyOnRails
[00:30:31] sid_fules: has joined #RubyOnRails
[00:43:11] Alazoral: has joined #RubyOnRails
[00:44:39] idefine: has joined #RubyOnRails
[00:47:49] helpa: has joined #RubyOnRails
[00:48:10] sypheren: has joined #RubyOnRails
[00:54:40] manfrin: has joined #RubyOnRails
[00:55:22] idefine: has joined #RubyOnRails
[00:58:38] aegis3121: has joined #RubyOnRails
[00:59:52] superlou: has joined #RubyOnRails
[01:01:19] jstransky: has joined #RubyOnRails
[01:02:31] infinitone: has joined #RubyOnRails
[01:02:48] mattp_: has joined #RubyOnRails
[01:03:49] lightt: has joined #RubyOnRails
[01:04:52] moei: has joined #RubyOnRails
[01:04:56] zeroone55: has joined #RubyOnRails
[01:07:45] quazimodo: has joined #RubyOnRails
[01:09:27] sypheren: has joined #RubyOnRails
[01:10:24] hcnewsom: has joined #RubyOnRails
[01:10:55] ksoze: has joined #RubyOnRails
[01:12:43] quazimod1: has joined #RubyOnRails
[01:12:55] jstransky: has joined #RubyOnRails
[01:14:30] jancel: has joined #RubyOnRails
[01:17:40] jstransky: has joined #RubyOnRails
[01:18:13] blackmesa: has joined #RubyOnRails
[01:21:03] jancel_: has joined #RubyOnRails
[01:22:16] zeroone55: Good evening folks. Could u guys help me with some app design questions? I'm trying do make a application that provides an UI to the end-user so they can create their on models from a form. They will specify the attributes with type and validation for each attribute and send to the server. In the server, it should create the tables and models to satisfy those attributes.
[01:22:20] douglasc_: has joined #RubyOnRails
[01:22:27] zeroone55: The questions are : 1. I was thinking on using rails generators to create them, but how can call them programmatically? 2. Is there any major security problem on doing that?
[01:23:40] jstransky: has joined #RubyOnRails
[01:24:36] one_zero: has joined #RubyOnRails
[01:25:44] refinerysource: has joined #RubyOnRails
[01:29:34] moeabdol: has joined #RubyOnRails
[01:30:17] rickmasta: has joined #RubyOnRails
[01:31:43] w09x: has joined #RubyOnRails
[01:32:49] cnk: zeroone55: I predict problems when the user wants to edit their models - though if you don't allow customizing the forms, then perhaps it's OK to just rereun the generator
[01:33:23] cnk: This isn't really the sort of thing Rails is best at so... I might push back or reconsider your choice of problem space + tech stack
[01:33:35] cnk: if you want drupal, use drupal
[01:34:52] sevenseacat: has joined #RubyOnRails
[01:35:11] Rodya_: has joined #RubyOnRails
[01:37:18] Rodya_: has joined #RubyOnRails
[01:38:24] Inside: has joined #RubyOnRails
[01:44:16] sevenseacat: I either timed something very well or rather poorly.
[01:45:00] triangles2: has joined #RubyOnRails
[01:46:10] arBmind: has joined #RubyOnRails
[01:48:14] Guest26047: has joined #RubyOnRails
[01:48:25] rafaelfr_: has joined #RubyOnRails
[01:52:32] DoctorMonocular: has joined #RubyOnRails
[01:52:45] jstransky: has joined #RubyOnRails
[01:53:44] tacooooo: has joined #RubyOnRails
[01:55:19] tacooooo: I'm having an issue with creating records in Rake tasks on my Rails app. I'm creating a new record, but no dates are being saved in the database.
[01:55:23] ensyde__: has joined #RubyOnRails
[01:56:16] triptec: has joined #RubyOnRails
[01:56:41] flashpoint9: has joined #RubyOnRails
[01:57:35] tacooooo: https://gist.github.com/thattacoguy/6ff2235577e42e452c89bd4aa23fd2f2
[01:58:00] jancel: has joined #RubyOnRails
[01:58:14] tacooooo: This is the task I'm trying to run - the record is created just fine, but there's no "created_at" being recorded in the database.
[01:58:35] tacooooo: when I try to record "date" as well, it won't budge.
[01:58:48] tacooooo: they're both "DateTime" type columns
[01:58:55] sevenseacat: the record is created but the fields are nil? are you sure its saved?
[01:59:09] sevenseacat: I don;t think it is
[01:59:23] tacooooo: I'm pretty sure, sevenseacat, I'm seeing it in the rails console
[01:59:37] sevenseacat: does it have an ID value?
[01:59:48] SteenJobs: hey people - one of the founders/creative director wanted to be able to customize and have control of our home/landing page, so he created it in whatever software he uses, which generates html/css/js files from his designs and asked me to add it. i added it to public/ along with the necessary assets and all works greaaaat
[02:00:36] tacooooo: I've honestly looked everywhere and I haven't encountered any help on the googles or the stackoverflows
[02:00:54] SteenJobs: problem is, now he wants to add some more static pages using this same method (about, faq, etc.)…but all of the src values for assets are referenced assuming the html file is in the same directory as the css and js folders. that was fine when adding the home page as public/index.html, but what’s the best approach for the other pages without having to change all of the src values?
[02:01:49] jstransky: has joined #RubyOnRails
[02:01:49] tacooooo: SteenJobs: make him learn HAML and Sass? :L
[02:01:57] SteenJobs: tacooooo: if sevenseacat gives the ok, maybe change the create method to create! and see if it throws any errors?
[02:02:09] SteenJobs: tacooooo: yea…i’d like to keep my job, at least for the near future :D
[02:02:15] tacooooo: I'll try that now, SteenJobs
[02:02:16] SteenJobs: he doesn’t know html or css
[02:02:24] SteenJobs: so there’s a long way to go if i take that route
[02:03:52] arBmind: has joined #RubyOnRails
[02:04:01] tacooooo: also SteenJobs if you use Sublime you can just use SidebarEnhancements to search through all files and change things with regex
[02:04:11] tacooooo: although regex can't parse html... well.
[02:04:50] SteenJobs: tacooooo: yea, honestly i’d rather avoid touching the files he’s sending me, so easy to become a rabbit hole
[02:05:12] ksoze: has joined #RubyOnRails
[02:05:16] tacooooo: SteenJobs: no errors, but still no dates
[02:05:36] SteenJobs: i’d much rather find a way to serve the needed css/js assets without using the asset pipeline. honestly best move might be to add those files to the public directory as well, and just create routes to those static assets
[02:05:45] tacooooo: SteenJobs: https://gist.github.com/thattacoguy/c9f27016b48f69c4721a5f5e1362b187 checkit
[02:06:31] triangles: has joined #RubyOnRails
[02:08:18] SteenJobs: tacooooo: i’m missing some stuff obviously bec the only attributes in the create method are provider_id and provider…where are the other attributes coming from?
[02:09:10] tacooooo: SteenJobs: Content(id: integer, name: string, description: text, status: string, date: datetime, type: string, provider: string, provider_id: string, slide: string, duration: integer, url: string, created_at: datetime, updated_at: datetime, unit_id: integer, links: json, bin: string)
[02:09:55] tacooooo: I'm using Postgres, if that helps
[02:10:02] DoctorMonocular: has joined #RubyOnRails
[02:10:44] SteenJobs: tacooooo: can you gist any relevant logs
[02:11:58] triptec: has joined #RubyOnRails
[02:13:50] tacooooo: SteenJobs: https://gist.github.com/thattacoguy/bd64967000f1732197804ef36a74375a
[02:15:54] SteenJobs: hmm, and you checked in rails console and the object’s created_at is nil?
[02:16:10] tacooooo: SteenJobs yup
[02:16:27] tacooooo: it's what really confuses me
[02:16:45] SteenJobs: can you gist your model
[02:18:46] tacooooo: SteenJobs https://gist.github.com/thattacoguy/0c8157def0c3a507c07928f083a718e3
[02:19:13] blackmesa: has joined #RubyOnRails
[02:19:15] SteenJobs: also your application.rb just in case
[02:19:47] SteenJobs: model seems pretty straightforward
[02:20:14] tacooooo: SteenJobs https://gist.github.com/thattacoguy/c9b9819cf71e5f615c468426dd80ea08
[02:21:20] SteenJobs: my hunch is that’s your problem
[02:22:10] SteenJobs: pretty sure config.active_record.default_timezone takes a symbol
[02:22:30] SteenJobs: change it to :utc just to test
[02:22:30] tacooooo: riiiiiiight
[02:23:45] JoshGlzBrk: has joined #RubyOnRails
[02:24:08] tacooooo: SteenJobs I owe you a thousand beers. That worked!
[02:24:18] SteenJobs: sweet - set it to :local if you’d like
[02:24:26] tacooooo: awesome, will do
[02:24:28] SteenJobs: and i would take you up on a thousand beers any day
[02:25:28] yfeldblum: has joined #RubyOnRails
[02:26:27] refinerysource: has joined #RubyOnRails
[02:27:14] douglascorrea: has joined #RubyOnRails
[02:28:44] emachnic: has joined #RubyOnRails
[02:30:13] dandaman: has joined #RubyOnRails
[02:31:27] sneakerhax: has joined #RubyOnRails
[02:33:02] jancel: has joined #RubyOnRails
[02:35:17] yfeldblum: has joined #RubyOnRails
[02:38:58] kt2: has joined #RubyOnRails
[02:39:17] chooky: has joined #RubyOnRails
[02:39:32] flashpoint9: has joined #RubyOnRails
[02:39:33] manfrin: has joined #RubyOnRails
[02:48:38] braincra-: has joined #RubyOnRails
[02:49:11] Guest26047: has joined #RubyOnRails
[02:49:47] Vlat-: has joined #RubyOnRails
[02:57:00] justrohu: has joined #RubyOnRails
[02:57:46] jancel: has joined #RubyOnRails
[02:58:30] douglasc_: has joined #RubyOnRails
[02:58:48] Spami_: has joined #RubyOnRails
[02:59:20] ksoze: has joined #RubyOnRails
[03:01:53] paradisaeidae_: has joined #RubyOnRails
[03:02:06] douglascorrea: has joined #RubyOnRails
[03:03:24] Ropeney: has joined #RubyOnRails
[03:05:22] douglascorrea: has joined #RubyOnRails
[03:05:40] Guest_: has joined #RubyOnRails
[03:07:26] k1t: has joined #RubyOnRails
[03:13:48] braincrash: has joined #RubyOnRails
[03:16:58] diegoaguilar: has joined #RubyOnRails
[03:18:09] lxsameer: has joined #RubyOnRails
[03:19:09] macsteps: has joined #RubyOnRails
[03:20:20] blackmesa: has joined #RubyOnRails
[03:20:56] k3rn31: has joined #RubyOnRails
[03:21:22] Ropeney: has joined #RubyOnRails
[03:23:22] Devalo: has joined #RubyOnRails
[03:27:38] refinerysource: has joined #RubyOnRails
[03:28:48] wd40s: has joined #RubyOnRails
[03:30:47] chouhoulis: has joined #RubyOnRails
[03:35:11] hahuang61: has joined #RubyOnRails
[03:35:46] diegoviola: has joined #RubyOnRails
[03:36:44] chouhoulis: has joined #RubyOnRails
[03:37:39] HenriettaSalt: has joined #RubyOnRails
[03:48:49] datanoise: has joined #RubyOnRails
[03:49:59] diegoaguilar: has joined #RubyOnRails
[03:50:23] RegulationD: has joined #RubyOnRails
[03:52:09] idefine: has joined #RubyOnRails
[03:53:17] Guest26047: has joined #RubyOnRails
[03:53:28] ksoze: has joined #RubyOnRails
[03:54:30] timdotrb: has joined #RubyOnRails
[03:56:54] armyriad: has joined #RubyOnRails
[03:59:21] ziggy: has joined #RubyOnRails
[04:04:15] lxsameer: has joined #RubyOnRails
[04:04:22] arBmind: has joined #RubyOnRails
[04:06:36] rogue_koder: has joined #RubyOnRails
[04:11:43] Coldblackice: has joined #RubyOnRails
[04:13:59] armyriad: has joined #RubyOnRails
[04:14:20] kgrz: has joined #RubyOnRails
[04:17:08] njero: has joined #RubyOnRails
[04:17:13] emachnic: has joined #RubyOnRails
[04:21:04] smoitra: has joined #RubyOnRails
[04:21:06] blackmesa: has joined #RubyOnRails
[04:23:30] triptec: has joined #RubyOnRails
[04:27:50] workmaster2n: has joined #RubyOnRails
[04:28:30] refinerysource: has joined #RubyOnRails
[04:31:46] tildes_: has joined #RubyOnRails
[04:38:35] idefine: has joined #RubyOnRails
[04:39:08] triptec: has joined #RubyOnRails
[04:43:44] infinitone: has joined #RubyOnRails
[04:49:35] jancel: has joined #RubyOnRails
[04:50:25] xardion_: has joined #RubyOnRails
[04:51:52] Guest_: has joined #RubyOnRails
[04:53:19] Guest_: has joined #RubyOnRails
[04:54:39] Guest26047: has joined #RubyOnRails
[04:55:33] moei: has joined #RubyOnRails
[04:56:19] xMopxShell: has joined #RubyOnRails
[04:58:51] workmaster2n: has joined #RubyOnRails
[05:02:30] dionysus69: has joined #RubyOnRails
[05:05:54] yfeldblum: has joined #RubyOnRails
[05:07:06] yfeldblum: has joined #RubyOnRails
[05:12:11] emachnic: has joined #RubyOnRails
[05:13:10] emilkarl: has joined #RubyOnRails
[05:14:44] idefine: has joined #RubyOnRails
[05:15:11] dionysus69: has joined #RubyOnRails
[05:21:04] Devalo: has joined #RubyOnRails
[05:21:24] sid_fules: has joined #RubyOnRails
[05:21:56] blackmesa: has joined #RubyOnRails
[05:29:10] Cohedrin: has joined #RubyOnRails
[05:33:36] njero: has joined #RubyOnRails
[05:33:43] moeabdol: has joined #RubyOnRails
[05:37:04] moeabdol: has joined #RubyOnRails
[05:38:37] guardianJ: has joined #RubyOnRails
[05:39:37] darkmug: has joined #RubyOnRails
[05:40:28] pawnbox: has joined #RubyOnRails
[05:51:05] jancel: has joined #RubyOnRails
[05:51:15] smoitra: has joined #RubyOnRails
[05:55:26] Guest26047: has joined #RubyOnRails
[05:56:51] moeabdol1: has joined #RubyOnRails
[05:59:24] Macaveli: has joined #RubyOnRails
[06:04:57] arBmind: has joined #RubyOnRails
[06:05:14] njero: has joined #RubyOnRails
[06:05:26] Cohedrin: has joined #RubyOnRails
[06:06:10] emachnic: has joined #RubyOnRails
[06:06:12] ensyde__: has joined #RubyOnRails
[06:07:48] ensyde: has joined #RubyOnRails
[06:11:20] Guest26047: has joined #RubyOnRails
[06:16:48] rvanlieshout: has joined #RubyOnRails
[06:17:33] Guest_: has joined #RubyOnRails
[06:19:16] norc: has joined #RubyOnRails
[06:22:10] eGGshke: has joined #RubyOnRails
[06:22:43] blackmesa: has joined #RubyOnRails
[06:23:00] kgrz: has joined #RubyOnRails
[06:25:18] aganov: has joined #RubyOnRails
[06:26:49] yfeldblum: has joined #RubyOnRails
[06:28:37] yfeldblum: has joined #RubyOnRails
[06:31:22] wd40s: has joined #RubyOnRails
[06:34:57] Vlat-: has joined #RubyOnRails
[06:36:04] Seich: has joined #RubyOnRails
[06:36:36] Pazician: has joined #RubyOnRails
[06:36:37] Pazician: has joined #RubyOnRails
[06:39:18] datanoise: has joined #RubyOnRails
[06:42:44] smoitra: has joined #RubyOnRails
[06:46:24] DoubleMalt: has joined #RubyOnRails
[06:49:54] d0nn1e: has joined #RubyOnRails
[06:49:59] solars: has joined #RubyOnRails
[06:50:36] triptec: has joined #RubyOnRails
[06:53:13] Guest26047: has joined #RubyOnRails
[06:54:06] lightt: has joined #RubyOnRails
[06:55:25] JohnDotHR: has joined #RubyOnRails
[06:56:18] JohnDotHR: Hey guys. Can someone help me out? I've uploaded my Rails up to a host and everything works fine except the fact that it isn't detecting the application.js/css .. The Chrome console give me an error for GET /javascripts/application.js and /stylesheets/application.css
[06:58:23] rvanlieshout: JohnDotHR: you shouldn't link to /javascripts/applicaion.js
[06:58:50] rvanlieshout: use stylesheet_link_tag and javascript_include_tag
[06:59:00] rvanlieshout: because? because those assets are compiled
[07:00:30] wd40s: has joined #RubyOnRails
[07:00:42] JohnDotHR: In which file do I adjust the tags?
[07:00:47] JohnDotHR: @rvanlieshout
[07:01:25] sevenseacat: did you precompile your assets after deployment?
[07:03:14] rbr: has joined #RubyOnRails
[07:03:35] JohnDotHR: and I added this <%= stylesheet_link_tag "application" %> <%= javascript_include_tag "application" %> to /views/layouts/application.html
[07:03:45] sevenseacat: so you have an application-<something>.js and an application-<something>.css in your public/assets folder?
[07:03:59] ur5us: has joined #RubyOnRails
[07:04:17] sevenseacat: (on the server)
[07:04:20] JohnDotHR: I've got bootstrap in my public/assets folder
[07:04:30] JohnDotHR: and the app.css and app.js in my assets folder
[07:04:56] sevenseacat: er, is that a yes or a no?
[07:05:29] JohnDotHR: I do have that
[07:05:33] JohnDotHR: In my public/assets
[07:06:12] sevenseacat: restarted your app server after compilation?
[07:06:16] triptec: has joined #RubyOnRails
[07:06:36] JohnDotHR: How do I restart the rails server inside the console? I'm accessing it via SSH
[07:06:52] sevenseacat: depends what you're using to serve it
[07:06:58] sevenseacat: passenger? unicorn?
[07:07:31] JohnDotHR: No idea. The host has set up the enviroemnt without telling me anything.
[07:08:14] sevenseacat: um... possibly check the help docs from your host then? :)
[07:09:03] JohnDotHR: doubt that i have those. just give me the command for puma unicorn whatever, i'll try them all.
[07:09:45] sevenseacat: I don't think I will.
[07:10:01] norc: Oh wow! Rails 5 comes with Puma out of the box. No more Webrick - hooray!
[07:11:07] JohnDotHR: sevensea, i went through all the files on the server
[07:11:13] JohnDotHR: couldn't see anything rails-server related
[07:11:17] JohnDotHR: not puma, not unicorn, nothing
[07:11:19] universa1: JohnDotHR: look at the output of ps ux
[07:11:58] JohnDotHR: passenger-config restart-app
[07:12:37] lalalaaa: has joined #RubyOnRails
[07:12:52] lalalaaa: Hi! How come `bundle exec sidekiq -d` works, but not within a zsh function `my_command() { bundle exec sidekiq -d }`, ie. by running `my_command`?
[07:13:04] sevenseacat: lalalaaa: !dw
[07:13:04] helpa: lalalaaa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[07:13:23] DriesS: has joined #RubyOnRails
[07:14:04] comrad: has joined #RubyOnRails
[07:14:55] datanoise: has joined #RubyOnRails
[07:15:10] Devalo: has joined #RubyOnRails
[07:16:09] JohnDotHR: @sevenseacat So I've done everything you said. Now the app site is blank
[07:16:33] sevenseacat: sorry, what? what did you do?
[07:16:42] JohnDotHR: precompiled
[07:16:44] JohnDotHR: restarted the app
[07:16:49] darutoko: has joined #RubyOnRails
[07:16:54] JohnDotHR: and now its blank
[07:16:58] sevenseacat: what commands did you run?
[07:17:29] JohnDotHR: rake assets:precompile and touch tmp/restart.txt
[07:17:42] Spami_: has joined #RubyOnRails
[07:18:58] sevenseacat: and then visiting the URL just gives you a blank screen?
[07:19:36] sevenseacat: not a passenger error screen?
[07:20:06] JohnDotHR: it isn't detecting the index.hmtl
[07:20:24] sevenseacat: you have an index.html file?
[07:21:19] JohnDotHR: index.html.erb ?
[07:21:21] douglascorrea: has joined #RubyOnRails
[07:21:44] sevenseacat: ok thats totally different
[07:22:07] JohnDotHR: yeah well it isn't displaying the content it used to display
[07:22:07] sevenseacat: do your passenger access or error logs show anything?
[07:22:30] sid_fules: has joined #RubyOnRails
[07:23:03] JohnDotHR: ActionController::RoutingError (No route matches [GET] "/index.html"):
[07:23:23] sevenseacat: that makes sense
[07:23:25] blackmesa: has joined #RubyOnRails
[07:23:41] sevenseacat: now you can try visiting the actual pages in your app
[07:24:44] JohnDotHR: How? I don't understand.
[07:24:54] sevenseacat: what URLs did you configure in your app?
[07:24:58] sevenseacat: try one of them
[07:26:53] mark_66: has joined #RubyOnRails
[07:26:57] Guest26047: has joined #RubyOnRails
[07:27:07] JohnDotHR: Tried accessing one
[07:27:14] sevenseacat: and the logs say?
[07:28:00] JohnDotHR: ActionController::RoutingError (No route matches [GET] "/job"):
[07:28:24] sevenseacat: that doesnt sound like a likely URL. does your 'rake routes' list that URL?
[07:29:05] emilkarl: has joined #RubyOnRails
[07:29:29] JohnDotHR: job_index GET /job/index(.:format) job#index
[07:29:37] sevenseacat: right, thats not the same URL
[07:30:04] sevenseacat: /job != /job/index
[07:30:14] sevenseacat: it also sounds like your routes are misconfigured, but thats a different story
[07:30:18] universa1: --> /blub != /blub/muh
[07:30:18] JohnDotHR: how do i fix this
[07:30:24] sevenseacat: access the correct URL
[07:30:42] chipotle: has joined #RubyOnRails
[07:31:17] JohnDotHR: no idea how to do that
[07:31:58] sevenseacat: you don't know how to visit a URL in your browser?
[07:32:00] JohnDotHR: sorry, i'm rather new to ror
[07:32:08] ur5us: has joined #RubyOnRails
[07:32:15] JohnDotHR: I've visited /jobs/index
[07:32:20] JohnDotHR: * /job/index
[07:32:22] sevenseacat: thats again not the right URL
[07:32:24] JohnDotHR: but still blank
[07:32:28] sevenseacat: and the logs saaaay?
[07:33:08] JohnDotHR: ActionController::RoutingError (No route matches [GET] "/jobs/index.html.erb"):
[07:33:16] sevenseacat: thats a different URL again
[07:33:22] sevenseacat: please just access the right URL
[07:33:28] defsdoor: has joined #RubyOnRails
[07:33:30] sevenseacat: this is not rocket science
[07:33:33] JohnDotHR: nah i've accessed the right one
[07:33:43] JohnDotHR: it is actually jobs
[07:33:49] JohnDotHR: but for some reason i kept correcting myself to job
[07:33:50] sevenseacat: not according to the routes you posted
[07:33:53] ur5us: has joined #RubyOnRails
[07:34:02] JohnDotHR: /jobs/index
[07:34:11] JohnDotHR: jobs_index GET /jobs/index(.:format) jobs#index
[07:34:11] mozzarel1: has joined #RubyOnRails
[07:34:22] sevenseacat: then your routes are really misconfigured, but anyway
[07:34:24] sevenseacat: does that URL work?
[07:34:33] JohnDotHR: and the logs say
[07:34:42] JohnDotHR: ActionController::RoutingError (No route matches [GET] "/jobs/index.html.erb"):
[07:34:49] sevenseacat: no, they do not.
[07:35:29] JohnDotHR: they mount up the app
[07:35:34] JohnDotHR: i see the stuff i've done in the logs
[07:35:37] JohnDotHR: but nothing appears on the web
[07:35:54] JohnDotHR: I, [2016-06-01T09:28:23.657838 #53429] INFO -- : Started GET "/" for at 2016-06-01 09:28:23 +0200 I, [2016-06-01T09:28:23.659194 #53429] INFO -- : Processing by JobsController#index as HTML D, [2016-06-01T09:28:23.661824 #53429] DEBUG -- : #[1m#[36mJob Load (0.3ms)#[0m #[1mSELECT `jobs`.* FROM `jobs` ORDER BY created_at DESC LIMIT 3 OFFSET 0#[0m D, [2016-06-01T09:28:23.663451 #53429] DEBUG -- : #[1m#[35m (
[07:35:54] sevenseacat: please just tell me what the logs say when you visit /jobs/index .
[07:36:13] JohnDotHR: https://gist.github.com/ivancernja/92e08ea7184e878900ab5f64e2b1f44f
[07:36:33] sevenseacat: looks absolutely fine.
[07:36:45] JohnDotHR: still /jobs/index is blank
[07:37:30] sevenseacat: so whats in that jobs/index.html.erb file?
[07:37:37] edwinvdgraaf: has joined #RubyOnRails
[07:38:18] JohnDotHR: https://gist.github.com/ivancernja/92e08ea7184e878900ab5f64e2b1f44f
[07:38:44] sevenseacat: is this app public on github or equivalent, by any chance?
[07:41:48] JohnDotHR: https://github.com/ivancernja/Tezak
[07:42:56] JohnDotHR: updated it now
[07:43:59] artto: has joined #RubyOnRails
[07:44:36] lightt: has joined #RubyOnRails
[07:45:23] sevenseacat: JohnDotHR: you removed the yield statement from your application layout
[07:45:47] sevenseacat: therrefore, no content gets rendered
[07:46:15] sevenseacat: https://github.com/ivancernja/Tezak/blob/master/app/views/layouts/application.html.erb all the Rails content in this file is gone
[07:46:46] JohnDotHR: so i need to add <%= yield %> to the index file?
[07:47:16] sevenseacat: no, to your layout file, then put your stylesheets and javascript and meta tags and etc. back in
[07:50:30] Dimik: has joined #RubyOnRails
[07:50:34] JohnDotHR: i've added it
[07:51:19] JohnDotHR: so got this atm
[07:51:20] JohnDotHR: what do i edit
[07:51:21] JohnDotHR: https://gist.github.com/ivancernja/92e08ea7184e878900ab5f64e2b1f44f
[07:51:57] JohnDotHR: it obviously isnt loading my css
[07:51:58] y2mq37: has joined #RubyOnRails
[07:52:01] sevenseacat: go back to this file. https://github.com/ivancernja/Tezak/blob/8e957149435bb5f11f10a4934c51a0dd811561d7/app/views/layouts/application.html.erb
[07:52:01] JohnDotHR: nor the bootstrap one
[07:52:01] chipotle: has joined #RubyOnRails
[07:52:59] jenrzzz: has joined #RubyOnRails
[07:53:59] raunicolae: has joined #RubyOnRails
[07:54:06] raunicolae: has left #RubyOnRails: ()
[07:54:21] emachnic: has joined #RubyOnRails
[07:54:49] RegulationD: has joined #RubyOnRails
[07:55:38] JohnDotHR: I've done this
[07:56:41] JohnDotHR: copied it from github into the file on the server
[07:57:31] sevenseacat: I'd recommend committing the changed file to your repo, then deploying your code to your server
[07:59:41] marr: has joined #RubyOnRails
[08:00:39] JohnDotHR: i've deployed the code from the link you've sent me
[08:00:43] JohnDotHR: but it still isn't woooorking
[08:00:54] JohnDotHR: it is still generating it's own html
[08:01:12] sevenseacat: what do you mean, 'generating its own html'?
[08:01:21] JohnDotHR: not yielding my changes
[08:01:38] JohnDotHR: not using my index.html.erb
[08:01:41] sevenseacat: did you restart your app server after deploying code changes?
[08:02:30] JohnDotHR: Thanks a bunch. Like, really. I was about to give up on RoR and backend and head back to frontend
[08:02:37] JohnDotHR: i'll buy you a beer if we ever meet
[08:02:49] sevenseacat: you're welcome.
[08:03:50] JohnDotHR: just one last question, sorry. with which command do i flush entries? I've got this thing where you fill out a form and your entry gets posted onto the index. How do I flush those models?
[08:04:00] sloggerkhan: has joined #RubyOnRails
[08:04:19] universa1: you mean delete?
[08:04:38] universa1: well, call delete / destroy on them ;)
[08:04:48] JohnDotHR: but that usually messes up the db
[08:04:49] universa1: JohnDotHR: !getting_started
[08:04:49] helpa: JohnDotHR: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy
[08:05:06] JohnDotHR: so i have to migrate everything again
[08:05:09] JohnDotHR: and edit the model files
[08:05:20] adre: has joined #RubyOnRails
[08:05:58] universa1: JohnDotHR: work through the guide, it shows you the full-lifecycle of an object managed through the webpage. create, read, update and destroy.
[08:06:26] ziggy: has joined #RubyOnRails
[08:06:57] darkxploit: has joined #RubyOnRails
[08:07:10] GorillaApe: has joined #RubyOnRails
[08:08:11] GorillaApe: should I put 301 redirects at nginx
[08:08:14] GorillaApe: or rails routes/
[08:09:00] universa1: if you put it in nginx, you don't hit your rails app at all, so no need to process the request by rails, sounds like a plus to me.
[08:09:03] Radar: GorillaApe: I would say nginx, although it depends on what they do.
[08:09:04] universa1: depends on your situation.
[08:09:48] GorillaApe: I want to migrate old woocommerce routes to my new rails thing
[08:11:35] Radar: If it's possible to do it in nginx, then do it there. If it's not, then do it in Rails routes.
[08:11:37] Radar: !consultant
[08:11:37] helpa: Your question, problem, and/or attitude requires more than free internet advice from an irc channel. May I suggest hiring a consultant or life coach?
[08:14:54] artto: has joined #RubyOnRails
[08:14:58] czerasz: has joined #RubyOnRails
[08:17:26] AzaToth: has joined #RubyOnRails
[08:21:54] artto: has joined #RubyOnRails
[08:22:22] brendan-: has joined #RubyOnRails
[08:22:22] gingray: has joined #RubyOnRails
[08:24:12] blackmesa: has joined #RubyOnRails
[08:26:26] idefine: has joined #RubyOnRails
[08:26:34] Vlat-: has joined #RubyOnRails
[08:30:37] helpa: has joined #RubyOnRails
[08:31:10] artto: has joined #RubyOnRails
[08:31:14] scepticulous: has joined #RubyOnRails
[08:32:05] artto: has joined #RubyOnRails
[08:34:54] haaj: has joined #RubyOnRails
[08:36:34] moeabdol2: has joined #RubyOnRails
[08:39:07] lxsameer: has joined #RubyOnRails
[08:39:23] jsrn: has joined #RubyOnRails
[08:39:39] weckl: has joined #RubyOnRails
[08:39:39] srinidhi: has joined #RubyOnRails
[08:39:54] ur5us: has joined #RubyOnRails
[08:48:43] wd40s: has joined #RubyOnRails
[08:49:11] emachnic: has joined #RubyOnRails
[08:51:42] triptec: has joined #RubyOnRails
[08:55:22] lalalaaa: has joined #RubyOnRails
[08:55:41] Circuit8: has joined #RubyOnRails
[08:57:32] kgrz: has joined #RubyOnRails
[08:58:44] DriesS: has joined #RubyOnRails
[08:58:49] scepticulous: has joined #RubyOnRails
[08:59:06] Takumo: Hi all, I used to have a view in my app which responded to both PDF and HTML formats
[08:59:31] Takumo: the PDF format has been removed, how can I make a request for PDF format return HTML (or redirect)?
[09:00:06] GorillaApe: has joined #RubyOnRails
[09:00:40] GorillaApe: how can I search with multiple filters
[09:01:11] GorillaApe: when having a structure properties , product_properties ?
[09:01:27] dkam: has joined #RubyOnRails
[09:01:30] GorillaApe: since fields arent collumns
[09:02:04] GragHarker: has joined #RubyOnRails
[09:02:30] universa1: so you know how to search with ONE filter?
[09:04:25] universa1: okay, can you show that?
[09:04:43] GorillaApe: problem is that you cant do where (property_id = 3 and value = "blah" and property_id=3 and value="44")
[09:05:17] universa1: well since a value can only take one value, your combination is not fulfillable.
[09:05:18] GorillaApe: I can do or but it isnt what I need
[09:05:26] universa1: so what do you need?
[09:05:26] GorillaApe: only join I guess
[09:06:08] GorillaApe: I am using Spree that has this structure. However it doesnt support out of the box multiple filtering out of the box
[09:06:10] universa1: sorry, still not understanding the problem.
[09:06:42] workmad3: has joined #RubyOnRails
[09:06:52] universa1: given your example, what is it that you want?
[09:07:09] universa1: property_id = 3 and value in (blah, 44) ?
[09:07:40] GorillaApe: My problem is that I want to do filtering by multiple properties. For example product of brand = X and size= 5
[09:07:57] dkam: Maybe where( property: 3).where(value: [ 'blah', 44])
[09:08:16] GorillaApe: if they were collumns it would be dead simple
[09:08:21] GorillaApe: but they follow eav model
[09:12:03] universa1: well since we don't know the structure, it would probably be helpful to show the associations, ...
[09:12:30] artto: has joined #RubyOnRails
[09:14:44] artto: has joined #RubyOnRails
[09:17:01] GorillaA_: has joined #RubyOnRails
[09:18:02] tennis: has joined #RubyOnRails
[09:20:09] GorillaA_: there is Property (name,...) Product_Property ( property_id, value,product_id)
[09:20:12] GorillaA_: this is the structure
[09:23:20] sid_fules: has joined #RubyOnRails
[09:24:13] douglascorrea: has joined #RubyOnRails
[09:26:22] ferr: has joined #RubyOnRails
[09:26:25] jancel: has joined #RubyOnRails
[09:27:26] scepticulous: has joined #RubyOnRails
[09:31:20] Guest683: has joined #RubyOnRails
[09:32:01] norc: GorillaA_: What is your underlying RDBMS?
[09:32:39] triptec: has joined #RubyOnRails
[09:34:50] timmyBsd: has joined #RubyOnRails
[09:34:52] norc: GorillaA_: I recommend you take this to postgresql. In the end AR was not designed to handle AR, so you have to understand how to construct the SQL to do this.
[09:34:55] norc: #postgresql I meant.
[09:35:01] blackmesa: has joined #RubyOnRails
[09:35:03] norc: *AR was not designed to handle eav.
[09:35:45] kgrz: has joined #RubyOnRails
[09:37:14] DoubleMalt: has joined #RubyOnRails
[09:39:05] GorillaA_: what are the alternatives ?
[09:39:12] GorillaA_: since many shops do this
[09:41:13] norc: GorillaA_: Can you support that claim that "many" shops use eav?
[09:41:36] GorillaA_: I didnt claim that
[09:41:47] GorillaA_: I am just asking for alternatives
[09:42:03] GorillaA_: However popular ones like magento do use eav with some kind of indexing
[09:42:19] GorillaA_: Also Spree Commerce the best RoR ecommerce does use EAV
[09:43:21] norc: GorillaA_: Remember that at its core Rails was developed for Basecamp.
[09:43:50] GorillaA_: what do you want to say with that
[09:44:00] bruce_lee: has joined #RubyOnRails
[09:44:00] bruce_lee: has joined #RubyOnRails
[09:44:34] norc: GorillaA_: Im just saying that out of the box Rails is not designed to work with EAV.
[09:44:53] norc: Whether there are Gems or people who toss in enough manual SQL to make things work is another story.
[09:49:12] MajorTennis: has joined #RubyOnRails
[09:49:47] GorillaA_: however what are alternatives for this kind of functionallity
[09:49:54] GorillaA_: it seems solr/elastic
[09:50:05] GorillaA_: but not sure if there isnt any other lighter alternative
[09:52:02] lightt: has joined #RubyOnRails
[09:53:45] prudvi: has joined #RubyOnRails
[09:54:05] prudvi: i am new to rails, can somebody please help
[09:54:07] artto: has joined #RubyOnRails
[09:54:22] workmad3: GorillaA_: are you just wanting some way to store and then query against arbitrary, schemaless values stored against some other object?
[09:56:04] roelof: has joined #RubyOnRails
[09:56:36] roelof: Hello, Does someone have a example how to make a selectbox test in capabary ?
[09:57:24] prudvi: when i am running the rails server with the command "rails s", i am getting the following error:https://gist.github.com/anonymous/0c70069c5643131d3f547de498050b31
[09:57:37] prudvi: somebody please help. thanks
[09:58:17] norc: prudvi: First, you should *always* be using "bundle exec" in front of your commands.
[09:59:03] Macaveli: has joined #RubyOnRails
[09:59:12] workmad3: norc: `rails s` doesn't need the prefix in 95%+ of cases, as it activates bundler as the first step of loading rails
[09:59:49] norc: workmad3: Since when?
[09:59:55] AntiSpamMeta: has joined #RubyOnRails
[09:59:57] roelof: workmad3: yes, I mean capybara
[09:59:58] norc: And where is that done?
[10:00:02] workmad3: prudvi: a very quick glance at the readme of `validates_timeliness` (where the error is coming from) shows that the 4.x version is for rails 4+ only, but they haven't applied that constraint in their gemspec
[10:00:13] workmad3: norc: since rails 3 was first released
[10:00:24] sevenseacat: its been that way for a long while
[10:00:50] norc: I apologize then.
[10:00:56] prudvi: has joined #RubyOnRails
[10:01:07] workmad3: prudvi: a very quick glance at the readme of `validates_timeliness` (where the error is coming from) shows that the 4.x version is for rails 4+ only, but they haven't applied that constraint in their gemspec
[10:01:18] workmad3: (as I assume you missed that reply)
[10:01:30] prudvi: my last connection got disconnected, please give me some instructions thanks
[10:02:09] lalalaaa: has joined #RubyOnRails
[10:02:11] prudvi: @workmad: can you please tell me how i proceed further
[10:02:55] prudvi: i am getting this error:https://gist.github.com/anonymous/0c70069c5643131d3f547de498050b31
[10:02:55] workmad3: prudvi: you have a version issue... you need to sort it out... if you need more advice than that, maybe you should be revisiting your beginner ruby guides ;)
[10:02:59] prudvi: while running rails server
[10:03:31] prudvi: @workmad: so i have to make the ruby version proper right
[10:04:12] workmad3: prudvi: no, it's a gem version issue, not a ruby version issue... which is why I mentioned the gem not ruby itself
[10:04:56] GorillaA_: workmad3: yes (key/value)
[10:05:00] prudvi: @workmad: ok, so if i skip that gem the server should ideally run right?
[10:05:23] GorillaA_: http://www.stylight.com/Heeled-Sandals/ like they do there
[10:05:33] GorillaA_: multiple dynamic
[10:05:49] workmad3: GorillaA_: have you considered just storing that sort of property in an hstore or json field on your products? postgres has built-in support for that (and for indexing/querying them)
[10:06:08] roelof: workmad3: Can I use this as a capybara test to look if a feature is implemented well : find('#organizationSelect').find(:xpath, 'option[2]').select_option
[10:06:14] GorillaA_: i did but not sure if it is the best solution
[10:06:35] GorillaA_: also needs some tweaking like building this index
[10:06:43] workmad3: GorillaA_: it's the way I'd go with that nowadays rather than try to force yet anotheng shitty EAV setup into a relational db
[10:07:04] GorillaA_: yep . However I wonder how others are doing it
[10:08:07] GorillaA_: https://www.scrooge.co.uk/c/155/internal_ssds.html like these
[10:08:17] workmad3: GorillaA_: why do you care how someone hacked an EAV structure into MySQL using PHP 5 years ago, when you're using Rails and Postgres now and there's support for attaching schemaless, queryable blobs of data to records out the box?
[10:08:58] GorillaA_: I am just wondering what other people use. I feel that there is some magic
[10:09:21] GorillaA_: I might go with that route htstore/json but just looking for solutions
[10:09:22] workmad3: GorillaA_: the other option is to use something like solr or elasticsearch, which has some built-in support for faceting
[10:09:47] GorillaA_: solr/elasticsearch isnt only for full text search
[10:10:04] workmad3: GorillaA_: but you'll still want to store the data inside postgres, and for that I'd still recommend json ;)
[10:10:12] GorillaA_: When should one use solr/etc vs hstore/json ?
[10:10:45] workmad3: GorillaA_: there aren't any clear-cut rules... you need to be aware of the features of both and match them up to what you need to do and the constraints of where you're deploying your code
[10:11:06] workmad3: (that's true of pretty much every decision you need to make btw)
[10:11:40] GorillaA_: I use vps and anazon cdn , no issue
[10:11:47] haaj: has joined #RubyOnRails
[10:11:55] workmad3: GorillaA_: btw, I am not making the decision for you
[10:11:56] GorillaA_: I might go down with pg
[10:16:48] njero: has joined #RubyOnRails
[10:17:00] triptec: has joined #RubyOnRails
[10:24:55] lalalaaa: has joined #RubyOnRails
[10:31:23] arBmind: has joined #RubyOnRails
[10:32:13] roelof: why does Rails not know the root_path here : <%= link_to root_path do %>
[10:32:36] sevenseacat: define 'does not know the root path'
[10:33:39] roelof: sevenseacat: ActionView::Template::Error (undefined local variable or method `root_path' for #<#<Class:0x000000056f72c8>:0x000000056f5bf8>
[10:34:07] sevenseacat: so, is this being called in a view? have you defined a root path?
[10:34:09] triptec: has joined #RubyOnRails
[10:35:16] roelof: aha, I thought I did but apperently on this try not
[10:36:31] roelof: sometimes things are so simple as they look
[10:36:53] wd40s: has joined #RubyOnRails
[10:37:58] sevenseacat: you just need to actually look.
[10:40:05] roelof: yep, and not run but take step by step
[10:41:01] kyrose: has joined #RubyOnRails
[10:42:58] GorillaA_: I am feeling a bit confused. After generating my arel query how can I execute it?
[10:45:47] GodFather: has joined #RubyOnRails
[10:48:12] nir0: has joined #RubyOnRails
[10:48:47] nir0: hi guys, can i use a namespace as other-domain root?
[10:48:56] datanoise: has joined #RubyOnRails
[10:49:24] maucar: has joined #RubyOnRails
[10:50:28] haaj: has joined #RubyOnRails
[10:50:44] andywww: has joined #RubyOnRails
[10:51:30] andywww: i’m stringling with a has many through on a polymorphic join
[10:51:33] andywww: https://gist.github.com/anonymous/94fa4719ad767d3739ef7ff24ddadbd9
[10:52:11] andywww: for some reason its sending me back manager objects instead of tweets
[10:52:25] andywww: do i have something the wrong way round?
[10:54:19] nir0: andywww: , source: :mentionable, source_type: "Manager" - do u need this? try without it
[10:54:36] srinidhi: has joined #RubyOnRails
[10:54:40] andywww: it can’t work out the source type if i take that out
[10:55:56] andywww: uninitialized constant Manager::Tweets
[10:56:18] andywww: @tweets = @manager.tweets.order(created_at: :desc).group(:id)
[10:56:48] nir0: has_many :tweets, through: :mentions still ther?
[10:56:55] rodfersou: has joined #RubyOnRails
[10:56:55] wd40s: has joined #RubyOnRails
[10:57:35] nir0: it should not say uninitialized if u said has_many :tweets
[10:57:41] andywww: https://gist.github.com/anonymous/c606d63fe2432dd879bfb87fddcebd21
[10:59:30] andywww: this is strange, i have aliases and buzzmentions which are set up the same way
[10:59:33] andywww: they both work
[10:59:42] andywww: let me have another look through it all, thanks
[11:00:14] GodFather: has joined #RubyOnRails
[11:01:33] Guest_85754: has joined #RubyOnRails
[11:01:42] Guest_85754: Allah is doing
[11:01:50] Guest_85754: sun is not doing Allah is doing
[11:02:00] Guest_85754: moon is not doing Allah is doing
[11:02:01] GodFather: has joined #RubyOnRails
[11:02:09] ChanServ: +q *!*@gateway/web/cgi-irc/kiwiirc.com/ip.
[11:04:48] GodFather: has joined #RubyOnRails
[11:05:00] chouhoulis: has joined #RubyOnRails
[11:05:05] AimlessRAven: has joined #RubyOnRails
[11:05:14] andywww: hmm, seems correct
[11:05:15] AimlessRAven: hi all, i install admin-lte gem and download admin-lte premium template
[11:05:16] andywww: this is strange
[11:05:36] AimlessRAven: now how to include this files to my admin panel
[11:06:29] jmignault: has joined #RubyOnRails
[11:12:55] triptec: has joined #RubyOnRails
[11:14:03] mdw: has joined #RubyOnRails
[11:14:24] GodFather: has joined #RubyOnRails
[11:15:05] tvw: has joined #RubyOnRails
[11:16:19] k3rn31: has joined #RubyOnRails
[11:16:41] Devalo: has joined #RubyOnRails
[11:18:47] GodFather: has joined #RubyOnRails
[11:21:30] artto: has joined #RubyOnRails
[11:22:01] nir0: has joined #RubyOnRails
[11:24:08] sid_fules: has joined #RubyOnRails
[11:24:22] nir0: has left #RubyOnRails: ()
[11:25:19] andywww: https://gist.github.com/anonymous/3fa69591cfc369099b0ba4d3dc2d33d6
[11:25:26] andywww: why on earth is it returning managers?
[11:25:31] andywww: Manager.* from…
[11:26:13] douglascorrea: has joined #RubyOnRails
[11:28:33] andywww: https://gist.github.com/anonymous/8125bcbca85a896a1bb21b0e0ea6ffbf
[11:28:42] andywww: sorry, posted above
[11:30:43] sevenseacat: andywww: source_type: "Manager"?
[11:31:28] ldnunes: has joined #RubyOnRails
[11:31:53] andywww: when i remove it i get:
[11:31:53] andywww: Cannot have a has_many :through association 'Manager#tweets' on the polymorphic object 'Mentionable#mentionable' without 'source_type'. Try adding 'source_type: "Tweet"' to 'has_many :through' definition.
[11:32:18] sevenseacat: and it tells you exactly what to do
[11:32:40] sevenseacat: please follow the direction of the error message
[11:34:14] k3rn31: has joined #RubyOnRails
[11:34:29] artto: has joined #RubyOnRails
[11:35:51] andywww: on the Manager model, tell it the association type is a different model??
[11:36:25] andywww: this is in th Manager model
[11:36:26] andywww: has_many :tweets, through: :mentions, source: :mentionable, source_type: "Manager"
[11:36:26] sevenseacat: thats what you want isnt it? to tell the model that the tweet association gives you Tweet objects?
[11:36:53] andywww: I want to do Manager.last.tweets
[11:37:14] sevenseacat: you're telling it that the tweets association gives you Manager records. and then wondering why it does.
[11:37:23] andywww: so the above should be:
[11:37:33] andywww: has_many :tweets, through: :mentions, source: :mentionable, source_type: “Tweet”
[11:37:40] sevenseacat: yes, as the error message stated.
[11:37:40] Guest_85754: has left #RubyOnRails: ()
[11:37:47] potbelly: has joined #RubyOnRails
[11:39:23] robbyoconnor: has joined #RubyOnRails
[11:40:52] andywww: the relation is falling over somewhere still
[11:40:54] andywww: https://gist.github.com/anonymous/691442caa76e1266d9e89c538706fbe2
[11:41:04] pawnbox_: has joined #RubyOnRails
[11:41:15] andywww: its got the correct number of mentions but the tweets are coming through as 0
[11:41:35] sevenseacat: do those tweets exist?
[11:42:07] AntiSpamMeta: has joined #RubyOnRails
[11:42:25] sevenseacat: yeah something's still borked there
[11:43:03] sevenseacat: your belongs_to :tweets should be belongs_to :tweet
[11:43:19] herbst: has joined #RubyOnRails
[11:45:23] artto_: has joined #RubyOnRails
[11:45:42] GodFather: has joined #RubyOnRails
[11:47:18] andywww: yeah just changed that, its the same
[11:47:26] andywww: one minute let me tidy and I’ll repost
[11:47:38] GodFather: has joined #RubyOnRails
[11:48:05] andywww: it doesn’t seem to be joining managers in the sql
[11:48:13] andywww: Manager.last.tweets.size
[11:48:25] andywww: SELECT COUNT(*) FROM "tweets" INNER JOIN "mentions" ON "tweets"."id" = "mentions"."mentionable_id" WHERE "mentions"."mentionable_id" = $1 AND "mentions"."mentionable_type" = $2 AND "mentions"."mentionable_type" = $3 [["mentionable_id", 25], ["mentionable_type", "Manager"], ["mentionable_type", "Tweet"]]
[11:48:27] sevenseacat: I also think source should be :tweet, not :mentionable
[11:48:37] sevenseacat: and source_type should be removed
[11:52:02] andywww: you are correct kind sir
[11:52:02] ryanong: has joined #RubyOnRails
[11:52:05] andywww: thats sorted it
[11:52:15] andywww: thanks for that
[11:52:33] sevenseacat: you're welcome.
[11:54:00] ryanong: has left #RubyOnRails: ()
[11:54:47] andywww: i picked the source type up from here
[11:54:48] andywww: http://joeswann.co.nz/rails-4-has_many-polymorphic-relationships/
[11:55:13] sevenseacat: which is fine, but your associations go the other way
[11:55:44] ryanvermooten: has joined #RubyOnRails
[11:56:09] andywww: yep i see that now
[11:56:13] andywww: lesson learned
[11:56:18] rodferso1: has joined #RubyOnRails
[11:56:22] RegulationD: has joined #RubyOnRails
[11:56:30] ryanvermooten22: has joined #RubyOnRails
[11:57:32] andywww: has left #RubyOnRails: ()
[11:57:42] njero: has joined #RubyOnRails
[11:59:28] c355E3B: has joined #RubyOnRails
[11:59:48] blackmesa: has joined #RubyOnRails
[12:00:06] haaj: has joined #RubyOnRails
[12:00:07] workmaster2n: has joined #RubyOnRails
[12:00:50] ryanvermooten22: Hi there guys, I hope you’re all doing well, I wonder if someone can help point me in the right direction. I have a table which has a few has many relations. This table is my questionnaire table, which then connects all the other tables together (example in the experience table there is a questionnaire_id). Currently I have to create the ID in a hidden field form and then go onto the first page of questions, what I would like to do is go straig
[12:00:51] ryanvermooten22: to the experience form and it creates that unique forign key id for me.
[12:00:59] ryanvermooten22: does that make sense what I’m trying to achieve
[12:01:10] ryanvermooten22: Im struggling to figure out how to google this
[12:03:24] yellow5: has joined #RubyOnRails
[12:04:14] mdw: has joined #RubyOnRails
[12:04:45] nettoweb: has joined #RubyOnRails
[12:05:21] nobitanobi: has joined #RubyOnRails
[12:07:11] triptec: has joined #RubyOnRails
[12:07:29] douglascorrea: has joined #RubyOnRails
[12:09:54] ZiggyTheHamster: has joined #RubyOnRails
[12:10:15] cgfbee: has joined #RubyOnRails
[12:10:56] marchelzo: has joined #RubyOnRails
[12:18:30] norc: ryanvermooten22: Break your problem down into small parts.
[12:19:29] ryanvermooten22: what my problem is is that I am trying to call a foriegn id that doesn’t exist because it hasn’t been made yet, I almost need to add to my form create new forign id and then store that new id
[12:20:09] norc: ryanvermooten22: What you said will probably not make sense to anyone who a) does not know your code, and b) knows your thoughts and goals.
[12:20:12] triptec: has joined #RubyOnRails
[12:20:43] douglascorrea: has joined #RubyOnRails
[12:21:09] universa1: ryanvermooten22: do you mean "nested model form" ?
[12:21:21] ryanvermooten22: I know, thats whats so tough, im not generally one for asking for help, I try google everything, but I don’t even know how to phrase what im looking for.
[12:21:28] Circuit8: If I'm about to start a big project, should I build it with the latest version of Rails 5, or will I have problems with that?
[12:21:29] universa1: https://www.youtube.com/watch?v=amT27SfNhKM
[12:21:59] sid_fules: has joined #RubyOnRails
[12:22:27] norc: Circuit8: Do you have the need for Web Sockets from the beginning?
[12:23:15] ryanvermooten22: universa1: it is a nested model yes, but what Im trying to do is create a new id in my join table called questionnaires within my nested model
[12:23:56] workmad3: Circuit8: the biggest problem you'll likely encounter is that many common gems haven't released versions that support rails 5 yet... the support exists in their github repo, it just isn't in a released version as they're waiting for a final release to fix any potential problems that could introduce
[12:24:29] norc: workmad3: I reckon the only reason to start with rails5 is if you really need to work with actioncable.
[12:25:15] workmad3: norc: or if you know you'll be updating as soon as rails 5 is dropped and would rather deal with the minor bugs now rather than an update process later
[12:25:16] norc: Unless there is some robust websockets framework alternative around that I do not know about.
[12:25:28] diegoaguilar: has joined #RubyOnRails
[12:25:35] norc: Good point.
[12:27:42] workmad3: norc: there's also some patches and bug fixes in rails 5 that haven't been ported into a rails 4.2 release yet (like one that allows ActiveRecord to recover from a poisoned prepared statement pool)
[12:28:13] workmad3: so it's not quite as simple as "Do you want one specific large new feature straight away?" (it rarely is :) )
[12:28:28] dionysus69: has joined #RubyOnRails
[12:30:49] sandstrom: has joined #RubyOnRails
[12:31:52] flashpoint9: has joined #RubyOnRails
[12:32:04] sandstrom: When using active model serializers + namespaces, is it best to use `MyNamespace::UserSerializer < ApplicationSerializer` or `module MyNamespace; UserSerializer < ApplicationSerializer; end;` ?
[12:32:44] norc: Is there a way to get find_by! semantics with an ActiveRecord_Associations_CollectionProxy ?
[12:33:29] norc: Or do I have to toss a "where( ... ).last or fail ActiveRecord::RecordNotFound" at it?
[12:34:18] refinerysource: has joined #RubyOnRails
[12:34:51] norc: sandstrom: I would go for the first since it does not waste indentation.
[12:35:16] sandstrom: I think there are differences between the two (other than indentation)
[12:35:34] fmcgeough: has joined #RubyOnRails
[12:35:42] workmad3: norc: `find_by!` works on that directly
[12:36:56] workmad3: sandstrom: there are differences, but they're related to visibility of constants within the class/module so if you're not using any constancs from `MyNamespace` I'd go for the first
[12:37:14] gingray: has joined #RubyOnRails
[12:37:34] norc: workmad3: Oh.. can we simply assume I didn't ask a silly question a few minutes ago and that you never answered?
[12:37:40] workmad3: norc: nope :P
[12:37:51] norc: Thank you in that case.
[12:38:46] sandstrom: workmad3 I'm having some weird issues with preloading and a wild guess that I have is that it's caused by me using this syntax over the regular one (with `module` keyword)
[12:39:21] scepticulous: has joined #RubyOnRails
[12:39:51] artto: has joined #RubyOnRails
[12:40:18] workmad3: sandstrom: what sort of weird issue
[12:40:28] universa1: sandstrom: well, easy to check, change the syntax and try.
[12:41:34] sandstrom: universa1 I wish :) the issue is within Sidekiq, and it only occurs now and then (I cannot consistently reproduce). I think it has something to do with which jobs are run first after booting (not sure though)
[12:42:00] universa1: what is "the issue" ?!
[12:42:47] sandstrom: workmad3 that some methods cannot be seen on a class within a namespace. This namespace wraps both a class within lib (i.e. lib/my_namespace/my_class) and a serializer (serializers/my_namespace/my_serializer). The error is simply "NoMethodError occurred"
[12:42:49] workmad3: sandstrom: do you happen to have an `app/models/my_namespace.rb` file that isn't loaded sometimes in dev?
[12:43:05] norc: sandstrom: the syntax makes no difference. Autoloading just tells where a class is to be found, and the two variants you mentioned are equivalent.
[12:43:09] King_Rex: has joined #RubyOnRails
[12:43:31] universa1: sandstrom: do you have a stack trace?!
[12:43:45] tknz: has joined #RubyOnRails
[12:43:55] norc: sandstrom: Can you be specific what you mean by "weird issues" ?
[12:44:15] workmad3: norc: not quite... `module MyNamespace; class Foobar` has different scoping rules to `class MyNamespace::Foobar` and I think would also alter whether `MyNamespace` is autoloaded (because no const_missing is triggered for `module MyNamespace`)
[12:44:19] norc: Because if Ruby invoked nethack for me some people might call that a weird issue, but that wouldn't be something I would debug...
[12:45:11] norc: workmad3: well the first isn't something that would present itself as a race condition.
[12:45:17] norc: workmad3: the second however could.
[12:45:18] workmad3: sandstrom: could you gist the two classes and the stacktrace
[12:46:22] workmad3: norc: the different scoping rules could present themselves as something that looks almost like a race condition, because the scoping rules can then change if you reopen the class, so you have different scoping rules for two methods within the same class
[12:46:27] workmad3: but I agree that it's not likely here
[12:46:37] Malgorath: has joined #RubyOnRails
[12:47:36] Malgorath: Is it difficult to add an intial variable to pass an engine like from host app have host.app/1/engine/ where I have access to the 1 at all times inside the engine?
[12:47:44] norc: workmad3: never gave it much thought, the indentation alone is reason enough to simply use Foo::Bar
[12:48:17] sandstrom: workmad3 norc universa1 http://pastie.org/private/qvihtfwdigsdtaemzihaq
[12:48:59] artto: has joined #RubyOnRails
[12:49:06] workmad3: norc: `class Test; end; class Fizzbuzz::Test; end; class Fizzbuzz::Foobar; Test; end` <-- what class is `Test` referring to at the end there? :)
[12:49:35] norc: workmad3: Fizzbuzz::Test I would say intuitively.
[12:49:49] workmad3: norc: and you would be wrong
[12:50:15] sevenseacat: I would have fully-quantified the bastard because I have no idea.
[12:50:29] workmad3: norc: but you'd be absolutely right if you'd done `module Fizzbuzz; class Foobar; Test; end; end`
[12:51:51] workmad3: norc: and then if you'd done `class Fizzbuzz::Foobar; def one; Test; end; end; module Fizzbuzz; class Foobar; def two; Test; end;` (some 'ends' missing) you'd get `::Test` from `one` and `::Fizzbuzz::Test` from `two`... it's somewhat weird :)
[12:52:25] Circuit8: workmad3: Ah OK thanks. Is there an ETA for rails 5 dropping? I don't want to deal with the headache of updating later, but I also don't want to deal with the headache of misconfigured gems!
[12:52:28] norc: workmad3: Well from the perspective from methods its simple.
[12:52:47] sevenseacat: Circuit8: soon.
[12:52:56] workmad3: sandstrom: hmm... is `Malleable::Client` something you're monkey-patching from a library?
[12:53:19] sandstrom: workmad3 no, it's custom code
[12:53:21] Circuit8: sevenseacat: Is soon a matter of weeks or months?
[12:53:29] sevenseacat: Circuit8: soon.
[12:53:34] sandstrom: `Elasticsearch::Client` is a library/gem though
[12:53:34] norc: sandstrom: Honestly, an exact error message with a stack trace would be helpful.
[12:53:35] workmad3: sandstrom: and it's only defined in that one place? not monkey-patched?
[12:53:36] Circuit8: sevenseacat: I see how it is
[12:53:53] workmad3: norc: it's in the pastie link
[12:54:00] sandstrom: norc there was a stacktrace in the pastie (or am I misunderstanding you)
[12:54:19] norc: People with the skills to utilize their mouse wheel are obviously better suited to giving advice in this channel.
[12:54:41] norc: Didn't see there was more at the bottom.
[12:54:42] ramortegui: has joined #RubyOnRails
[12:55:20] sandstrom: workmad3 yes, there is only a single file in the entire repo named 'client.rb' and it's never re-opened or anything like that.
[12:55:47] sandstrom: there are, however, a namespace 'malleable' both in lib and under serializers (hence my initial question, on whether that could be the cause)
[12:56:35] norc: sandstrom: Do you have a Client in both?
[12:56:53] norc: sandstrom: But yeah, it is beginning to actually sound like workmad3 initial (second) idae.
[12:57:28] norc: sandstrom: Do you have some funky included? hook in QueryBuilder ?
[12:59:02] sandstrom: norc QueryBuilder does not reference any class besides `Time` (it basically just a few methods to create a bunch of queries, i.e. build hashes + strings)
[12:59:25] sandstrom: (and it does not include any other code)
[12:59:38] norc: sandstrom: Do you have an interactive shell open?
[12:59:55] norc: sandstrom: I would pry into the client object to figure out what kind of class this is.
[12:59:58] sandstrom: yes (but not with autoloading enable, though I can switch it over)
[13:00:18] norc: Because obviously it is based on the class definition you have pasted.
[13:00:22] norc: *it is not
[13:01:13] chouhoulis: has joined #RubyOnRails
[13:01:18] scepticulous: has joined #RubyOnRails
[13:01:35] pawnbox: has joined #RubyOnRails
[13:02:27] Malgorath: nvm my question, I got it working
[13:02:44] norc: sandstrom: For example does the object respond to some other public method (or es_client if there is no other)? If so, you can use Method#source_location to find out where it comes from.
[13:02:48] triptec: has joined #RubyOnRails
[13:03:03] jancel: has joined #RubyOnRails
[13:03:39] njero: has joined #RubyOnRails
[13:04:30] norc: workmad3: Okay having thought about it, as long as your modules are empty it makes no difference for autoloading.
[13:04:48] marchelzo: has joined #RubyOnRails
[13:05:43] GorillaA_: Is using Arel bad practice?
[13:05:57] rvanlieshout: GorillaA_: why would it be?
[13:06:22] norc: GorillaA_: Using Arel for the wrong reasons is bad practice.
[13:06:23] GorillaA_: Another dev told me that it is the old way to do things like cobol days
[13:06:40] matthewd: It's undocumented and unsupported.. but very handy when it's the only way to solve your problem
[13:06:57] matthewd: Did they happen to mention what the new way is, then? :/
[13:07:25] GorillaA_: only that there should be a way
[13:07:26] sandstrom: norc good suggestion, I'll pry into the object
[13:09:03] matthewd: GorillaA_: If they said that in response to a particular piece of code, see norc's point. Otherwise, that doesn't sound like terribly insightful advice.
[13:10:46] artto_: has joined #RubyOnRails
[13:13:23] Ropeney: has joined #RubyOnRails
[13:13:26] pawnbox: has joined #RubyOnRails
[13:13:53] nettoweb: has joined #RubyOnRails
[13:14:16] matthias_: has joined #RubyOnRails
[13:15:06] qejk: has joined #RubyOnRails
[13:16:21] aegis3121: has joined #RubyOnRails
[13:16:35] eml: has joined #RubyOnRails
[13:17:19] GorillaA_: to try and match other route if current isnt matched?
[13:17:47] norc: GorillaA_: Rails does that automatically.
[13:18:09] rvanlieshout: it'll use the first one that matches
[13:18:26] GorillaA_: I mean to have /oldshit/{slug} if slug doesnt exist continue with next
[13:19:10] norc: GorillaA_: You can nest routes
[13:19:14] Devalo: has joined #RubyOnRails
[13:19:33] norc: GorillaA_: What do you mean with "slug does not exist" ?
[13:20:14] GorillaA_: /oldshit/old-product should check if old-product exists in database
[13:20:37] |meta: has joined #RubyOnRails
[13:22:00] pawnbox: has joined #RubyOnRails
[13:23:09] norc: GorillaA_: An incoming request is matched against a route. If matched, the corresponding controller#action is then called. Now you get to play with your model to find out whether it exists ornot.
[13:23:33] GorillaA_: it just raises an error?
[13:23:41] norc: GorillaA_: If thats what you want, then you can raise an exception.
[13:23:41] GorillaA_: isnt there a way to continue to next routes?
[13:23:48] norc: GorillaA_: No.
[13:23:57] GorillaA_: so I should live with that
[13:24:05] rvanlieshout: GorillaA_: you can set constraints on that route
[13:25:08] norc: rvanlieshout: A model aware constraint sounds horrible.
[13:25:19] GorillaA_: I would keep it simple
[13:26:17] matthewd: norc: Seems better than the alternatives
[13:27:40] norc: matthewd: A simple if/else statement in an action to decide how to proceed sounds simpler than a route hitting the database when its trying to match.
[13:27:57] norc: Or what am I missing here?
[13:28:50] matthewd: You've presumably just merged two very different actions into one method, just to move the DB query -- which is still going to happen at exactly the same time
[13:29:53] macsteps: has joined #RubyOnRails
[13:30:22] pawnbox: has joined #RubyOnRails
[13:30:27] haaj_: has joined #RubyOnRails
[13:31:07] workmad3: norc: I've done some model-aware constraints before... but for multi-tenant apps, and I also used the constraint to push the tenant information into `request.env` :)
[13:32:32] workmad3: norc: as with many things, in certain situations it can be a really useful and powerful way to do something
[13:33:11] MajorTennis: has left #RubyOnRails: ("Leaving")
[13:33:55] norc: workmad3: You are right. I just have the stance that if you want to do something exotic that you need to justify the need for it, otherwise a "XY Problem" is far more likely.
[13:34:07] Axilla: has joined #RubyOnRails
[13:34:22] Axilla: hey all i just deployed a rails 5 app to aws and my assets will not compile.. sites up but not serving a single asset
[13:34:27] Axilla: when i look in the log i see no errors..
[13:34:59] Axilla: i'm deploying with capistrano
[13:35:12] norc: axilla: a) What error do you get when trying to compile your assets? b) Who is supposed to serve your assets?
[13:37:08] norc: axilla: What do you mean?
[13:37:24] Axilla: the assets are in the asset pipeline
[13:37:31] Axilla: the app is running on nginx
[13:37:34] Axilla: using puma
[13:37:47] Axilla: i have used this exact same setup many times
[13:37:47] norc: axilla: So. Who is supposed to serve the assets?
[13:37:55] norc: axilla: Nginx? Puma?
[13:38:20] norc: axilla: Then you need to look at your nginx logs.
[13:38:41] norc: axilla: Though if compilation has failed, then that will be your problem (as nginx cannot serve assets it does not have)
[13:39:21] Axilla: this same config runs other sites though..
[13:39:30] Axilla: doesn't make sense.. unless there is something different about rails 5
[13:39:32] Axilla: i'm not seeing.
[13:39:48] norc: axilla: Did capistrano compile the assets?
[13:40:14] kali3: has joined #RubyOnRails
[13:40:50] artto: has joined #RubyOnRails
[13:40:54] Axilla: there are assets in /public/assets
[13:41:00] Axilla: on my servers
[13:41:21] norc: axilla: and your browser is unable to retrieve them?
[13:41:41] norc: Can you look and ensure that the ones your browser is requesting actually exist there? If so you have a nginx problem.
[13:44:52] norc: If not you have a sprockets problem.
[13:46:24] Axilla: my root in nginx is set to /home/deploy/app/public
[13:46:30] Axilla: the assets are in current/public/assets
[13:46:36] Axilla: nginx is looking for /assets/file
[13:46:41] Axilla: all looks good to me
[13:46:46] Axilla: the files are there in the current folder
[13:46:49] Axilla: but nginx can't find them.
[13:46:53] Alazoral: has joined #RubyOnRails
[13:46:55] norc: axilla: gist your nginx config.
[13:47:03] universa1: hmm, the manifest file changed it's extension iirc
[13:47:19] universa1: so if you cleanup with capistrano after compilation, this might be a problem ;)
[13:47:39] universa1: s/it's/its/
[13:48:13] eljimmy: has joined #RubyOnRails
[13:48:37] Axilla: https://gist.github.com/travisdmathis/f0161931a32973e6d5ad0dd57d38e3f7
[13:48:48] Axilla: i do cleanup
[13:48:51] Axilla: universa1:
[13:49:44] Axilla: https://gist.github.com/travisdmathis/f0161931a32973e6d5ad0dd57d38e3f7
[13:49:48] Axilla: updated the gist with my capfile
[13:50:13] universa1: axilla: check in your deployed directory, that there is a manifest file, does rails link to the correct asset file?
[13:51:01] norc: So, we are thinking about exposing some resources through a REST API to the outside. As one part of security measures, we do not expose internal serial identifiers - instead each resource get's an "opaque_identifier" which is just a UUID. So when one wants to specify a resource, he needs to specify the UUID. Is that by itself a decent thought?
[13:51:50] norc: So you would have something like GET /contract/13926ebb-e692-434b-b540-a7fdeb5d8ee3.json => Rationale is that we want to reduce possible attack surfaces by making identifiers unguessable.
[13:51:57] pontiki: has joined #RubyOnRails
[13:51:58] darutoko: has joined #RubyOnRails
[13:52:34] Axilla: universa1: there is a assets_manifest_backup folder but its empty and no manifest file
[13:54:24] matthias_: has joined #RubyOnRails
[13:55:36] Axilla: i think i might know!
[13:56:46] arup_r: has joined #RubyOnRails
[13:56:58] triptec: has joined #RubyOnRails
[13:57:16] agent_white: has joined #RubyOnRails
[14:00:52] mdw: has joined #RubyOnRails
[14:01:06] pawnbox: has joined #RubyOnRails
[14:01:16] xploshioon: has joined #RubyOnRails
[14:01:40] artto: has joined #RubyOnRails
[14:03:24] alaing_: has joined #RubyOnRails
[14:03:53] alaing: has joined #RubyOnRails
[14:04:56] lxsameer: has joined #RubyOnRails
[14:04:59] k3rn31: has joined #RubyOnRails
[14:06:41] alaing: Hi I need some help with strong params https://gist.github.com/aliuk2012/d289da6a10b2e5f031428697af2294ad I'm trying to submit an array of uploaded files to process.
[14:06:46] arup_r1: has joined #RubyOnRails
[14:06:55] DragonPunch: has joined #RubyOnRails
[14:07:06] alaing: however my file element is being blocked
[14:07:09] jhack: has joined #RubyOnRails
[14:07:18] alaing: Unpermitted parameter: temp_attachment_array
[14:07:38] alaing: temp_attachment_array is not in the model
[14:08:31] Axilla: don't get it :(
[14:08:31] nurey: has joined #RubyOnRails
[14:09:40] JohnDotHR: has joined #RubyOnRails
[14:09:50] JohnDotHR: Does anyone know why this error is showing? No route matches {:action=>"create", :controller=>"users"}
[14:09:59] JohnDotHR: heere's the code
[14:10:00] JohnDotHR: <%= form_for(:user, :url => {:controller => 'users', :action => 'create'}) do |f| %> <p> Username: </br> <%= f.text_field :username %> </p> <p> E-mail: </br> <%= f.text_field :email %> </p> <p> Password: </br> <% f.password_field :password %> </p>
[14:10:11] JohnDotHR: and here's the route
[14:10:12] JohnDotHR: match ':controller(/:action(/:id))(.:format)'
[14:11:03] Fernando-Basso: has joined #RubyOnRails
[14:11:27] alaing: JohnDotHR: not strictly related to your question but I suggest you use f.label :username instead of hard coding "Username:"
[14:11:50] arup_r1: JohnDotHR: form_for by default does `POST` request
[14:12:25] fedexo: has joined #RubyOnRails
[14:12:26] JohnDotHR: @ arup____ But that shouldn't give out an error?
[14:12:26] alaing: the reason is to improve accessiblity. when a screenreader accesses your form the user will not be told what that file is form. plus if you click on "Username: it would set focus to the field that its linked too
[14:12:27] arup_r1: so match ':controller(/:action(/:id))(.:format)', via: [:post]
[14:12:38] Guest683: has joined #RubyOnRails
[14:12:57] cd83x: has joined #RubyOnRails
[14:13:01] alaing: JohnDotHR: same applies for "Password:"
[14:13:05] arup_r1: JohnDotHR: no route match error always gives hints that route you defined is not matching with the request u made
[14:13:50] arup_r1: JohnDotHR: what is `rake routes` is showing show in !gist
[14:14:20] arup_r1: !gist your rake routes output and server log for this request
[14:14:25] sevenseacat: JohnDotHR: remove that catch-all route from your routes file.
[14:14:47] JohnDotHR: https://gist.github.com/ivancernja/1cce5b705c2c968fe85aefc6b7c677aa
[14:15:56] kitsuneyo: has joined #RubyOnRails
[14:16:41] arup_r1: well, your route is broken, u see yeah?
[14:16:47] alaing: my strong params should accept either one or many uploaded files
[14:17:06] arup_r1: do follow the suggestion as rake routes said
[14:17:40] kitsuneyo: i have this conditional validation... "validates :name, presence: true, if: :human?" but i also want to validate "if: :dog?"
[14:17:46] kitsuneyo: how do i write it in one line?
[14:17:48] JohnDotHR: that fixed it
[14:17:53] JohnDotHR: undefined method `errors' for nil:NilClass
[14:17:54] alaing: the files are coming through to my controller but strong params is killing them off
[14:18:04] JohnDotHR: <% if @user.errors.any? %> <ul class="Signup_Errors"> <% for message_error in @user.errors.full_messages %> <li>* <%= message_error %></li>
[14:18:19] sevenseacat: JohnDotHR: which part of the message is unclear?
[14:19:00] kitsuneyo: do i use a comma or || ?
[14:19:07] pontiki: "when nothing is something"
[14:19:27] bonswouar: has joined #RubyOnRails
[14:19:29] xploshioon: Hi guys, can someone help me with this? (I need to load the contracts and order this by the count of fees but where amount > used AND date < Date.today) https://gist.github.com/xploshioOn/56770f52b91689fd0b6e8bd40aa88d12 I read about count_cache but don't work for me because the count need to be conditioned.
[14:19:56] moeabdol2: has joined #RubyOnRails
[14:19:59] sevenseacat: alaing: so permit them if you want them to be permitted
[14:20:08] JesseH: has joined #RubyOnRails
[14:20:26] alaing: sevenseacat: i've tried but its not accepting them
[14:20:33] sevenseacat: alaing: !debug
[14:20:33] helpa: alaing: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[14:20:54] alaing: sevenseacat: https://gist.github.com/aliuk2012/d289da6a10b2e5f031428697af2294ad
[14:21:00] GreekFreak: has joined #RubyOnRails
[14:21:26] alaing: sevenseacat: https://gist.github.com/aliuk2012/d289da6a10b2e5f031428697af2294ad#file-doc_attachments_controller-rb-L19
[14:21:37] sevenseacat: alaing: you're permitting an array, but you're not submitting an array
[14:21:59] GreekFreak: I am trying to run a select clause with paramaters ( https://gist.github.com/tscholiadis/f55351c372345eec60ea2b1bac7c6436 ). I'm not sure how to protect for SQL injections like I do with the "where" clause (it doesn't work the same). Also I'm on 3.2.18
[14:22:22] alaing: sevenseacat: :temp_attachment_array is not an attribute in my model
[14:22:29] sevenseacat: alaing: thats irrelevant.
[14:22:42] alaing: = f.file_field :temp_attachment_array, multiple: true, class:'custom-uploader', name: 'temporary_attachment[temp_attachment_array]'
[14:22:55] sevenseacat: just because you call it _array, doesnt mean it is an array
[14:24:01] ftj: has joined #RubyOnRails
[14:24:24] alaing: really? I thought rails was clever like that :-P just kidding
[14:25:03] datanoise: has joined #RubyOnRails
[14:25:12] kgrz: has joined #RubyOnRails
[14:25:20] alaing: I did read somewhere that strong params only accepts scalar values and if its a hash/arrya then you need to tell it that it should be an arrray
[14:25:27] xploshioon: I tried with the second solution here http://stackoverflow.com/questions/16996618/rails-order-by-results-count-of-has-many-association but same problem, when there is no asociation created, they dissapear from the list
[14:25:39] sevenseacat: thats correct. you're not submitting a hash or an array for your file field.
[14:25:44] sevenseacat: you're submitting a single file.
[14:26:09] alaing: sevenseacat: even if there is multiple files selected?
[14:26:16] sevenseacat: I don't see any evidence of that.
[14:26:35] sevenseacat: I can only go by what you've shown.
[14:26:40] matthewd: GreekFreak: There are better ways of writing that query
[14:26:47] alaing: sevenseacat: multiple: true
[14:26:59] sevenseacat: alaing: I don't see any evidence of you submitting an array of data.
[14:27:00] alaing: on the file_field
[14:27:27] alaing: https://gist.github.com/aliuk2012/d289da6a10b2e5f031428697af2294ad#file-form-html-haml-L7
[14:27:39] sevenseacat: thats a file field. thats not submitted data.
[14:27:48] mdw: has joined #RubyOnRails
[14:27:51] sevenseacat: thats also a *single* file field.
[14:28:33] GreekFreak: matthewd, honestly I hit a wall and that was the best I got. Would you mind tweaking it for me? It might make me not want to do what I'm looking at
[14:28:58] pec: has joined #RubyOnRails
[14:29:19] alaing: sevenseacat: ah i see where you coming from now. so what rails is seeings is temp_attachment_array = [file1,file2,etc]
[14:29:24] dionysus70: has joined #RubyOnRails
[14:29:35] sevenseacat: again, no evidence of that
[14:29:38] matthewd: GreekFreak: (SELECT sister_1_id, sister_2_id FROM vessels_sister_ships UNION ALL SELECT sister_2_id, sister_1_id FROM vessels_sister_ships) vessels_sister_ships
[14:29:43] sevenseacat: if you've got some, feel free to show it
[14:30:37] xploshioon: Hi guys, can someone help me with this? (I need to load the contracts and order this by the count of fees but where amount > used AND date < Date.today) https://gist.github.com/xploshioOn/56770f52b91689fd0b6e8bd40aa88d12 I read about count_cache but don't work for me because the count need to be conditioned.
[14:31:18] sevenseacat: xploshioon: !guys
[14:31:18] helpa: xploshioon: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[14:32:41] jerematic: has joined #RubyOnRails
[14:33:19] pec: helpa: ... guys can be gender neutral. Not like sevenseacat said bros?
[14:33:37] sevenseacat: "not everyone feels that way"
[14:34:10] pec: alright alright...
[14:34:16] arBmind: has joined #RubyOnRails
[14:34:51] yellow5: has joined #RubyOnRails
[14:35:27] xploshioon: ok, of course, sorry for that folks ;)
[14:36:22] xploshioon: well, I think ill use callbacks for after save and after destroy to update a counter field manually
[14:36:34] rogue_koder: has joined #RubyOnRails
[14:36:40] xploshioon: seems to be the only solution
[14:37:10] JH_2: has joined #RubyOnRails
[14:37:10] GreekFreak: matthewd, isn't that running 2 sql queries and then unifying them? Is that faster than running one more complex one?
[14:37:15] matthewd: xploshioon: That would work; otherwise you'll need a subquery
[14:37:50] Macaveli: has joined #RubyOnRails
[14:38:12] matthewd: GreekFreak: You're running two queries against every other table instead
[14:40:07] xploshioon: @matthewd I tried with a subquery, but when there is no associations created, they dissapear from the list. and thinking about the use, is better to have the field and not doing always the calculation
[14:40:09] alaing: sevenseacat: i've removed the hard coded name attribute in the form and attempted another upload you will see in the log.txt file it should it is receiving multiple files but it throws a paperclip error which is also in the log.txt file https://gist.github.com/aliuk2012/d289da6a10b2e5f031428697af2294ad
[14:40:34] alaing: Paperclip::AdapterRegistry::NoHandlerError (No handler found for ["temp_attachment_array"
[14:40:57] blackmesa: has joined #RubyOnRails
[14:41:23] sevenseacat: cool, so you need to write your code to work with either an array or a single element. personally, I'd fix the view code to only do one or the other.
[14:41:26] GreekFreak: matthewd, so you're suggesting I run this query twice, once for sister_1_id and once for sister_2_id and then join the 2 resulting arrays? Correct? (I'm assuming I can't run a UNIFY in ruby unless I run a .execute method)
[14:41:43] DaniG2k: has joined #RubyOnRails
[14:42:37] alaing: sevenseacat: while the user could select one file or multiple files if they wanted too
[14:42:48] alaing: so not sure how to fix the view code
[14:43:01] eml: has left #RubyOnRails: ()
[14:43:12] lxsameer: has joined #RubyOnRails
[14:43:29] matthewd: GreekFreak: I'm suggesting you join to that subquery
[14:46:10] mikecmpbll: has joined #RubyOnRails
[14:47:25] GreekFreak: matthewd, sorry, I'm not following what you mean :/
[14:47:28] Fernando-Basso: has joined #RubyOnRails
[14:47:59] emachnic: has joined #RubyOnRails
[14:49:48] eml: has joined #RubyOnRails
[14:50:16] RegulationD: has joined #RubyOnRails
[14:50:39] eml: has left #RubyOnRails: ()
[14:51:11] triptec: has joined #RubyOnRails
[14:51:57] DragonPunch: has joined #RubyOnRails
[14:52:15] matthewd: GreekFreak: class Ship; def sisters; Ship.join('JOIN (SELECT sister_1_id, sister_2_id FROM vessels_sister_ships UNION ALL SELECT sister_2_id, sister_1_id FROM vessels_sister_ships) vessels_sister_ships ON vessels_ships.id = vessels_sister_ships.sister_2_id').where(sister_1_id: self); end; end; .... sister_ships = @parent_ship.sisters.includes(:names, :owner)
[14:54:10] roelof: has joined #RubyOnRails
[14:55:06] marr: has joined #RubyOnRails
[14:55:14] dopamean_: has joined #RubyOnRails
[14:55:56] roelof: Can someone help me with this problem : https://gist.github.com/rwobben/3f72bf598c05d443c9b0b3705abef105
[14:56:48] matthias_: has joined #RubyOnRails
[14:58:19] DaniG2k: roelof: Boekhouding doesn't link to anywhere
[14:58:26] DaniG2k: your a is missing an href
[14:59:07] DaniG2k: <a> should be <a href="someurl">
[14:59:39] smathy: has joined #RubyOnRails
[14:59:57] roelof: correct, boekhouding is the head menu. That one does not point to somewhere. When I click it it only have to take care that the submenu is shown
[15:00:24] DaniG2k: then you can't use click_link
[15:01:04] roelof: I need that because the submenu is hidden till I click on some head menu
[15:01:17] roelof: see : https://gist.github.com/rwobben/90d68770423d5ea845b1dfcf65b2bdce
[15:01:55] GreekFreak: matthewd, I didn't even THINK of doing it that way. Thank you!!!
[15:02:01] DaniG2k: roelof: this might help you
[15:02:01] DaniG2k: http://stackoverflow.com/questions/11269724/how-to-use-capybara-in-rspec-to-click-on-a-dropdown-option
[15:02:04] roelof: DaniG2k: what do I need then so I can check in a feature that a user clicks a submenu
[15:02:39] idefine: has joined #RubyOnRails
[15:02:41] startupality: has joined #RubyOnRails
[15:02:54] idefine: has joined #RubyOnRails
[15:03:05] roelof: DaniG2k: so I have to do something like this : page.find(:xpath, "//a[@href='/users/sign_out']").click
[15:04:37] DaniG2k: roelof: I don't know, try it :P
[15:05:20] disgrntld: has joined #RubyOnRails
[15:05:42] roelof: nope, maybe this template is not good for rails, Pity, another dashboard template which is not working :(
[15:06:40] universa1: roelof: first of all, for dropdowns to actually work in a feature test, you need to use something like phantomjs|poltergeist/capybara-webkit.
[15:07:17] roelof: universa1: this is not a dropdown but a menu with submenus
[15:07:27] kies: has joined #RubyOnRails
[15:07:27] universa1: roelof: because the default driver has zero interactivity.
[15:07:38] roelof: But if I need I have to use poltergeist
[15:07:55] universa1: roelof: show all relevant code....
[15:08:02] universa1: roelof: full menu for example...
[15:08:05] universa1: roelof: !gist-usage
[15:08:05] helpa: roelof: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[15:08:15] universa1: roelof: you should know "the drill" by now...
[15:08:33] acovrig: has joined #RubyOnRails
[15:08:39] roelof: yep, moment
[15:08:41] yfeldblum: has joined #RubyOnRails
[15:09:20] acovrig: given a route (from rake routes), how do I describe this in config/routes.rb? GET /users/:user_id/custom_name/:id
[15:09:44] universa1: acovrig: if rake routes prints that out, it is already in config/routes.rb
[15:10:56] acovrig: universa1: yes, in a rails 2.0.2 app I’m trying to upgrade to current...
[15:11:01] dionysus69: has joined #RubyOnRails
[15:11:12] matthewd: GreekFreak: You're welcome :)
[15:11:21] matthewd: GreekFreak: The answer to your original question, btw, is http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/Quoting.html#method-i-quote
[15:11:44] universa1: acovrig: well... since i guess custom_name is a fake one, it looks like nested resources: http://guides.rubyonrails.org/routing.html#nested-resources
[15:11:53] roelof: universa1: here you have all code from the view and the test : https://gist.github.com/rwobben/220c9d169d541afc8d6bffc94e81fdad
[15:12:35] ZiggyTheHamster: has joined #RubyOnRails
[15:12:53] universa1: roelof: this is a different test? where is the error? ...
[15:12:59] acovrig: universa1: yup, that’s it; thanks; I’ve used them before and I guess I’m a bit deer-in-the-headilghts’d about this foreign old code
[15:13:20] universa1: acovrig: yw :-)
[15:13:21] kali3: has joined #RubyOnRails
[15:13:22] roelof: universa1: I have to make this feature working
[15:13:42] universa1: roelof: so where does it brake now?
[15:13:47] universa1: roelof: https://gist.github.com/rwobben/220c9d169d541afc8d6bffc94e81fdad#file-input_data-rb-L7
[15:14:03] universa1: there is no link named like this.
[15:14:43] kdough: has joined #RubyOnRails
[15:14:44] roelof: moment, Im returning to the orginal code
[15:14:54] roelof: and I will update the gist
[15:15:04] universa1: roelof: and if you want to click on boekhouding, and that triggers the the child_menu to be displayed, this will not work with the default driver, you need "an actual browser" for that (selenium, capybara-webkit, phantomjs, ...)
[15:15:09] jhack: has joined #RubyOnRails
[15:16:10] JohnDotHR: Can someone check this out? I'm getting the error: undefined method `errors' for nil:NilClass
[15:16:18] JohnDotHR: https://gist.github.com/ivancernja/4bb1215fdb1c3da1eab9715fc12a7d39
[15:16:20] JohnDotHR: How can I fix it?
[15:16:29] universa1: JohnDotHR: !gist-usage
[15:16:29] helpa: JohnDotHR: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[15:16:41] universa1: JohnDotHR: bluntly spoken: do not call errors on nil.
[15:17:05] universa1: JohnDotHR: and then add the actual stacktrace to the gist.
[15:17:27] roelof: universa1: I updated the gist to the orginal code and adding the rspec error
[15:17:55] JohnDotHR: Fixed, thanks
[15:18:01] dionysus69: has joined #RubyOnRails
[15:18:07] universa1: roelof: so if you click on Boekhouding, this will trigger the submenu to be display via Javascript, right?
[15:18:41] universa1: roelof: ok, then you need to use another driver! examples of those: see above
[15:18:53] universa1: roelof: and then you need to sselect the correct element to click on.
[15:19:10] roelof: oke, so install poltergeist and work from there, right ? universa1
[15:19:18] universa1: roelof: sounds reasonable, yes.
[15:20:05] roelof: universa1: a off topic question : where do you come from. I wonder because you use via which is a Dutch word
[15:20:16] universa1: roelof: germany.
[15:20:33] roelof: and the correct item is still the boekhouding link ?
[15:20:44] roelof: oke, Im from the Netherlands
[15:21:19] marchelzo: has joined #RubyOnRails
[15:21:41] universa1: roelof: so you want to first click on the boekhouding thing, it looks like capybara can not directly find it using the click_link helper, so you have to select the element in a different way and call click on it
[15:22:02] universa1: should work, haven't done much with capybara, etc... lately
[15:22:39] universa1: roelof: this will then show you the submenu, and then you can click one of those things in there, because by default capybara only "finds" visible things (iirc)
[15:22:44] universa1: and with that i'm out ;)
[15:22:57] roelof: yep, otherwise I cannot find the new rekening schema link, That is hidden till someone clicks on the Boekhouding link
[15:23:28] roelof: yep, that is what I try to do
[15:24:02] roelof: first click on boekhouding, so rekening schema will be visible and I can click on that
[15:24:12] [Butch]: has joined #RubyOnRails
[15:24:16] roamingdog: has joined #RubyOnRails
[15:25:05] [Butch]_: has joined #RubyOnRails
[15:25:34] roelof: universa1: thanks, now time for dinner and then I hope I can make this feature work
[15:25:50] roelof: sometimes working with rails is hard work as a beginner
[15:29:04] sypheren: has joined #RubyOnRails
[15:35:23] startupality: has joined #RubyOnRails
[15:37:32] Scient: anyone here ran into trying to set cookies across all subdomains for a short domain, like xx.yy ?
[15:37:36] Scient: and specifically issues with IE... yay
[15:38:37] artto: has joined #RubyOnRails
[15:41:13] roelof: universa1: I added poltergeist and still boekhouding cannot be found
[15:41:38] davidw: has joined #RubyOnRails
[15:42:17] roelof: I think I have to use something else then click_link because boekhouding is not really a link like < a href > but only a <a >
[15:43:53] artto: has joined #RubyOnRails
[15:44:23] ducklobster: has joined #RubyOnRails
[15:45:25] triptec: has joined #RubyOnRails
[15:46:08] jhack: has joined #RubyOnRails
[15:48:35] pawnbox: has joined #RubyOnRails
[15:49:47] yfeldblum: has joined #RubyOnRails
[15:50:36] jhack: has joined #RubyOnRails
[15:51:59] matthias_: has joined #RubyOnRails
[15:53:23] artto: has joined #RubyOnRails
[15:54:05] norc: has joined #RubyOnRails
[15:57:56] pawnbox: has joined #RubyOnRails
[16:00:16] RegulationD: has joined #RubyOnRails
[16:01:18] roelof: pff, what Is wrong here ; find (:css , '#foo').click I see this error message : syntax error, unexpected ',', expecting ')' (SyntaxError)
[16:03:32] Cohedrin: has joined #RubyOnRails
[16:03:34] idefine: has joined #RubyOnRails
[16:05:38] FCser: has joined #RubyOnRails
[16:06:26] matthewd: roelof: Remove the space before the (
[16:06:58] FCser: has joined #RubyOnRails
[16:08:04] roelof: matthewd: thanks, the #foo is the div , or can I also use the text of the <a> tag
[16:09:10] roelof: I want to use this code for the click : <a> <i class="fa fa-edit"></i>Boekhouding<span class="fa fa-chevron-down"></span> </a>
[16:09:24] nettoweb: has joined #RubyOnRails
[16:11:33] barhum2013: has joined #RubyOnRails
[16:19:30] tgeeky: has joined #RubyOnRails
[16:19:39] moeabdol2: has joined #RubyOnRails
[16:21:24] Coldblackice: has joined #RubyOnRails
[16:22:28] ZiggyTheHamster: has joined #RubyOnRails
[16:23:57] RegulationD: has joined #RubyOnRails
[16:26:04] shinnya: has joined #RubyOnRails
[16:26:50] jancel: has joined #RubyOnRails
[16:28:14] blackmesa: has joined #RubyOnRails
[16:28:49] [Butch]: has joined #RubyOnRails
[16:29:01] Fernando-Basso: has joined #RubyOnRails
[16:29:08] polishdub: has joined #RubyOnRails
[16:30:43] yellow5: has joined #RubyOnRails
[16:32:14] zave: has joined #RubyOnRails
[16:37:45] sid_fules: has joined #RubyOnRails
[16:39:03] m_antis: has joined #RubyOnRails
[16:39:37] triptec: has joined #RubyOnRails
[16:40:28] sneakerhax: has joined #RubyOnRails
[16:42:33] Devalo: has joined #RubyOnRails
[16:45:06] moeabdol: has joined #RubyOnRails
[16:46:52] manfrin: has joined #RubyOnRails
[16:48:12] jhack: has joined #RubyOnRails
[16:48:25] nettoweb: has joined #RubyOnRails
[16:50:49] douglascorrea: has joined #RubyOnRails
[16:54:11] flashpoint9: has joined #RubyOnRails
[16:54:22] triptec: has joined #RubyOnRails
[16:54:44] hahuang61: has joined #RubyOnRails
[16:55:02] GodFather: has joined #RubyOnRails
[16:55:20] startupality: has joined #RubyOnRails
[16:56:55] SteenJobs: has joined #RubyOnRails
[16:57:18] barhum2013: has joined #RubyOnRails
[16:59:30] aegis3121: has joined #RubyOnRails
[17:03:13] idefine: has joined #RubyOnRails
[17:03:58] mikecmpbll: has joined #RubyOnRails
[17:04:46] manfrin: has joined #RubyOnRails
[17:04:55] pramodv: has joined #RubyOnRails
[17:06:16] noah256: has joined #RubyOnRails
[17:07:08] roamingdog: has joined #RubyOnRails
[17:08:12] qejk: has joined #RubyOnRails
[17:08:29] zave: has joined #RubyOnRails
[17:09:11] barhum2013: has joined #RubyOnRails
[17:10:24] idefine: has joined #RubyOnRails
[17:12:56] blackmesa: has joined #RubyOnRails
[17:13:14] djbkd: has joined #RubyOnRails
[17:13:33] artto: has joined #RubyOnRails
[17:15:28] djbkd: has joined #RubyOnRails
[17:16:03] tenderlove: has joined #RubyOnRails
[17:19:47] DoctorMonocular: has joined #RubyOnRails
[17:19:57] ruby-nooby: has joined #RubyOnRails
[17:21:32] startupality: has joined #RubyOnRails
[17:21:34] braincrash: has joined #RubyOnRails
[17:22:22] ruby-nooby: Subscription has_many subscribers? Or Subscription.subscribers = [Serialized array of subscribers]. Using postgres on heroku
[17:22:46] ruby-nooby: if theres no straight answers, pros / cons of each?
[17:23:19] barhum2013: has joined #RubyOnRails
[17:24:17] dgncn: has joined #RubyOnRails
[17:24:30] cnk: has joined #RubyOnRails
[17:27:59] jenrzzz: has joined #RubyOnRails
[17:28:24] sid_fules: has joined #RubyOnRails
[17:30:10] syndikate: has joined #RubyOnRails
[17:30:23] norc: ruby-nooby, arrays don't scale too well on postgres
[17:34:42] ruby-nooby: hmm this is a weird relation im making
[17:35:11] ruby-nooby: im making a platform where users can create subscription services, but also subscribe to the services of others
[17:35:19] skroon: has joined #RubyOnRails
[17:35:33] ruby-nooby: so a user has one subscription (the one he can create), but a subscription has_many users
[17:35:48] ruby-nooby: and a user can also be subscribed to multiple subscriptions
[17:36:06] hahuang61: has joined #RubyOnRails
[17:36:12] ruby-nooby: maybe i should add a third model, call it subscriber?
[17:38:26] jhack: has joined #RubyOnRails
[17:39:06] triptec: has joined #RubyOnRails
[17:42:37] RegulationD: has joined #RubyOnRails
[17:44:27] FCser: has joined #RubyOnRails
[17:49:18] sid_fules: has joined #RubyOnRails
[17:52:31] cnk: ruby-nooby: seems odd to me that a user should be limited to creating a single subscription service
[17:52:49] sid_fules: has joined #RubyOnRails
[17:53:13] cnk: I think you need 3 models: user, services, and subscrirptions to map between them
[17:53:28] cnk: and a service should belong to a user
[17:55:03] chouhoulis: has joined #RubyOnRails
[17:55:18] chouhoulis: has joined #RubyOnRails
[17:56:17] chouhoulis: has joined #RubyOnRails
[17:56:57] sid_fules: has joined #RubyOnRails
[18:00:36] euphoriaa: has joined #RubyOnRails
[18:00:37] euphoriaa: has joined #RubyOnRails
[18:00:37] confounds: has joined #RubyOnRails
[18:01:24] datanoise: has joined #RubyOnRails
[18:02:51] chrisja: has joined #RubyOnRails
[18:02:56] idefine: has joined #RubyOnRails
[18:03:29] polishdub: has joined #RubyOnRails
[18:06:12] barhum2013: has joined #RubyOnRails
[18:07:37] mikecmpbll: has joined #RubyOnRails
[18:08:00] Fernando-Basso: has joined #RubyOnRails
[18:09:59] confounds: has joined #RubyOnRails
[18:10:04] djbkd: has joined #RubyOnRails
[18:12:00] m_antis: has joined #RubyOnRails
[18:12:10] blackmesa: has joined #RubyOnRails
[18:12:40] infinitone: has joined #RubyOnRails
[18:13:44] DoctorMonocular: has joined #RubyOnRails
[18:16:02] pawnbox: has joined #RubyOnRails
[18:16:29] RegulationD: has joined #RubyOnRails
[18:18:02] IFrank00: has joined #RubyOnRails
[18:18:34] IFrank004: has joined #RubyOnRails
[18:20:30] confounds: has joined #RubyOnRails
[18:23:30] blackmesa: has joined #RubyOnRails
[18:24:23] Dimik: has joined #RubyOnRails
[18:26:04] artto: has joined #RubyOnRails
[18:27:08] syndikate: has joined #RubyOnRails
[18:30:05] thorgi: has joined #RubyOnRails
[18:30:43] kies: has joined #RubyOnRails
[18:31:38] diegoaguilar: has joined #RubyOnRails
[18:33:07] allcentury: has joined #RubyOnRails
[18:34:46] allcentury: Bundler question, is there a way to do `bundle list` for ONLY what's in my Gemfile for a given repo?
[18:36:40] dopie: has joined #RubyOnRails
[18:36:54] Axy: has joined #RubyOnRails
[18:38:15] mikecmpbll: has joined #RubyOnRails
[18:38:16] k3rn31: has joined #RubyOnRails
[18:39:39] beingjohnm: anybody else having trouble with rails console connecting to heroku?
[18:41:15] futilegames: has joined #RubyOnRails
[18:42:51] smathy: allcentury, you mean to not show dependencies?
[18:43:18] allcentury: smathy: i just realized bundle list IS scoped to my gemfile, :: face palm ::
[18:44:45] tubbo: works on my machiine
[18:45:31] beingjohnm: seems to not connect, then ctrl+c, try again, and it connects for a bit.
[18:45:32] nurey_: has joined #RubyOnRails
[18:47:22] gheegh: has joined #RubyOnRails
[18:48:18] sid_fules: has joined #RubyOnRails
[18:50:55] desnudop1nguino: has joined #RubyOnRails
[18:52:04] dionysus69: has joined #RubyOnRails
[18:53:04] desnudop1nguino: I'm trying to build a relationship between three models. both user and photo have many photo ratings, but each user can only have one rating per photo. Is there a way to validate this that is build into rails, or do I have to write a custom function?
[18:54:16] triptec: has joined #RubyOnRails
[18:54:30] aegis3121: has joined #RubyOnRails
[18:55:13] pipework: desnudop1nguino: !validations
[18:55:13] helpa: desnudop1nguino: The Active Record Validations Guide - http://guides.rubyonrails.org/active_record_validations.html - Written by Jaime Iniesta
[18:58:19] jmg_: has joined #RubyOnRails
[18:58:20] blackmesa: has joined #RubyOnRails
[19:02:01] Devalo: has joined #RubyOnRails
[19:02:10] jenrzzz: has joined #RubyOnRails
[19:03:05] sid_fules: has joined #RubyOnRails
[19:03:07] dopie: wow just changed to mina instead of capistrano and it rocks
[19:04:02] i: has joined #RubyOnRails
[19:04:18] artto: has joined #RubyOnRails
[19:04:23] dopie: has joined #RubyOnRails
[19:04:59] SteenJobs: has joined #RubyOnRails
[19:05:42] jstransky: has joined #RubyOnRails
[19:06:33] FCser: has joined #RubyOnRails
[19:07:51] desnudop1nguino: pipework: thanks, just what I needed
[19:08:34] pawnbox: has joined #RubyOnRails
[19:11:41] DoctorMonocular: has joined #RubyOnRails
[19:13:19] jancel: has joined #RubyOnRails
[19:17:34] Wobni: has joined #RubyOnRails
[19:19:05] idefine: has joined #RubyOnRails
[19:19:23] confounds: has joined #RubyOnRails
[19:19:40] hahuang61: has joined #RubyOnRails
[19:23:11] RegulationD: has joined #RubyOnRails
[19:24:43] Pupeno: has joined #RubyOnRails
[19:24:47] lightt: has joined #RubyOnRails
[19:26:05] Darmani: Hi guys, in my rails app I wanted to show a log of all the comments a user has ever made.
[19:26:07] Darmani: https://gist.github.com/mfifth/0777d77769a2fc342e45d50b756a878f
[19:26:38] Darmani: I don't think this is right but could someone point me in the right direction?
[19:26:39] grvgr: has joined #RubyOnRails
[19:27:29] sandstrom: has joined #RubyOnRails
[19:28:00] tbuehlmann: Darmani: what does not work?
[19:28:42] Darmani: tbuehlmann: sorry I forgot to post the error
[19:28:46] Darmani: https://gist.github.com/mfifth/0777d77769a2fc342e45d50b756a878f
[19:29:09] czerasz: has joined #RubyOnRails
[19:29:10] tbuehlmann: your comments table misses an user_id column
[19:29:22] norc: Darmani, did you perhaps forget to run your migrations? :)
[19:29:26] nettoweb: has joined #RubyOnRails
[19:30:08] Darmani: norc: I never made the migration file D:
[19:30:11] Darmani: i forgots.
[19:30:22] mikecmpbll: has joined #RubyOnRails
[19:30:36] Darmani: tbuehlmann: lemme try that.
[19:32:12] triptec: has joined #RubyOnRails
[19:32:47] lightt: has joined #RubyOnRails
[19:34:30] Darmani: I already have my comments linked to users through an "author" variable. Can I possibly use that?
[19:34:31] Darmani: https://gist.github.com/mfifth/0777d77769a2fc342e45d50b756a878f
[19:34:51] njero: has joined #RubyOnRails
[19:35:06] confounds: has joined #RubyOnRails
[19:35:07] mikecmpbll: remember the tip about gist file names?
[19:35:32] tbuehlmann: Darmani: you need to tell the has_many what column to use
[19:35:43] tbuehlmann: so yes, you can use that author_id column
[19:36:16] Darmani: mikecmpbll: So name each file exactly what it is? Like show.html.erb?
[19:36:29] Darmani: tbuehlmann: hmm. okay lemme try.
[19:36:30] mikecmpbll: Darmani : yep!
[19:37:45] djbkd: has joined #RubyOnRails
[19:38:16] tbuehlmann: see http://guides.rubyonrails.org/association_basics.html#options-for-has-many-foreign-key
[19:38:25] Darmani: tbuehlmann https://gist.github.com/mfifth/0777d77769a2fc342e45d50b756a878f
[19:38:26] alfiemax: has joined #RubyOnRails
[19:38:52] Darmani: tbuehlmann: ohh like that..
[19:39:41] Macaveli: has joined #RubyOnRails
[19:41:01] Darmani: tbuehlmann https://gist.github.com/mfifth/0777d77769a2fc342e45d50b756a878f
[19:41:03] Darmani: like that?
[19:41:24] tbuehlmann: no, check the guides section again
[19:41:55] Darmani: tbuehlmann: Does it have to be a string or something..??
[19:42:00] confounds: has joined #RubyOnRails
[19:42:05] tbuehlmann: what does the guide section say?
[19:42:37] mikecmpbll: unless you've defined author_id somewhere :p
[19:43:02] Darmani: tbuehlmann: it says you can define the foreign key directly but you still have to create and run the migration...
[19:43:18] swaaws: has joined #RubyOnRails
[19:43:36] swaaws: i hav a problem see: https://gist.github.com/swaaws/8ca63589268db78a41d951139bae1fe7
[19:43:54] swaaws: im using devise 4.0.0
[19:44:01] artto: has joined #RubyOnRails
[19:44:28] Synthead: has joined #RubyOnRails
[19:44:45] mikecmpbll: swaaws : arrays don't have a method called `permit`.
[19:45:30] Darmani: I still don't get it
[19:45:33] Darmani: ACTION sighs
[19:46:18] sid_fules: has joined #RubyOnRails
[19:46:22] mikecmpbll: Darmani : what is author_id ? https://gist.github.com/mfifth/0777d77769a2fc342e45d50b756a878f#file-user-rb-L2
[19:46:37] mikecmpbll: if you put a bunch of letters and stuff next to eachother in ruby, ruby expects it to be a variable or a method.
[19:47:14] artto_: has joined #RubyOnRails
[19:47:22] mikecmpbll: the foreign_key option expects you to pass it the name of the column which holds the foreign key for the association
[19:47:57] swaaws: mikecmpbll: there is a way to find out which controller that is in the defined?
[19:48:22] DoctorMonocular: has joined #RubyOnRails
[19:48:33] Darmani: mikecmpbll: gotcha..
[19:49:15] mikecmpbll: swaaws : seems to be a problem with your parameters https://gist.github.com/swaaws/8ca63589268db78a41d951139bae1fe7#file-gistfile1-txt-L13
[19:49:28] mikecmpbll: so, take a look at your form
[19:50:27] roamingdog: has joined #RubyOnRails
[19:53:01] GodFather: has joined #RubyOnRails
[19:53:15] eljimbo: has joined #RubyOnRails
[19:53:41] Darmani: mikecmpbll https://gist.github.com/mfifth/0777d77769a2fc342e45d50b756a878f
[19:53:57] tbuehlmann: does it work with that?
[19:55:22] Darmani: Well I'm not sure, I'm still trying to figure out how to use write the code for the view..
[19:55:38] norc: Darmani, restarting your rails application could be necessary if you change your database model.
[19:55:50] norc: (It definitely is with some database adapters like oracle)
[19:55:54] frem_: has joined #RubyOnRails
[19:56:17] Darmani: norc: roger that
[19:56:32] GodFather: has joined #RubyOnRails
[19:56:33] norc: Darmani, also make sure that your web server is running against the same database (environment, db/database.yml) that you ran the migration against.
[19:57:31] meoblast001: has joined #RubyOnRails
[19:58:48] sid_fules: has joined #RubyOnRails
[19:58:51] scepticulous: has joined #RubyOnRails
[19:59:27] diegoaguilar: has joined #RubyOnRails
[19:59:40] jhack: has joined #RubyOnRails
[20:00:33] diegoaguilar: has joined #RubyOnRails
[20:02:27] srinidhi: has joined #RubyOnRails
[20:03:15] barhum2013: has joined #RubyOnRails
[20:03:19] sid_fules: has joined #RubyOnRails
[20:07:12] blackmesa: has joined #RubyOnRails
[20:11:08] DoctorMonocular: has joined #RubyOnRails
[20:11:10] Darmani: i got it to work.
[20:11:14] Darmani: You are all lovely people.
[20:11:27] haaj: has joined #RubyOnRails
[20:11:48] GodFather: has joined #RubyOnRails
[20:13:01] jstransky: has joined #RubyOnRails
[20:13:24] Darmani: tbuehlmann: That article was really helpful dude.
[20:13:37] artto: has joined #RubyOnRails
[20:14:00] arup_r: has joined #RubyOnRails
[20:14:48] arup_r: I am trying to run my validation only on this :commission_update context, why then it is validating others also? https://gist.github.com/aruprakshit/14ddf3547e11393c246506b22b8743b0
[20:15:25] GodFather: has joined #RubyOnRails
[20:15:38] artto_: has joined #RubyOnRails
[20:16:39] cnk: has joined #RubyOnRails
[20:16:47] lightt: has joined #RubyOnRails
[20:19:19] scepticulous: has joined #RubyOnRails
[20:20:19] Devalo: has joined #RubyOnRails
[20:20:32] tbuehlmann: arup_r: validations without a given context run everytime
[20:21:37] arup_r: but I read like *If the argument is false (default is nil), the context is set to :create if new_record? is true, and to :update if it is not*
[20:21:52] arup_r: it is from valid? documentation
[20:22:02] arup_r: for me I passed argument.
[20:22:14] arup_r: http://api.rubyonrails.org/classes/ActiveRecord/Validations.html#method-i-valid-3F
[20:22:32] arup_r: ok got it
[20:23:22] arup_r: I missed this line *Validations with no :on option will run no matter the context.*.. Well now I am in trouble. I want to run only context specific validations
[20:23:36] arup_r: So any other tricks if u want to share
[20:26:16] marchelzo: has joined #RubyOnRails
[20:26:36] lxsameer: has joined #RubyOnRails
[20:26:51] nurey: has joined #RubyOnRails
[20:27:01] tildes_: has joined #RubyOnRails
[20:28:24] Darmani: For some reason my partial isn't rendering on the page :[
[20:28:26] Darmani: https://gist.github.com/mfifth/2314cd9a57b97bf4b6e2e7fbe1fb8e04
[20:28:29] Darmani: Could someone tell me why?
[20:28:44] artto: has joined #RubyOnRails
[20:28:44] triptec: has joined #RubyOnRails
[20:29:20] theunraveler: has joined #RubyOnRails
[20:30:14] arup_r: Darmani: in which folder you have the partial relative to views/ folder?
[20:30:40] jenrzzz: has joined #RubyOnRails
[20:31:07] Darmani: arup_r: In my users folder
[20:31:38] arup_r: ok, and where is the view from where you are trying to render the partial?
[20:32:03] nurey: has left #RubyOnRails: ()
[20:32:11] mikecmpbll: Darmani : what are you expecting to render when you call render @user.comments ?
[20:32:36] norc: Darmani, app/views/admin/comments/_comment.html.erb - do you have a file under that path?
[20:32:57] Darmani: arup_r: The view is in the same folder o.o
[20:33:17] mikecmpbll: all the information you need is in the error message
[20:33:29] mikecmpbll: tells you exactly what file it's looking for and where :)
[20:33:35] norc: We should spend less time helping people fix problems and focus more on teaching people understand error messages and stack traces.
[20:33:38] weaksauce: has joined #RubyOnRails
[20:33:46] norc: Damn people might become self-dependent.
[20:33:48] norc: Crazy thoguht.
[20:34:08] arup_r: ok show.html.erb is inside which folder relative to views/ ?
[20:34:13] mikecmpbll: they'll either take to substance abuse, or figure it out eventually.
[20:34:39] mikecmpbll: there's only so long you can go on trying to solve problems by random guessing. :p
[20:34:49] dgynn: has joined #RubyOnRails
[20:35:12] todd: has joined #RubyOnRails
[20:35:14] arup_r: Darmani: continue to answer my questions.. plz
[20:35:18] DoubleMalt: has joined #RubyOnRails
[20:35:34] Darmani: arup_r: the show file is inside admin/users folder o.o
[20:35:35] arup_r: lets see if I can help you to connect those erros
[20:35:49] arup_r: so u got the point..
[20:36:24] Darmani: arup_r: Well kinda... The error says I'm missing a comments folder inside the admin folder but I don't get why that's necessary..
[20:36:30] RegulationD: has joined #RubyOnRails
[20:36:31] Darmani: or maybe I'm just not understanding the error.
[20:36:47] mikecmpbll: Darmani : the error is telling you exactly where to put your _comment.html.erb view.
[20:37:04] arup_r: yes, or mention it by hand
[20:37:14] netzfisch: has joined #RubyOnRails
[20:37:25] arup_r: like <%= render partial: "go/find/here:, collection: @user.comments %>
[20:37:26] Darmani: mikecmpbll: So I have to create an empty comments folder within my admin folder just to place a partial??
[20:37:35] kies: has joined #RubyOnRails
[20:37:40] mikecmpbll: it's not empty if you put a partial in it?
[20:37:47] Darmani: arup_r: oh that's cool. I didn't know you could do that.
[20:38:07] arup_r: Darmani: You learned shortcut first, that is the problem.. haha
[20:38:16] mikecmpbll: a partial to render a comment, belongs with the comments views
[20:38:17] norc: mikecmpbll, hah
[20:38:34] Darmani: mikecmpbll: yep I guess it does apparently..
[20:38:42] mikecmpbll: don't fight the system.
[20:38:57] arup_r: If you slightly go away from rails convention, you have to take the responsibility to tell it.
[20:39:17] Darmani: Lol okay okay
[20:40:01] Darmani: well it works now.
[20:40:09] Darmani: I still don't get why that's necessary.
[20:40:42] Darmani: Would it be better to not write a partial then? Instead of create a new folder with one file in it?
[20:40:45] mikecmpbll: how do you expect rails to know how to find the partial to render a comment?
[20:40:56] audy: has joined #RubyOnRails
[20:41:08] mikecmpbll: you've passed a bunch of Comment objects to the `render` method, it has to find the partial to render each Comment with
[20:41:12] audy: can I delete a method to another model's method of a different name?
[20:41:15] mikecmpbll: so .. it looks in the views/comments directory
[20:41:17] audy: s/delete/delegate/*
[20:41:37] mikecmpbll: it seems not only sensible, but obvious.
[20:41:47] norc: audy, yes. What are you trying to do?
[20:42:10] audy: norc delegate Foo.target do Bar.strain
[20:42:42] norc: audy, is Bar.strain a class method?
[20:42:53] Darmani: mikecmpbll: I thought it would simply see the name of the partial and use the file with the similar name.
[20:42:57] audy: norc Bar#strain. It's an instance method. An ActiveRecord column
[20:43:07] mikecmpbll: Darmani : see the name of what partial?
[20:43:14] norc: audy, then what you ask for does not make much sense.
[20:43:18] arup_r: audy: Foo and Bar has a relationship ?
[20:43:19] sid_fules: has joined #RubyOnRails
[20:43:24] audy: norc arup_r Foo belongs to Bar
[20:43:28] Darmani: _comment.html.erb o.o
[20:43:30] mikecmpbll: Darmani : that made no sense. remember, you have to get from `render @comments`, to find the partial
[20:43:31] norc: arup_r, then its not delegation.
[20:43:38] FCser: has joined #RubyOnRails
[20:43:41] mikecmpbll: you've not told it the name of the partial, how can it "see the name of the partial"?
[20:44:09] Darmani: mikecmpbll: Lol maybe I don't understand how Rails finds files
[20:44:25] mikecmpbll: how do you presume it happens?
[20:44:26] jancel: has joined #RubyOnRails
[20:44:46] Darmani: what does it matter I'm wrong lol
[20:44:48] norc: audy, still. What is your goal?
[20:45:01] Darmani: Is there a good article for that particular subject?
[20:45:08] mikecmpbll: Darmani : i'm just trying to understand what you thought rails was doing
[20:45:13] mikecmpbll: or how it should do it :)
[20:45:25] norc: audy, why do you want it inside your Foo class?
[20:45:44] norc: audy, after all you placed the attribute into Bar, so it does not describe Foo.
[20:46:05] audy: norc it does. Foo and Bar have a 1:1 relationship.
[20:46:13] Darmani: mikecmpbll: Let me ask you this.
[20:46:15] lightt: has joined #RubyOnRails
[20:46:21] arup_r: norc: is true
[20:46:23] norc: audy, what prevents you from using foo.bar.attribute?
[20:46:27] arBmind: has joined #RubyOnRails
[20:46:42] audy: norc I could but then I would have to rewrite a bunch of code in my application which I am trying to avoid
[20:46:51] Darmani: mikecmpbll: What exactly is happening when the render is called within the view? https://gist.github.com/mfifth/2314cd9a57b97bf4b6e2e7fbe1fb8e04
[20:47:41] norc: audy, if you insist you could simply use Module#delegate, Delegator, a hand written wrapper method
[20:47:46] mikecmpbll: Darmani : the render method, from the view, can do a whole lot of stuff. it has a pretty wide API. in your instance however, you're passing it Active Record objects (instances of Comment, in this case)
[20:48:02] audy: norc I was trying to use delegate. The problem is that the column in Foo has a different name than in Bar.
[20:48:08] norc: audy, delegate inside your decorator, or refactor the code.
[20:48:26] mikecmpbll: rails detects it's been passed AR objects and for each object it looks at the class, then looks for the corresponding partial for that object
[20:48:29] universa1: def foo; bar.muh; end ?!
[20:48:48] norc: universa1, shhh!
[20:48:57] mikecmpbll: the corresponding partial, by default, is a partial in app/<model name plural>/_<model name>.html.erb
[20:48:58] universa1: norc: sorry ;)
[20:49:38] arup_r: audy: https://gist.github.com/aruprakshit/384853c8e1bb4d50efb27bb341b2874c
[20:49:54] Darmani: mikecmpbll: Ah so that's how it works.
[20:50:06] arup_r: I am still thinking if it right or not. I got confused in the middle of writing.. lol
[20:50:37] mikecmpbll: Darmani : also, it's not an accident, or the fact that i'm a genius, that i know that. i know that because like most things about rails it's rather nicely explained in the guides :) http://guides.rubyonrails.org/layouts_and_rendering.html#using-partials
[20:50:49] mikecmpbll: (am still a genius tho)
[20:51:00] Darmani: mikecmpbll: lmao he's humble too
[20:51:16] mikecmpbll: i aim to inspire.
[20:54:15] jancel: has joined #RubyOnRails
[20:54:29] audy: arup_r ah thanks. I was trying to do it backwards
[20:55:18] norc: mikecmpbll, I was so surprised when I learned how simple Rack was. But that took me looking at the source, Luke. :S
[20:55:24] norc: No guide explained *that* to me.
[20:55:50] mikecmpbll: good to have that in your repertoire too
[20:56:10] mikecmpbll: a lot of people when they turn up nothing on the ol' google, give up.
[20:56:28] mikecmpbll: half the time these days i go to the source before google, can be quicker.
[20:56:56] srinidhi: has joined #RubyOnRails
[20:57:26] ur5us: has joined #RubyOnRails
[20:59:58] Pupeno: has joined #RubyOnRails
[21:01:39] audy: has left #RubyOnRails: ("bye")
[21:02:10] sandstrom: has joined #RubyOnRails
[21:04:49] drale2k: How would you handle it when you have a chat with multiple rooms where you can give people access to rooms, for a room you give someone access to, to appear on their UI
[21:05:07] drale2k: without going full client / JS MVC
[21:05:21] jenrzzz_: has joined #RubyOnRails
[21:06:13] sid_fules: has joined #RubyOnRails
[21:06:18] bruce_lee: has joined #RubyOnRails
[21:06:18] bruce_lee: has joined #RubyOnRails
[21:08:00] mikecmpbll: drale2k : @user.rooms ... i don't really understand the question :D
[21:08:23] drale2k: mikecmpbll: if he is looking already at the chat, how to update the UI :)
[21:08:30] drale2k: not after a reload, which is clear
[21:09:02] drale2k: you are looking at the chat, i give you access to a new room and want the new room to appear on your Chat UI in a sidebar inside a list of rooms
[21:10:37] edwinvdgraaf: has joined #RubyOnRails
[21:10:39] mikecmpbll: if you're implementing a chat thing you'll probably want to look at websockets and the sort.
[21:10:41] aegis3121: Sounds like web sockets or action cable, off hand
[21:10:55] drale2k: i am using ActionCable for the single room i currently have
[21:11:03] drale2k: now i want to add support for multiple rooms
[21:11:25] roamingdog: has joined #RubyOnRails
[21:11:52] drale2k: should i push a <li class="room"> element down the socket ?
[21:12:10] eljimmy: has joined #RubyOnRails
[21:12:12] drale2k: that doesn't work if the user has no inernet at that moment
[21:12:45] mikecmpbll: how are you going to communicate with a user who has no internet?
[21:12:50] mikecmpbll: send a pigeon, perhaps.
[21:12:59] drale2k: is my wuestion really that hard?
[21:13:02] drale2k: a simple question
[21:13:13] drale2k: when he comes back up i am gonna communicae with him, that's how
[21:13:21] edwinvdgraaf: has joined #RubyOnRails
[21:14:07] mikecmpbll: can't you do that with actioncable?
[21:14:13] mikecmpbll: i don't have much experience of it yet.
[21:14:24] Pupeno: has joined #RubyOnRails
[21:14:26] drale2k: you chat, you close your macbook without closing the wbesite, you comeback later and when you get a connection the UI should update
[21:14:54] drale2k: well with ActionCable you can push down a command but if he is not online at that moment he will not get it
[21:15:47] idefine: has joined #RubyOnRails
[21:16:02] drale2k: in my case it's even worse because it's a native mac app with a WebView and Apps typically never get closed
[21:16:13] drale2k: can't rely on them reloading the page
[21:16:20] edwinvdg_: has joined #RubyOnRails
[21:16:55] mikecmpbll: probably beyond my knowledge of websockets and actioncable, this.
[21:17:16] mikecmpbll: if the user loses connection, what happens to the web socket when they regain connection?
[21:17:31] mikecmpbll: maybe you need some kind of heartbeat.
[21:17:51] mikecmpbll: anyway, like i say, bit outside my knowledge so i'll stop stabbing around in the dark :)
[21:18:44] drale2k: then they reconnect and it triggers a reconnect which you can use but then you would have to store the command in a db and send it after they reconnect meh, way too overkill
[21:18:52] drale2k: thanks anyway
[21:18:58] smathy: drale2k, look at broadcasting, you want to broadcast the list of channels whenever the channels change, and whenever someone connects.
[21:19:13] edwinvdg_: has joined #RubyOnRails
[21:19:25] drale2k: smathy: yes but what do you do if the person is not online at that time
[21:19:38] smathy: What I just said accounts for that too.
[21:20:08] drale2k: hm k i see
[21:20:19] drale2k: so on every connect you push them down
[21:20:24] drale2k: sounds good
[21:20:27] mikecmpbll: sounds good to me too.
[21:21:10] smathy: Yep, connect or reconnect. Np.
[21:21:22] drale2k: next: authorization with ActionCable :O
[21:21:33] drale2k: gonna google on that first
[21:21:36] smathy: I'd just send the list and build the HTML with jquery - FWIW.
[21:22:31] smathy: drale2k, the guides: http://edgeguides.rubyonrails.org/action_cable_overview.html and the example app: https://github.com/rails/actioncable-examples both have auth examples.
[21:23:14] drale2k: i think they only have authentication, gonna take another look
[21:25:16] roamingdog: has joined #RubyOnRails
[21:25:37] artto: has joined #RubyOnRails
[21:26:35] drale2k: smathy: ok ye they have just "is this user signed in or not" but they broadcast to all signed in users
[21:27:10] drale2k: i need something like "only broadcast this messages to users who have access to this channel" kind of thing
[21:28:21] DanByc: has joined #RubyOnRails
[21:28:21] jenrzzz: has joined #RubyOnRails
[21:28:26] DanByc: hello all
[21:28:36] smathy: Oh sorry, I didn't read properly. Authorization isn't anything to do with action cable though, you'll do that server side before deciding which list of channels to broadcast to which users.
[21:29:27] DanByc: Radar thanks again for hooking me up with the Ruby on Rails tutorial, it is very helpful
[21:29:53] davidw: has joined #RubyOnRails
[21:31:42] workmad3: has joined #RubyOnRails
[21:32:36] Pumukel: has joined #RubyOnRails
[21:37:33] datanoise: has joined #RubyOnRails
[21:41:25] havenwood: modalo: 1 test, 1 assertions, 0 failures, 0 errors, 0 skips
[21:42:21] roamingdog: has joined #RubyOnRails
[21:43:05] IFrank004: has joined #RubyOnRails
[21:43:07] IFrank00: has joined #RubyOnRails
[21:44:56] acovrig: has joined #RubyOnRails
[21:45:32] sypheren: has joined #RubyOnRails
[21:46:13] acovrig: I have contact and address models, when a users POSTs (json) I’m thinking Address.new(params) and params.require(:address).require(:street, :city, :state); I’m getting a forbidden attributes error, any ideas why?
[21:47:37] norc: acovrig, do you think anyone can deduce anything from what you have written?
[21:47:45] norc: acovrig, gist code and logs.
[21:48:32] lightt: has joined #RubyOnRails
[21:49:02] Guest6988: has joined #RubyOnRails
[21:49:33] acovrig: norc: https://gist.github.com/acovrig/19bbdd855fc76f4efaf1e2b67b38b8f1
[21:50:01] Pupeno: has joined #RubyOnRails
[21:50:09] norc: acovrig, still missing logs.
[21:50:16] smathy: acovrig, you realize that only the second statement will be the return value of `contact_params` ?
[21:50:33] zave: has joined #RubyOnRails
[21:51:01] acovrig: norc: gist updated
[21:51:10] acovrig: smathy: how do I do multiple params then?
[21:51:32] smathy: acovrig, also, you should actually be getting an ArgumentError.
[21:52:20] acovrig: smathy: why?
[21:53:11] sid_fules: has joined #RubyOnRails
[21:53:30] smathy: acovrig, because `require` only takes one argument.
[21:54:02] smathy: acovrig, anyway, read about nested forms: http://guides.rubyonrails.org/form_helpers.html#nested-forms
[21:54:50] desnudop1nguino: I'm pulling user profile data from a comment view with (comment.user.profile). I am getting undefined method errors for fields that aren't populated. Is there a way to check if the field is set so this doesn't happen?
[21:56:03] eljimmy: has joined #RubyOnRails
[21:57:57] DanByc: modalo thanks for helping me out the other day, and for helping me select a rails tutorial
[21:58:16] DanByc: I am currently working on chapter 4 of that tutorial right now, and just ran into a speed bump
[21:58:45] Radar: good morning
[21:58:48] acovrig: smathy: thanks but it still isn’t working (see updated gist)
[21:58:49] Radar: DanByc: what speed bump?
[22:00:20] smathy: acovrig, no, you still have a lot of wrong things there, not the least of which is that you're never actually using `contact_params` in your action.
[22:00:27] smathy: acovrig, read the guide.
[22:01:24] DanByc: I'm currently on ch. 4: adding a link to the project. I just updated the index action of the projectController. According to the tutorial, my viewing_projects_spec.rb test should pass, but it is throwing up the following error: Failures:
[22:01:24] DanByc: 1) Users can view projects with the project details
[22:01:24] DanByc: Failure/Error: expect(page.current.url).to eq project_url(project)
[22:01:24] DanByc: NoMethodError:
[22:01:24] DanByc: undefined method `current' for #<Capybara::Session>
[22:01:25] DanByc: # ./spec/features/viewing_projects_spec.rb:9:in `block (2 levels) in <top (required)>'
[22:03:08] smathy: DanByc, please use gist in future for anything more than one or two lines.
[22:03:26] DanByc: sure thing. My apologies!
[22:05:05] roamingdog: has joined #RubyOnRails
[22:05:31] sid_fules: has joined #RubyOnRails
[22:06:01] cd83x: has joined #RubyOnRails
[22:06:34] Radar: DanByc: it's because you're doing page.current.url instead of page.current_url
[22:08:55] DanByc: Wow I think I've been hitting the text editor too hard lately. Blind to that in my code and the error message! Thanks again
[22:09:06] DanByc: So simple!
[22:10:28] acovrig: smathy: I read through the guide more and am getting a different error now (see gist (https://gist.github.com/acovrig/19bbdd855fc76f4efaf1e2b67b38b8f1))
[22:11:27] FailBit: has joined #RubyOnRails
[22:13:26] y2mq37: has joined #RubyOnRails
[22:18:09] norc: DanByc, reading error messages usually solves most problems fairly quickly.
[22:19:08] FailBit: well no not always
[22:19:09] FailBit: https://liamwhite1.tk/screenshots/t2Lvaa.png
[22:19:54] Guest38989: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[22:20:33] FailBit: it took me several minutes to figure out where that was coming from
[22:21:13] norc: FailBit, hence the choice of the word "usually"
[22:21:15] idefine: has joined #RubyOnRails
[22:21:25] malcolmva: has joined #RubyOnRails
[22:21:54] Devalo: has joined #RubyOnRails
[22:21:55] IFrank004: has joined #RubyOnRails
[22:21:55] IFrank00: has joined #RubyOnRails
[22:22:08] chipotle: has joined #RubyOnRails
[22:22:26] smathy: ...and "most" :)
[22:22:38] macsteps: has joined #RubyOnRails
[22:22:56] sid_fules: has joined #RubyOnRails
[22:23:20] roamingdog: has joined #RubyOnRails
[22:23:36] FailBit: that particular instance was a coffeescript syntax error that I introduced when writing !==
[22:23:44] FailBit: by the way coffeescript sucsk
[22:24:11] norc: FailBit, I prefer JavaScript. It has so much more features and it is prototype based.
[22:24:49] FailBit: "so much more features" is incorrect because they actually have the same amount of features
[22:24:58] FailBit: coffeescript is just javascript underneath
[22:25:26] FailBit: also if you count bugs as features coffeescript has a lot of those
[22:25:29] norc: I'll just sit here, not making remarks how that was meant as a joke..
[22:25:43] FailBit: can't hear sarcasm over the internet sorry
[22:26:01] workmad3: I love the way people translate the opinion "I dislike X" into the empirical statement "X sucks"...
[22:26:44] norc: workmad3, people still say "I dislike" ?
[22:26:51] Radar: norc: They doth.
[22:27:19] workmad3: norc: no, they tend to assume that because they dislike it then it must be objectively bad and state it sucks instead
[22:27:31] norc: workmad3, objectivity is a myth.
[22:27:41] Aherin: has joined #RubyOnRails
[22:27:47] FailBit: if I say "X sucks" then you know it's an opinion anyways
[22:28:02] workmad3: norc: are you stating that as an objective fact? ;)
[22:28:06] norc: FailBit, too many people assume such phrases to be statements of facts.
[22:28:42] norc: workmad3, no - but at the very least I could argue my standpoint and quote enough papers on the matter.
[22:29:59] norc: workmad3, and that is far more than what the bulk of "X sucks" people can say for themselves.
[22:30:14] workmad3: norc: is that standpoint "Humans can't be truly objective" or "There is no objective reality"?
[22:30:25] Radar: Saying "x sucks" sucks.
[22:30:43] Radar: p.s. best feedback is 3 things: 1) Specific. 2) Actionable. 3) Kind.
[22:30:54] smathy: Feedback sucks.
[22:31:06] Radar: p.p.s. best skill developers can build is their ability to communicate clearly.
[22:31:12] norc: workmad3, the former - this is from a psychological perspective. Your latter is a philosophical matter.
[22:31:16] Radar: Truth bombs flying left and right here.
[22:31:31] Radar: plz take this to #ruby-offtopic.
[22:31:46] workmad3: norc: that's good... I agree with the former :)
[22:32:57] owenjones: has joined #RubyOnRails
[22:33:08] startupality: has joined #RubyOnRails
[22:33:24] Tref: has joined #RubyOnRails
[22:33:44] jhack: has joined #RubyOnRails
[22:34:01] Tref: hey guys - trying to figure out the finer distinctions between rails integration tests and rspec request specs
[22:35:09] NickAnt: has joined #RubyOnRails
[22:35:53] NickAnt: Specifically - Im reading that rspec request specs "wrap" integration tests
[22:37:17] norc: NickAnt, the rails integration tests are the mechanism to be used with minitest I believe.
[22:37:34] SteenJobs: has joined #RubyOnRails
[22:37:54] Tref: So are request specs more of an integration testing alternative?
[22:38:12] Radar: tref: integration tests run within a simulated browser, whereas rspec request tests call directly to the server.
[22:38:25] Radar: tref: the simulated browser is driven by the tests, and that browser makes requests to a test server.
[22:38:36] Radar: request tests are much better for something like an API
[22:38:49] Radar: integration tests are better for something like "when a user fills in this form this way, this happens"
[22:38:59] workmad3: Radar: I thought the rails 'integration test' test case was a rack-test adapter
[22:38:59] norc: Radar, you could still do feature specs with capybara if you wanted a full browser simulation.
[22:39:00] manfrin: has joined #RubyOnRails
[22:39:12] workmad3: Radar: rather than being an actual integration test :)
[22:39:47] norc: tref, so integration tests rather compare to feature specs than request specs.
[22:39:50] Tref: Right I was going to say that feature specs are more similar to integration tests
[22:39:50] Radar: workmad3: Oh I read it as rspec integration tests and rspec request specs.
[22:40:04] norc: tref, indeed. That would be a correct assessment.
[22:40:54] workmad3: norc: the rails IntegrationTest testcase is closer to a request spec... it's a layer over rack-test to give a nicer way to interact with a rack app, but doesn't involve headless browsers
[22:41:26] workmad3: it's just a crappy name, because 'integration test' tends to mean 'headless browser against the app' in most web app discussion :)
[22:41:30] norc: ACTION has avoided Minitest (hey, it sucks! ;-) whenever he could
[22:41:57] workmad3: haha :) I don't think I've touched the minitest test cases for about the past 5 years
[22:42:05] norc: Honestly though, I actually tossed a coin when deciding between rspec and minitest. Rspec won.
[22:42:07] norc: Now I use rspec.
[22:42:31] workmad3: I just keep an eye on what's available, because the rspec-rails adapter mostly just binds the rails testcases into rspec and gives the styles more conventional names
[22:42:32] norc: (At the time I was in no position to judge either in the slightest)
[22:43:41] owenjones: has joined #RubyOnRails
[22:43:45] Tref: The reason I ask is that im testing a new openid-connect implementation that spans multiple controllers and was bouncing between feature specs / integration tests
[22:43:53] Tref: and havent found a good fit
[22:43:57] roamingdog: has joined #RubyOnRails
[22:44:09] workmad3: tref: for testing openid-connect, I'd probably go with rspec request specs
[22:44:27] workmad3: tref: they give you the control over request types and responses to validate the flows are working as expected
[22:44:52] Tref: workmad3: that’s what I did actually but I’m hitting a nasty bug in rpsec it seems
[22:45:06] Tref: specifically: https://github.com/rspec/rspec-rails/issues/860
[22:45:12] workmad3: tref: also, is that openid-connect stuff open source? :)
[22:45:20] Tref: workmad3: yeah it is
[22:45:43] workmad3: tref: cool... we've been considering some openid-connect stuff at work, wouldn't mind taking a look if you have a link
[22:46:00] Tref: its an implementation for Nike and I have zero visibility into their tech as well which made it rather interesting
[22:46:07] sid_fules: has joined #RubyOnRails
[22:46:18] workmad3: ah, so it's the client side rather than server side... still interested though :)
[22:47:09] workmad3: (we're currently doing something similar to openid-connect, but we've shoved the data into a JWT access token rather than introduce an identity token as per the openid-connect spec)
[22:47:15] Tref: Its not completely functional yet. I’d be happy to talk it through with you if you’re interested though. There are also some issues with the omniauth-openid-connect gem that I used which wraps the openid_connect gem
[22:47:20] FailBit: has left #RubyOnRails: ("WeeChat 0.4.2")
[22:47:31] TheMoonMaster: has joined #RubyOnRails
[22:48:03] Tref: yeah they’re not using tokens
[22:48:07] Tref: they / we
[22:48:15] aegis3121: has joined #RubyOnRails
[22:48:27] workmad3: tref: oh weird... I thought the entire point of openid-connect was to layer the identity into oauth2
[22:48:47] workmad3: and yet no tokens...
[22:48:51] workmad3: seems odd :)
[22:50:50] badoo: has joined #RubyOnRails
[22:51:15] roamingdog: has joined #RubyOnRails
[22:51:18] workmad3: tref: I need to head to bed now though (and I'm probably too tired to grasp what's going on too)
[22:51:29] workmad3: tref: no idea on that rspec bug either, sorry :(
[22:52:08] Tref: yeah, its kind of hairy, for some reason calling follow_redirect! is loading an @controller instance and rspec is skipping a before block
[22:52:10] macsteps: has joined #RubyOnRails
[22:53:09] badoo: Hi everyone, I'm trying to override a gem method which works fine, but inside that method there's a condition that doesn't work as expected, can you please take a look?
[22:53:18] badoo: http://stackoverflow.com/questions/37578332/overriding-a-method-from-a-gem-with-a-condition-in-rails-4
[22:53:53] glasz_: has joined #RubyOnRails
[22:55:18] helpa: has joined #RubyOnRails
[22:57:58] mikecmpbll: badoo : don't use module_eval, override the method where it's being included
[22:58:08] mikecmpbll: (by reopening the class)
[22:58:43] badoo: this method is in a module in the gritter gem
[22:58:45] kali^: has joined #RubyOnRails
[22:58:57] mikecmpbll: wait let me read the thing properly.
[22:59:08] badoo: ok thanks a lot for :)
[22:59:52] mikecmpbll: the browser gem presumably depends on access to the request object
[22:59:54] cgfbee: has joined #RubyOnRails
[23:00:28] tildes_: has joined #RubyOnRails
[23:00:50] badoo: so the methods "browser.mobile?" and "is_mobile_request?" will always return false in my module right ?
[23:01:32] d0nn1e: has joined #RubyOnRails
[23:01:45] mikecmpbll: tbh, i dont know how the browser gem is implemented and how it makes the `browser` object avaiable
[23:02:07] mikecmpbll: but it ultimately does matches on the user agent.
[23:03:13] badoo: I honestly don't know how the requests work in rails (with actiondispatch and rack)
[23:03:30] mikecmpbll: look at the user agent stored by the browser object would be a good move.
[23:03:52] badoo: but do you think that I can access that from the module ?
[23:04:22] mikecmpbll: well, the browser object exists, otherwise it would error. so take a look.
[23:04:55] badoo: ok let me see
[23:07:35] badoo: so I added puts request.env["HTTP_USER_AGENT"] in my module and this is what I got:
[23:07:39] roamingdog: has joined #RubyOnRails
[23:07:43] badoo: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36
[23:07:51] badoo: seems like it's working
[23:07:57] mikecmpbll: not quite what i suggested
[23:08:02] mikecmpbll: do puts browser.ua
[23:08:36] banister: has joined #RubyOnRails
[23:08:54] banisterfiend: has joined #RubyOnRails
[23:09:16] banisterfiend: anyone here have experience with reactonrails?
[23:09:37] badoo: it works: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36
[23:11:18] mikecmpbll: badoo : that user agent fails all browser's tests for mobile devices.
[23:11:45] jstransky: has joined #RubyOnRails
[23:11:49] |2701: has joined #RubyOnRails
[23:12:09] badoo: so that means that in my browser.ua in my controller would get a different result ?
[23:12:28] mikecmpbll: how did you draw that conclusion?
[23:12:31] badoo: I don't understand
[23:12:44] superlou: has joined #RubyOnRails
[23:13:13] badoo: because I use that a lot in my controllers
[23:13:31] badoo: and it returns true
[23:13:40] roamingdog: has joined #RubyOnRails
[23:13:41] mikecmpbll: what device is it?
[23:13:44] badoo: I'm a bit confused
[23:13:44] tw1sted: has joined #RubyOnRails
[23:13:49] badoo: iphone 5 on chrome
[23:13:57] siaw23: has joined #RubyOnRails
[23:14:21] badoo: I mean I'm on a desktop but simulating an iphone 5 with chrome
[23:14:55] mikecmpbll: i'm only scanning the detection code, but as far i can see that UA doesn't match mobile
[23:15:01] mikecmpbll: but you'd be better off testing it properly
[23:15:13] badoo: ok thanks for your help
[23:15:20] mikecmpbll: https://github.com/fnando/browser/blob/master/lib/browser/device.rb#L189
[23:15:32] badoo: I'm going to print browser.ua in my view and see what I get
[23:15:53] mikecmpbll: the regexps fail, and i had a scan through the psp? method's checks too and couldn't see anything
[23:15:57] roamingd_: has joined #RubyOnRails
[23:17:20] badoo: Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1
[23:17:25] badoo: this is what I get in my view
[23:17:30] badoo: it's not the same thing
[23:17:49] badoo: yea I knew it was different
[23:18:14] badoo: so annoying, why would the module show me a different user agent ?
[23:18:23] mikecmpbll: because that's the user agent of the request
[23:18:42] mikecmpbll: i don't even know when/where/why/how that code you're referring to gets executed because i've no idea what the gem is.
[23:18:59] badoo: it's gritter it just displays a small notification
[23:19:07] badoo: it's a javascript library actually
[23:19:09] mikecmpbll: but whenever it does execute, the request in actioncontroller has the non-mobile UA
[23:19:23] mikecmpbll: javascript? :/
[23:19:32] badoo: for displaying notifications
[23:19:33] dandaman: has joined #RubyOnRails
[23:19:47] mikecmpbll: so at what stage has it got anything to do with rails
[23:20:46] badoo: SO to display notifications I don't use flash[:notice]
[23:20:58] badoo: I do gflash notice: "say something here"
[23:21:28] badoo: then gritter takes care of displaying the notification in my views
[23:21:36] badoo: nothing too complicated
[23:22:05] badoo: now the problem is that I'm trying to make a different site for mobile with framework7, and I need to override that
[23:22:46] quazimodo: has joined #RubyOnRails
[23:22:46] quazimod1: has joined #RubyOnRails
[23:23:48] badoo: so how can I make sure it's a mobile browser in my module ?
[23:24:24] badoo: or should I override the gflash method somewhere else ?
[23:25:01] refinerysource: has joined #RubyOnRails
[23:25:18] badoo: I have an idea
[23:27:22] roamingdog: has joined #RubyOnRails
[23:28:16] ksmutthu: has joined #RubyOnRails
[23:28:32] zave: has joined #RubyOnRails
[23:29:53] am55: has joined #RubyOnRails
[23:30:07] mikecmpbll: well, it's getting the user agent from somewhere, it's not just making it up
[23:30:30] mikecmpbll: i suspect that should point you in the right direction at least.
[23:32:29] badoo: yea thanks a lot for your help
[23:32:54] badoo: I know what I'm going to do now
[23:36:08] nighttime: has joined #RubyOnRails
[23:37:25] JesseH: has joined #RubyOnRails
[23:41:38] vonkingsley: has joined #RubyOnRails
[23:41:49] czerasz: has joined #RubyOnRails
[23:42:32] allcentury: has joined #RubyOnRails
[23:44:56] jancel: has joined #RubyOnRails
[23:46:08] idefine: has joined #RubyOnRails
[23:48:44] roamingdog: has joined #RubyOnRails
[23:49:38] dalbusch1t: has joined #RubyOnRails
[23:52:25] owenjones: has joined #RubyOnRails
[23:52:36] idefine: has joined #RubyOnRails
[23:53:11] banisterfiend: anyone have an idea about this? http://stackoverflow.com/questions/37580549/how-to-use-jquery-in-non-react-javascript-on-rails
[23:58:26] am55: anyone using premade vagrant files? where from?