2012-01-14 20:26:49 +00:00
|
|
|
class Api::AsciicastsController < ApplicationController
|
|
|
|
skip_before_filter :verify_authenticity_token
|
|
|
|
|
|
|
|
def create
|
|
|
|
ac = Asciicast.new(params[:asciicast])
|
|
|
|
|
|
|
|
if ac.save
|
2012-01-15 14:07:12 +00:00
|
|
|
render :text => asciicast_url(ac), :status => :created, :location => ac
|
2012-01-14 20:26:49 +00:00
|
|
|
else
|
|
|
|
render :text => ac.errors.full_messages, :status => 422
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|