Iam new at rubyonrails. I implemented the image upload in my application. The image uploaded successfully but if iam trying to see those uploaded images they look awful. So plz help me out in this issue. this is my rhtml file <%= form_tag({ :action => "create" }, :multipart => true) %> <p>Image: <input type="file" name="picture" /></p> <p><%= submit_tag ''upload'' %></p> <%= end_form_tag %> controller def create File.open(RAILS_ROOT + " /public/images/#{@params[''picture''].original_filename}", "w") { |f| f.write(@params["picture"].read) } redirect_to :controller => ''admin'', :action => "new1", :bildpfad=> @request.protocol + @request.host_with_port + " /images/#{@params[''picture''].original_filename}" end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060503/566aea69/attachment.html
Hi, as the code you mentioned is from me, I should help you ;) First, you don''t neet the "bildpfad"-string, it was just for me to insert in a new article. second, could you specify "hey look awful"? What did you try? gif, jpg, png? All awful? What system are you using? Beate
Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: original images.zip Type: application/zip Size: 4806 bytes Desc: not available Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060503/03c09aaa/originalimages-0001.zip