Displaying 8 results from an estimated 8 matches for "photos_control".
2008 Sep 18
2
Setting up Fleximage
...eated for the photos or what my next step should be.
If anyone could point me in the right direction, I''d appreciate it. :)
Model (photo.rb)
class Photo < ActiveRecord::Base
acts_as_fleximage :image_directory => ''public/images/uploaded_photos''
end
Controller (photos_controller.rb)
class PhotosController < ApplicationController
def new
end
def create
@photo = Photo.new(params[:photo])
if @photo.save
redirect_to photo_url(@photo)
else
flash[:notice] = ''Your photo did not pass validation!''
render :action => ''new'&...
2008 May 05
2
Deploying to a staging server using Capistrano: how to start up BackgrounDRb?
...e:
[RAILS_ROOT]/vendor/plugins/backgroundrb/lib/backgroundrb.rb:81:in
`dump_object''
[RAILS_ROOT]/vendor/plugins/backgroundrb/lib/backgroundrb.rb:98:in
`new_worker''
[RAILS_ROOT]/app/models/uploader.rb:54:in `start_thumbnail_worker''
[RAILS_ROOT]/app/controllers/photos_controller.rb:49:in `create''
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
mime_responds.rb:106:in `call''
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
mime_responds.rb:106:in `respond_to''
[RAILS_ROOT]/app/controllers/photos_con...
2005 Aug 08
68
Pluralized Controller Names?
If I do:
script/generate controller Photo
I get a controller named photo_controller. OTOH, if I do:
script/generate scaffold Photo
I get a controller named photos_controller. (Note that the controller
name is pluralized).
I realize that I''m specifying the controller name explicitly in the
first case, but it seems
odd to me that the scaffold command generates a pluralized modelname
in the absence
of a specific controller name. It also seems odd that t...
2009 Nov 08
2
send_data with jpeg not working
I''m a newbie having trouble using send_data to send a jpeg file to the
browser for display in an html img tag. This is the relevant code
from my controller (photos_controller.rb):
def retrieve
@photo = Photo.find(params[:id])
send_data File.read(@photo.abs_img_path), :type => "image/
jpeg", :disposition => "inline"
end
def download
@photo = Photo.find(params[:id])
send_file @photo.abs_img_path, :type => "image/jpeg", :...
2010 Oct 25
0
Rails 3 -NoMethodError (undefined method `original_filename
...tet-stream
I''d like to fix that but I''m getting the following error:
NoMethodError (undefined method `original_filename'' for
#<ActiveSupport::HashWithIndifferentAccess:0x107c81998>):
app/models/photo.rb:29:in `upload_file=''
app/controllers/photos_controller.rb:15:in `upload''
app/middleware/flash_session_cookie_middleware.rb:14:in `call''
I think this is because all the tutorials out there aren''t Rails 3
friendly. Anyone have any ideas? Here''s the code:
# Controller
def create
@photo = @photo...
2013 Jul 09
0
How to move create method into worker(sidekiq)?
how to move create method into worker(sidekiq)?
photos_controller.rb
def create
@project = Project.find(params[:project_id])
@photo = @project.photos.build(params[:photo])
@photo.user = current_user
if @photo.save
redirect_to image_upload_project_path(@project)
endend
--
You received this message because you are subscribed to the G...
2013 Mar 28
1
Error Empty file upload result - problem with jQuery bulk file upload
I have problems with multiple file upload. I tried Paperclip with jQuery
file uplad plugin and get the error mentioned in the title. Files get
uploaded without problems, but I keep getting this embarrassing error.
Can somebody offer a solution to my problem or suggest alternative solution
that can be implemented in 2 hours? My client is getting a bit uneasy now.
I have tried everything I
2011 Oct 05
3
Rails 3 routes with same name, different param name based on constraint
Hello there fellow RoR enthusiasts,
I have been wrestling with rails 3 routes for hours trying to accomplish
the following:
I want to use the *same url helper* (photo_url) in my views but have a
different route match made depending on the format of the parameter I
pass. Seems simple enough, right??
If the parameter looks like nn.nn.nnnnnn.whatever, I want the param
passed to