{"action":"created","issue":{"url":"https://api.github.com/repos/hyperoslo/hyper_admin/issues/25","labels_url":"https://api.github.com/repos/hyperoslo/hyper_admin/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/hyperoslo/hyper_admin/issues/25/comments","events_url":"https://api.github.com/repos/hyperoslo/hyper_admin/issues/25/events","html_url":"https://github.com/hyperoslo/hyper_admin/pull/25","id":76231234,"number":25,"title":"Enhancement: Rails validations brought to the client-side ","user":{"login":"SteveBenner","id":2619000,"avatar_url":"https://avatars.githubusercontent.com/u/2619000?v=3","gravatar_id":"","url":"https://api.github.com/users/SteveBenner","html_url":"https://github.com/SteveBenner","followers_url":"https://api.github.com/users/SteveBenner/followers","following_url":"https://api.github.com/users/SteveBenner/following{/other_user}","gists_url":"https://api.github.com/users/SteveBenner/gists{/gist_id}","starred_url":"https://api.github.com/users/SteveBenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteveBenner/subscriptions","organizations_url":"https://api.github.com/users/SteveBenner/orgs","repos_url":"https://api.github.com/users/SteveBenner/repos","events_url":"https://api.github.com/users/SteveBenner/events{/privacy}","received_events_url":"https://api.github.com/users/SteveBenner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-05-14T04:52:35Z","updated_at":"2015-06-02T08:03:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hyperoslo/hyper_admin/pulls/25","html_url":"https://github.com/hyperoslo/hyper_admin/pull/25","diff_url":"https://github.com/hyperoslo/hyper_admin/pull/25.diff","patch_url":"https://github.com/hyperoslo/hyper_admin/pull/25.patch"},"body":"## I bring you an opinionated (but *PRETTY LEGIT*) solution for enhancement proposed by issue #2 \r\n\r\n#### *PREFACE*\r\nI was invited by @jgorset to contribute to one of your cool projects, and I totally picked this one. He *did* suggest that it might be slightly crazy, but I was already two days deep in the source code when I started giving his warning serious thought… Whereas I might whip out a Rails-only solution in a few hours, I soon realized that implementing my concept would require understanding both AngularJS, and HyperAdmin. I’m totally new to both technologies—or at least that was the case a week ago.\r\n\r\nFor better or for worse, I do this thing where if I run into a challenging problem, I become ridiculously driven about solving it. I haven’t worked in a system that blends client/server paradigms like this before, and data flow was just totally murky to me. So I read code until I grokked that shit. Then I wrote a solution using the tools I know. And I loved every minute of the process. Angular has been at the top of my to-learn list for quite a while now, and I have to say that reading HyperAdmin was a *delicious* experience. That is some ***crazy elegant Ruby***.\r\n\r\n**In short, no regrets were had**.\r\n\r\n---\r\n### WHAT IT DO\r\n[Why not see for yourself][1]\r\n\r\n### HOW IT DO\r\nIn lieu of what would normally be a very detailed Git commit log, I chose to describe this feature in [its own doc file][2]. This was also to reduce the amount of comments in source code files.\r\n\r\n### WHY IT DO\r\nI think any solution in a mixed-paradigm system such as this one will be be opinionated. There are so many factors involved in evaluating trade-offs that it really falls down to the individual programmers. Perhaps this is a totally FAIL solution for you, and would never work as a part of HyperAdmin. That would be OK with me, because **my point here is to show how much I love writing quality code and solving complex problems.**\r\n\r\n[1]: https://github.com/SteveBenner/hyper-admin-app-demo\r\n[2]: https://github.com/SteveBenner/hyper_admin/blob/feature/client-side-validations/doc/Validations.md"},"comment":{"url":"https://api.github.com/repos/hyperoslo/hyper_admin/issues/comments/107851372","html_url":"https://github.com/hyperoslo/hyper_admin/pull/25#issuecomment-107851372","issue_url":"https://api.github.com/repos/hyperoslo/hyper_admin/issues/25","id":107851372,"user":{"login":"sindrenm","id":386122,"avatar_url":"https://avatars.githubusercontent.com/u/386122?v=3","gravatar_id":"","url":"https://api.github.com/users/sindrenm","html_url":"https://github.com/sindrenm","followers_url":"https://api.github.com/users/sindrenm/followers","following_url":"https://api.github.com/users/sindrenm/following{/other_user}","gists_url":"https://api.github.com/users/sindrenm/gists{/gist_id}","starred_url":"https://api.github.com/users/sindrenm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindrenm/subscriptions","organizations_url":"https://api.github.com/users/sindrenm/orgs","repos_url":"https://api.github.com/users/sindrenm/repos","events_url":"https://api.github.com/users/sindrenm/events{/privacy}","received_events_url":"https://api.github.com/users/sindrenm/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T08:03:54Z","updated_at":"2015-06-02T08:03:54Z","body":"Any particular reason why you'd want to use `ngShow` directly instead of going through the `ngMessages` interface, @SteveBenner? `ngMessages` is designed specifically for displaying error messages in forms, and in a way acts as a `switch..case`/`case..when` for Angular, with optional `break`s. In the case of our Material design, we only want to display one error message per form field at a time, which at first thought I think could prove a bit troublesome using `ngShow`. `ngMessages` handles this by design. :smiley: "}}