...while making testing easier.
The gem is 'skinny_controllers'
https://github.com/NullVoxPopuli/skinny_controllers
It's inspired by trailblazer, but sticks more to how rails is laid out.
To use the default functionality, for each of your actions, you can just
do:
render json: model
or however you want to render the response. model is a memoized method
that looks up an operation and policy and applies whatever custom logic
you want to implement.
Checkout the readme for details.
I'm using this gem in a production sass project with Ember as my
frontend and ActiveModelSerializers for helping structure JSON, so
support for skinny_controllers isn't going away ever.
Hope you like it :-)
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7e83ffc7b6894c8bcdc9feaa601f35bb%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment