Class: Crowdblog::AssetsController

Inherits:
Controller
  • Object
show all
Defined in:
app/controllers/crowdblog/assets_controller.rb

Instance Method Summary collapse

Methods inherited from Controller

#authorize!

Instance Method Details

#createObject



4
5
6
7
8
9
10
11
# File 'app/controllers/crowdblog/assets_controller.rb', line 4

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

  render json: asset
end