Hacker News new | ask | show | jobs
by 64738 2672 days ago
Take this with a grain of salt, as I only recently came across it and haven't used it, but the Trailblazer framework looks like it has a good way of getting logic out of the views.
1 comments

I've been using parts of it on most Rails apps I've worked on for the last few years. The form object pattern (Reform) really helps when you need to update the same model in different places with different validations.

For example maybe an Order only needs a price when it's created, but needs a invoice number (and some other validations) when marked as paid, but an admin should be able to override those validations at any stage. If you are doing something like that with standard Rails the model is going to end up as an untestable mess, where as the form objects can be tested on their own.

My only complaint is that the creators of Trailblazer really don't seem to like Rails, so trying to get them to both work together can sometimes be a bit tricky. And the documentation is lacking if you want to do some more complicated things.

Thank you for your thoughts on it, I'm intrigued enough to really want to look more into it. Even if I don't get to use it, I think it will give me some ideas that I can apply to other projects.