Design patterns don't make code good, they're just recognized ways to solve problems. If your problem fits a pattern nicely, you can get a lot of expressiveness and reusability, but if you force it then you'll just end up with a mess, anyway
Is there a nice way to have the name of a resource be displayed in a form field, but actually send the id to the backend? I'm trying to get autocompletion with searchkick and typeahead but not have to expose bare ids to users.
I'm currently demoing it in a very ugly way by just having the controller look up the resource by name, but there will inevitably be name clashes, so I want something more robust
Though I'm looking at my controller now, and it says metadatum several times there, so I guess the inflection didn't actually stick :/
Well, see, that's the odd thing. It seems to take my inflection as correct. If I "artist_social_metadata".classify, it comes out as ArtistSocialMetadata. If I "artist_social_metadata".singularize, it comes out "artist_social_metadata", so it seems like it understands the inflection even without the more specific rule
But it absolutely refuses to show the fields unless I use -um, but then it can't write to the DB because it expects -a. It's quite vexing
So say i have user = User.with_pk!(3), and what I want is to put "Hey, there's no one called 3, here" or whatever.
Well, right, but my hope is to stick it in a rescue_from in a concern so I don't have to do that by hand every time I need to do that, but I can't seem to figure out how to recover the id.
Roar looks more featureful, but I don't know if those features are really useful in practice. grape-entity seems pretty zero effort, with really transparent document nesting syntax, but I like the idea of updating a model based on parsing a document in roar.