Class: ResharesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/reshares_controller.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) create



5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/reshares_controller.rb', line 5

def create
  @reshare = current_user.build_post(:reshare, :root_guid => params[:root_guid])
  if @reshare.save
    current_user.add_to_streams(@reshare, current_user.aspects)
    current_user.dispatch_post(@reshare, :url => post_url(@reshare), :additional_subscribers => @reshare.root_author)
    render :json => ExtremePostPresenter.new(@reshare, current_user), :status => 201
  else
    render :nothing => true, :status => 422
  end
end