Class: ChikkenInaBukket::Controllers::AddFile

Inherits:
R
  • Object
show all
Defined in:
lib/chikken_in_a_bukket.rb

Instance Method Summary collapse

Instance Method Details

#get(bucket) ⇒ Object



251
252
253
254
# File 'lib/chikken_in_a_bukket.rb', line 251

def get(bucket)
  @bucket = bucket
  render :add_file_form
end

#post(bucket) ⇒ Object



256
257
258
259
260
261
262
263
264
# File 'lib/chikken_in_a_bukket.rb', line 256

def post(bucket)
  Config.connection.put(@input.File['tempfile'].path,
                        :key => @input.File['filename'],
                        :bucket => bucket,
                        :content_type => @input.File['type'],
                        :file => true,
                        :render_as_attachment => true)
  redirect R(Buckets, bucket)
end