#RubyOnRails - 28 May 2019
« Back 1 day Forward 1 day »
[07:02:32] noob69: Hi, so I'm trying to find a query that would help me find all the orders that have order.total > sum(order.order_payments.total)
[07:24:34] amperry: Starting up 'rails s', I'm getting the error "unable to monitor directories for changes", the one that recommends I go to https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers to see how to fix it. But it just started happening. I rebooted, and am running no other rails process. Why would that happen?
[08:23:29] dionysus69: Is it effective to build fully async forms with stimulus js? so the data is sent with keystrokes, with 1 second debounce perhaps
[08:23:47] dionysus69: if any other js framework would be better suited for this task please let me know
[09:07:38] NL3limin4t0r: ZAJDAN: You can rename/regenerate by simply removing it and generating it again with a new name `bundle exec rails destroy controller old_name ...` then `bundle exec rails generate controller new_name ...`
[09:08:38] NL3limin4t0r: ZAJDAN: But you might want to rename the controller and routes manually if you've put some work into it.
[13:19:07] jarr0dsz: hello everyone, im higly confused. im trying to have a organisation/account/profile controller ( singular )
[13:19:36] jarr0dsz: all works fine, so i setup a controller => "profile" in my routes.. but the form_for has a url like organisation_profile_path
[13:21:32] jarr0dsz: basically the code and routes are like so: https://gist.github.com/voordev/77c5d9f4476d0b05bca3c14ce974f70e
[13:22:06] jarr0dsz: the edit form does a POST so #create action is called but it should update existing record and call #update
[13:24:32] jarr0dsz: if i specify :method => "put" explicit it calls the update method instead but i think this is not something that should be required right?
[13:25:10] NL3limin4t0r: jarr0dsz: Normally post is used if the instance matches the following `record.new_record?`. Check if this is the case for `@organisation.organisation_profile.new_record?`.
[13:27:24] jarr0dsz: thank you NL3limin4t0r diden't knew about that but sounds like logic, it returns false
[13:27:40] jarr0dsz: i also populate the form with existing data so im really sure the organisation_profile exists
[13:29:14] jarr0dsz: now i have 1 thing that might cause the issue let me post my view controller for that
[13:29:16] jarr0dsz: so i have this: https://gist.github.com/voordev/9b746e5b509736d11f228836cd8de4fc
[13:29:37] NL3limin4t0r: Seems like it. I would use something like `@organisation.organisation_profile.new_record? ? :post : :put` so the form can still be used for new and edit.
[13:29:58] jarr0dsz: basically my /organisation/account path routes to /organisation/account/edit.haml where I have some tabs rendered with the view helpers you see in my gist. Then I just include every edit view of each section of the profile
[13:53:22] haxx0r: css guru here? how can i make the white ball spin the opposite way? https://codepen.io/youdantoom/pen/VOBxMR
[14:20:38] NL3limin4t0r: haxx0r: Add the word `reverse` between `rotate` and `1s` in `.inner[data-spinto="idle"]:before`.
[14:24:29] haxx0r: Uploaded file: https://uploads.kiwiirc.com/files/4f232aecb34aea96d66b689f14a213b8/pasted.txt
[14:25:53] NL3limin4t0r: haxx0r: From the mdn docs it seem that you should add it between `infinite` and `liniar`, but my first comment on the matter works too in my browser.
[17:46:30] istrasci: I'm using Devise for authentication using a Users model. In my SessionsController, I'm overriding the #create method, but it appears a new User record is being created (if they've never logged in before) before I even get to the #create method. How is this happening? Because I need to preempt the record creation.
[21:38:51] jarr0dsz: hello everyone, has anyone deployed a rails application where they left part of the application offline?
[21:39:11] jarr0dsz: im thinking of moving my admin role ( devise ) and move it out of the online deployment, run it locally and connect to remote db.
[21:39:49] jarr0dsz: the idea is that this could cause less security issues or unauthorized acces and i have some business logic i want not to be on a 'public' server. any thoughts regarding this? does this make sense
[21:40:40] jarr0dsz: so basically i already have parts of my code offline so the next thought was thus moving the admin ui and /admin section out alltogether also
[21:43:54] jarr0dsz: also the db would be fully encrypted but since i already run another rails application locally i want to merge this with the admin.
[21:45:53] weaksauce: if you do hire people you are going to expect them to download and install rails and keep that up to date
[21:46:13] weaksauce: they have the source code at that point where they can change things willy nilly and give themselves super user access
[21:46:52] jarr0dsz: weaksauce im basically the only one that does the 'management' tasks like adding new users etc so that will not be a problem.
[21:47:11] jarr0dsz: my thought was it really should not be online, there is no sense, to includle the admin parts and ui inside my 'regular rails app'
[21:49:45] jarr0dsz: its in the category 'rethink it over first' ;p just was curious if someone would have done it before.