I'm looking to have a model that gets created / updated via AJAX. How do you do this in Ruby on Rails?
Also, more specifically: how do you output JSON in RoR?
def create
response = {:success => false}
@source = Source.new(params[:source])
if @source.save
response.success = true
end
render :json => response.to_json
end