I’ve took this post
http://railsware.com/blog/2013/04/08/api-with-ruby-on-rails-useful-tricks/
like
basis but receive empty response every time. What’s wrong?
Basic controller:
class Api::V1::BaseController < ActionController::Metal
include AbstractController::Rendering
include AbstractController::Callbacks
include AbstractController::Helpers
include ActionController::HttpAuthentication::Token::ControllerMethods
include ActionController::Rendering
include ActionController::Renderers::All
include ActionController::MimeResponds
include ActionController::Instrumentation
append_view_path “#{Rails.root}/app/views”
respond_to :json
end
Controller:
class Api::V1::UsersController < Api::V1::BaseController
def index
@user = User.find(params[:id])
end
end
RABL template:
object @user
attributes :first_name