Forum: Ruby on Rails fiile_column persistent across different forms

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Adam D. (Guest)
on 2006-01-11 05:57
(Received via mailing list)
is there a way to keep the file_column field in the form persistent
across diffferent view templates ?

In my controller (same controller for both views) i do

@post = Post.new

in the view i do

form_step1.rhtml
---------------------
<%= file_column_field "post", "image" %>
 <% if @post["image"] %>
  <%= image_tag url_for_file_column("post", "image") %>
 <% end %>

form_step2.rhtml
----------------
  <% if @post["image"] %>
                  <%= image_tag url_for_file_column("post", "image") %>
                  <br><br
    <% end %>

and in my model i do

file_column :image, :magick => { :geometry => "320x240" }
validates_file_format_of :image, :in => ["image/jpeg"]
validates_filesize_of :image, :in => 0.kilobytes..50.kilobytes

does anybody see what I am missing here ?

thanks
adam
Adam D. (Guest)
on 2006-01-11 15:58
(Received via mailing list)
hmm now i get "Rails Application Failed to Start Properly.."  very
wierd behavior.
This topic is locked and can not be replied to.