Sha256: 514ff7425e3605bc7fa8e375ed138a67b00104ab70d15293d32dd74e3a89edbc

Contents?: true

Size: 470 Bytes

Versions: 3

Compression:

Stored size: 470 Bytes

Contents

class RedactorRails::PicturesController < ApplicationController
  def index
    @pictures = RedactorRails.picture_model.find_all({})
    render :json => @pictures.to_json

  end
  def create
    @picture = 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

3 entries across 3 versions & 1 rubygems

Version Path
redactor-rails-0.3.2 app/controller/redactor_rails/pictures_controller.rb
redactor-rails-0.3.1 app/controller/redactor_rails/pictures_controller.rb
redactor-rails-0.3 app/controller/redactor_rails/pictures_controller.rb