← Back to Upcase

ActionController::Metal for Rails APIs

(Rafael Lima) #1

Hi there,

I’m currently developing a Rails API and I’ve stumbled upon some links on the internet about how to do so.
To be short, inheriting from ActionController::Metal is a way faster than inheriting from ActionController::Base because ActionController::Base loads a bunch of things that you’ll not need when developing an API.

I’m wondering if has any of you done that? If so, have you actually measure the differences between them?


(Samnang Chhun) #2

I used it before, but I didn’t measure it. There is a great episode on this topic on railscast: http://railscasts.com/episodes/150-rails-metal-revised

Currently, I’m using rails-api which is almost the same reason to slim my controller down.