#RubyOnRails - 20 March 2018
« Back 1 day Forward 1 day »
[06:49:10] halogenandtoast: Does anyone know of a reason that there would be two copies of each asset (with different digests) in public/assets
[06:50:05] halogenandtoast: For example `icon08-small-db168530121b9563b91edf437603be0c.png` and `icon08-small-fbaaba8989a1e343d8ad0393106f5e55.png` both appear
[07:10:53] halogenandtoast: Oh wait, the clobber did work (my os was caching the folding contents for a second)
[07:11:22] halogenandtoast: Locally it worked, for some reason on my production server, assets:precompile generated two manifest files though
[07:12:48] halogenandtoast: Unfortunately, I can't, this isn't my app (which I know ties hands here)
[07:17:26] halogenandtoast: I do see files `manifest-5ef964484047092d2672a59e6d513e37.json` and ` manifest-fbb7c6ce0eb69aef71111097dd185313.json` however
[07:33:53] dminuoso: halogenandtoast: Those files then. Check the file for the assets you are seeing.
[07:55:02] halogenandtoast: Clients do the weirdest things some times and I can't change their files
[08:34:17] sevenseacat: there's also a link to a different resource in the channel topic, but many of the books will be the same.
[08:35:04] sevenseacat: also, I just tried to make bread in the breadmaker by myself for the first time and I'm sure it will turn out awfully.
[08:41:14] dminuoso: Is there a way to encode a parameter in such a way, that instead of ids=1&ids==2, I could do something like ids[f]=bar&ids[f]=quux with `ids` remaining an array?
[08:43:20] Radar: dminuoso: no, you can't do that. Rack::Utils.parse_nested_query I think is the function for that
[08:45:45] dminuoso: Radar: Mmm. That kind of sucks, Im trying to find a clean way to encode paramers for multiple resources (so that it plays nice with strong params). :(
[08:51:39] Radar: dminuoso: If you want to specify the nth element of the array: chances are you can accept it as a hash and then convert it to an array without fully vomiting everywhere
[08:51:43] sevenseacat: I was about to go 'how does that differ' but I can see that it pushes some validations to the controller layer
[08:54:09] dminuoso: Radar: Servant has this cool thing, where an API is basically just a type specification. So you could do: `type API = "hello" :> QueryParam "name String :> Get '[JSON] HelloMessage`
[08:54:47] dminuoso: So you have a route packed together with exact acceptance criteria for requests - this type flows through your application and prevents incorrect treatment.
[09:01:09] dminuoso: Radar: It's quite amazing what types are capable of, once you lose the notion that types are just this verbose and useless mess that Java or C++ throws at you.
[09:01:46] dminuoso: Radar: Oh, Servant can of course also generate the appropriate documentation as a cherry ontop! :
[09:03:31] dminuoso: Radar: But the type driven nature makes it really hard for documentation to not match the API specification.
[09:07:32] dminuoso: The really cool thing is, that you need to meddle much with the types since inference will have them flow through your application transparently. So you get the benefits of the expressivity, without the annoyance of a gazillion type annotations that slow down writing and reading.
[11:44:04] solars: hey, is anyone using AWS ECS and can tell me how I would separate the database container from my app when using task definitions?
[13:37:27] blackcross: how would i make an associate with a model Company and a model Shipment where Shipment would have a ship_from_company and a ship_to_company?
[13:38:42] sevenseacat: sounds like a Shipment would belong_to a ship_to_company and a ship_from_company
[14:04:26] CGibsonmm: okay, anyway I have a question about routing through the a controller, I have an image model that on the create action it renders a crop method to crop a photo, I am looking to do the same thing on the edit method also. so it would route edit crop then update
[14:06:34] rikkipitt: I've got a ProjectsController that takes a subset of the Project model fields, that once submittted, takes the user to another controller for adding the remaining fields to Project. I've nested to route, but is this technically not quite restful or should i pretend it is (new/create actions etc)?
[14:11:00] tbuehlmann: dminuoso: how exactly does your cells directory structure look like? do you have one cell per controller action or do you have, like one cell per controller with n methods?
[14:11:40] flujan: hello guys, I have a page which refreshs its contents every 10 seconds. I just performe .get requests using Ajax. The problema is that the tab with this page use as much as 1GB or RAM. When I force reload the page or use window.location.reload if releases all memory.
[14:12:10] flujan: I tried to set the http header for no-cache and the headers are all OK, but the memory usage over time keep increasing. Any ideas?
[14:13:22] tbuehlmann: flujan: are you somehow keeping the old DOM? how do you update the page contents?
[14:13:34] rikkipitt: try using chrome dev tools to track the memory usage and profile the assignments etc
[14:14:28] rikkipitt: this might help get you on your way: https://developers.google.com/web/tools/chrome-devtools/memory-problems/
[14:15:50] dminuoso: tbuehlmann: But that's just statistics. In reality they are controller agnostic as much as possible (apart from some outer "index" cells), and rather feature centric.
[14:16:57] tbuehlmann: let's assume we have a TasksController with regular CRUD actions. how does your directory for its cells look like? or do you adopt trailblazer's concepts style?
[14:17:33] tbuehlmann: I'm thinking about having only one method (#show) per cell vs having several methods per cell (#index, #show, #new, …)
[14:18:09] rikkipitt: flujan: put the ajax up so we can see it, might be able to spot any glaring issues
[14:18:22] dminuoso: tbuehlmann: (I mean you can do it, but that takes you away from all the goodieS)
[14:19:12] tbuehlmann: trying to get warm with it, but it's not too easy since documentation isn't clear
[14:19:30] tbuehlmann: also the distinction between cells, trailblazer-cells and rails-cells wasn't clear at first
[14:20:05] dminuoso: tbuehlmann: I think there is no golden recipe. Use what fits your application best.
[14:22:55] dminuoso: tbuehlmann: There's nothing really wrong with mimicing rails layout should you want this though. It's not bad per se.
[14:27:20] tbuehlmann: cells-rails urges me to use several methods per cell, which I don't like. so then there's trailblazer-cells which has the right folder structure but missing cells-rails's goodies
[14:30:58] dminuoso: tbuehlmann: I dont use trailblazers-cells because I couldnt make it work with my setup - too many autoloading problems after which I just went for pure cells/cells-rails
[14:31:30] tbuehlmann: I'd have to search for that unclear documentation but I'm too confused right now
[14:31:49] dminuoso: tbuehlmann: there may be instances where you want some extra view logic, but dont want a full fleged cell - I sometimes do this with inline methods producing strings, sometimes I render extra templates
[16:22:44] FrostCandy: Anyone know why my gem would work on my local system but not on my production server? I'm new to ruby so probably something easy. when i do GEM LIST i get zeroclipboard-rails (0.1.2) but in my Gemfile it shows gem 'zeroclipboard-rails', '~> 0.1.0' , is that a problem?
[16:33:14] CGibsonmm: having issue with my cropper.js file called form a gem being rendered too soon and default styles and fucntion not working unless reloading the page. Is there an easy way to hold up the render?
[16:33:29] dminuoso: FrostCandy: You might be interested in giving this a brief read: http://bundler.io/v1.5/gemfile.html
[16:51:18] FrostCandy: fryguy: so minor versions match? ok. If I got to my production server, where would you go to get a gem list ? Do I just have to figure out where ruby is installed on the amazon webserver then run the command GEM LIST there? - also thanks dmi i'll read it now.
[16:56:27] FrostCandy: still have a problem though - maybe after i finish reading your doc i'll figure it out.
[16:58:35] FrostCandy: fryguy: to answer your question - dosen't work means on my test server i can click a button that autoamtically copy's the text of a textara box - but on my production server nothing happens when i click the ZeronClip button
[17:08:24] FrostCandy: ok the zeroclipboard-rails (0.1.2) is on my prod server too, must be something else causeint it to work on test server but not on prodution
[17:42:49] FrostCandy: Chrome wasn't reporting that it was blocking the flash plugin though which was wierd so it took me a while to figure it out .
[22:06:21] conceivably: Hello :) Possibly a silly question, I'd like to avoid shooting myself in the foot, but is there any reason as to why it would be a bad idea to have one model inherit from another with both sharing the same database table? I have an optional association, and depending on whether or not it exists I want to add some additional functionality. Or is there a better, canonical way of dealing with this situation?
[22:11:18] SanguineAnomaly: conceivably, that sounds like fairly standard single table inheritance so I'd guess it's fine (although it's a long time since I ever had to do something like that, so maybe times have changed :/)
[22:15:34] conceivably: Sort of, I guess, just that I don't have a type column. Hmm...but perhaps I should have one.