Class: Api::AttachmentsController
- Inherits:
-
BaseController
- Object
- BaseController
- Api::AttachmentsController
- Defined in:
- app/controllers/alchemy/api/attachments_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/alchemy/api/attachments_controller.rb', line 5 def index :index, Attachment @attachments = Attachment.all @attachments = @attachments.ransack(params[:q]).result if params[:page] @attachments = @attachments.page(params[:page]).per(params[:per_page]) end render json: @attachments, adapter: :json, root: "data", meta: end |