I'm having a strange routing problem. When I try to post my form, apache
rederects me to the wrong action (index).
This is my form tag:
<% form_tag(assets_url,:multipart => true
,:id=>"fileform",:method=>:post) do %>
On my local machine (webbrick) , it redirects me correctly to the create
action in my assets controller. When I post this form on my apache
server, I'm redirected to the index action. So I ended up with creating
this tag:
<% form_tag(createnew_assets_url,:multipart => true
,:id=>"fileform",:method=>:post) do %>
I added a createnew method in my assets controller + I fixed the new
route.
This is a very bad solution but I don't understand why apache is
redirecting me to the wrong url. Any suggestions?
--
Posted via http://www.ruby-forum.com/.
Are you using page caching? Perhaps it sees that you have
/foo/index.html so redirects POST /foo to GET /foo/.
Try this:
http://mephisto.stikipad.com/help/show/Developer+Tips
--
Rick Olson
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com
I'm not using page caching at all. My form is just doing a GET request
for assets_path, instead of a POST. Could this be a rails bug?
class Asset < ActiveRecord::Base
has_attachment :content_type => :image,
:storage => :file_system,
:path_prefix => 'public/uploads',
:max_size => 1.megabytes,
:resize_to => '640x>',
:thumbnails => { :thumb => '80x>', :medium =>
'125x>',:large=> '190x' },:processor => :Rmagick
Maby you should mention this in the readme of attachment_fu. It took me
a while to find the solution.