Hi everyone
I have a strange routing behavior. And I don’t know when it started
being.
I have a form for image upload using attachment_fu. The code in the view
is
<% form_for(:image, :url => “/images/create”, :html => { :multipart =>
true }) do |form| %>
<%= form.file_field :uploaded_data, :size => 15, :class => “formLoader”
%>
<% end %>
and the controller code is
def create
# Used by start/index
@image = Image.new(params[:image])
@image.kwiker_id = session[:kwiker]
if @image.save
redirect_to(‘/grusskarten/deinenachricht/’ + @image.id.to_s)
else
flash[:error] = ‘Das Bild konnte nicht hochgeladen werden.’
redirect_to(:controller => ‘start’)
end
end
so it should route me to /grusskarten/deinenachricht/
if succesful. But I run into a 404 error. The prod.log says
Processing ImagesController#create (for 95.116.6.201 at 2009-11-05
21:38:20) [POST]
Session ID: 33d68daef3fd8a51b3ec968b916ace06
Parameters: {“x”=>“70”, “y”=>“23”, “action”=>“create”,
“authenticity_token”=>“020d41a157fbc69c314d369d73f7dd47b9fe070f”,
“controller”=>“images”, “image”=>{“uploaded_data”=>#<File:/tmp/CGI5622
Redirected to https://test.kwikit.de/images/create
Filter chain halted as [:ensure_proper_protocol] rendered_or_redirected.
Completed in 0ms (DB: 2) | 302 Found
[http://test.kwikit.de/images/create]
Processing ImagesController#show (for 95.116.6.201 at 2009-11-05
21:38:20) [GET]
Session ID: 33d68daef3fd8a51b3ec968b916ace06
Parameters: {“action”=>“show”, “id”=>“create”, “controller”=>“images”}
ActiveRecord::RecordNotFound (Couldn’t find Image with ID=create):
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:
Why does he routes me to ImagesController and action => show???
It happens only on my production server.