hello, how to generate new image if i do add new version? For example, I add version :small => { :size => "320x240" } . How to tell file_column to generate new image version if image is allready uploaded ? Thank you! -- Posted via http://www.ruby-forum.com/.
Gi, Im attempting to use the file column plugin, but having a few problems. In quote.rb I have class Quote < ActiveRecord::Base file_column :image has_one :project end then In my _form.rhtml, I have <p><label>Quote file</label><br/> <%= file_column_field "quote", "image" %></p> However im gaining this error message, is there somthing I hneed to place in quotes_controller to get this to work? or any other suggestions to what could be going wrong? NoMethodError in QuotesController#new undefined method `file_column'' for Quote:Class -- Posted via http://www.ruby-forum.com/.
finally found a fix for this! just re-start the server!!!! doh! -- Posted via http://www.ruby-forum.com/.
Scott wrote: well fixed that error by re-starting the server!! but when i submit the form with a url I now get this error TypeError in QuotesController#create Do not know how to handle a string with value ''tests.doc'' that was passed to a file_column. Check if the form''s encoding has been set to ''multipart/form-data''. -- Posted via http://www.ruby-forum.com/.
Also make sure you have a :string/varchar field called "image" in the quotes table of your database. Scott wrote:> Im attempting to use the file column plugin, but having a few problems. > > In quote.rb I have > class Quote < ActiveRecord::Base > file_column :image > > has_one :project > end > > then In my _form.rhtml, I have > <p><label>Quote file</label><br/> > <%= file_column_field "quote", "image" %></p> > > However im gaining this error message, is there somthing I hneed to > place in quotes_controller to get this to work? or any other suggestions > to what could be going wrong? > > NoMethodError in QuotesController#new > > undefined method `file_column'' for Quote:Class-- Posted via http://www.ruby-forum.com/.
Steve Koppelman wrote:> Also make sure you have a :string/varchar field called "image" in the > quotes table of your database. >yeah thanks, got it set a text field, but seems to work looks like i was forgetting to set the multipart <%= form_tag ({:action => ''create''}, :multipart => true) %> -- Posted via http://www.ruby-forum.com/.