Sha256: 5628ba32309a437948fc97cbd881f0660d98ab8d6a9e01c1fb4ad43e828f632d
Contents?: true
Size: 575 Bytes
Versions: 1
Compression:
Stored size: 575 Bytes
Contents
class RedactorRails::PicturesController < ApplicationController before_filter :authenticate_user! def index @pictures = RedactorRails.picture_model.find_all({:user_id=>current_user.id}) render :json => @pictures.to_json end def create @picture =current_user.redactor_rails_pictures.build # RedactorRails::Picture.new file = params[:file] @picture.data = RedactorRails::Http.normalize_param(file, request) if @picture.save render :text => { :filelink => @picture.url }.to_json else render :nothing => true end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vision-0.0.1.alpha1 | app/controllers/redactor_rails/pictures_controller.rb |