komposable / komponent

An opinionated way of organizing front-end code in Ruby on Rails, based on components
http://komponent.io
MIT License
427 stars 31 forks source link

Use ActiveModel::Validations on components #153

Open nicolas-brousse opened 4 years ago

nicolas-brousse commented 4 years ago

I think it could be nice to be able to use ActiveModel::Validations on a component.

nicolas-brousse commented 4 years ago

Since a component is a module like an helper. I think we can't do this for now.

Component should be a class to be able to do this.

dlupu commented 4 years ago

I totally agree, this would be great.

nicolas-brousse commented 4 years ago

Since this implies using classes instead of modules. It's something that should only appear in a major realease, with broken changes I guess.

0xStarcat commented 4 years ago

Having any sort of way to custom validate a property would be great - not saying you need a whole system like React's PropTypes, but at least a simple way to pass and execute a :validator option on definition perhaps