Sha256: 43629576a074564bdac93ce1ef1bef36daa49595b90c399bea5a926a4adaa66d

Contents?: true

Size: 265 Bytes

Versions: 2

Compression:

Stored size: 265 Bytes

Contents

module  Crowdblog
  class AssetsController < ApplicationController

    def create
      @post = Post.find(params[:post_id])
      asset = @post.assets.build
      asset.attachment = params['Filedata']
      asset.save!

      render json: asset
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
crowdblog-0.0.2 app/controllers/crowdblog/assets_controller.rb
crowdblog-0.0.1 app/controllers/crowdblog/assets_controller.rb