Adam Denenberg
2006-Jan-11 03:55 UTC
[Rails] fiile_column persistent across different forms
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 Denenberg
2006-Jan-11 13:57 UTC
[Rails] Re: fiile_column persistent across different forms
hmm now i get "Rails Application Failed to Start Properly.." very wierd behavior. On 1/10/06, Adam Denenberg <straightflush@gmail.com> wrote:> 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 >