could someone point me in the right direction with inverse_of? should I be expecting the query to not make the second Person called? https://gist.github.com/jameswritescode/5c6659e89f35f385e07550d92a180be5
you could do it either way really then. you could implement it on the user and have it just call self.class.xyz to handle the query, or make it a class method you pass the user to
not sure if there is a name for the problem - I'd assume stuff like this is pretty opinionated. If the logic is big or complex, you might consider turning it into a service (another class) that handles it
I have a controller (resources) called BookmarksController, and only need index, create, and destroy. Is it possible to have destroy NOT need to be bookmarks/:id? Just be on /bookmarks like destroy does on a singular resource?
smathy: using ajax, so the data passes as params in DESTROY would contain the info I need
smathy: and that data won't really know the bookmark id, it just knows the subject info (polymorphic assoc) so we can find it
I've got a bit of js (coffee) written to 'save' a blog post when I stop typing, and for some reason seeing it saved multiple times - looking further I found that for some reason the ajax request is being processed twice, one as js and once as json https://gist.github.com/jameswritescode/99a7e7440ff0f6360f30
tubbo: ah, okay. thanks for pointing that out - will refactor that whole bit and see if it helps.
what I had in my head was setup event -> submit form -> get rid of event
tubbo: I got rid of the submit binding altogether and it works - thanks again.
anyone happen to know if there is a shortcut to make a specific coffee file not do the (function() bit around code in the file?
Has anyone recently doing anything with devise & a custom FormBuilder? I'm trying to figure out if it's possible to get the submission errors in the FormBuilder. (currently object.errors has nothing after a failed submission :()
in this case - I'm using HAML in jekyll and have to use == for the liquid bits
(rails 4): if I have lib/name_space/file.rb, wouldn't it load as NameSpace::File in the application by default?
what would the most appropriate place to put something like a utility module (like App::Regex containing a bunch of methods, that would be used in various places in the app) be best put?