[Rails] Re: Simple File Upload to a Blob column in a SQLite DB

2010-08-15 Thread Xenio
Processing ClubsController#edit (for 127.0.0.1 at 2010-08-15 20:44:40) [GET] Parameters: {"id"=>"22"} [4;36;1mClub Load (1.0ms) [0m[0;1mSELECT * FROM "clubs" WHERE ("clubs"."club_id" = 22) [0m Rendering template within layouts/clubs Rendering clubs/edit Completed in 39ms (View: 29, DB: 1)

[Rails] Re: Simple File Upload to a Blob column in a SQLite DB

2010-08-15 Thread Xenio
I removed my previous posts to keep this simple. I have an implementation as so: club Model class Club < ActiveRecord::Base # include Magick set_primary_key "club_id" def logo_bigg=(input_data) self.filename = input_data.original_filename self.content_type = input_data.conte

[Rails] Re: Simple File Upload to a Blob column in a SQLite DB

2010-08-10 Thread Xenio
I'm thinking maybe I should treat it as a separate form for just the picture upload. I think the problems could be when it tries to pass all those variables at once once I hit submit on the form. On Aug 10, 9:41 pm, Xenio wrote: > So I changed my implentatio so that its set up as so: > > The edit

[Rails] Re: Simple File Upload to a Blob column in a SQLite DB

2010-08-10 Thread Xenio
So I changed my implentatio so that its set up as so: The edit view: <% form_for(@club, :html=>{:multipart=>true}) do |f| %> <%= f.error_messages %> <%= f.file_field :logo_bigg %> <%= f.label :phone %> <%= f.text_field :phone %> <%= f.label :shortdesc %> <%= f.text_

Re: [Rails] Re: Simple File Upload to a Blob column in a SQLite DB

2010-08-10 Thread Colin Law
On 10 August 2010 13:18, Xenio wrote: > Hey Chris, > > I think I sent a reply to just you by mistake. Is there anyway you can > post it here? Apparently I do not get copies of messages sent to > author only in google groups. It will be in your Sent Items or whatever it is called in your mailer.

[Rails] Re: Simple File Upload to a Blob column in a SQLite DB

2010-08-10 Thread Xenio
Hey Chris, I think I sent a reply to just you by mistake. Is there anyway you can post it here? Apparently I do not get copies of messages sent to author only in google groups. On Aug 9, 5:13 am, Chris Mear wrote: > On 9 August 2010 00:15, Xenio wrote: > > > > > On Aug 8, 4:48 pm, Xenio wrote:

[Rails] Re: Simple File Upload to a Blob column in a SQLite DB

2010-08-09 Thread Marnen Laibow-Koser
Xenio wrote: > I have a DB that is already populated with data. There is a table > called clubs that has an logo_big field set up as a blob. I have > successfully used send_data to display the jpg pictures as I need them > in the views. I just need to setup the edit/new view to enable me to > uploa

Re: [Rails] Re: Simple File Upload to a Blob column in a SQLite DB

2010-08-09 Thread Chris Mear
On 9 August 2010 00:15, Xenio wrote: > On Aug 8, 4:48 pm, Xenio wrote: >> I have a DB that is already populated with data. There is a table >> called clubs that has an logo_big field set up as a blob. I have >> successfully used send_data to display the jpg pictures as I need them >> in the views

[Rails] Re: Simple File Upload to a Blob column in a SQLite DB

2010-08-08 Thread Xenio
In my controller I have: # PUT /clubs/1 # PUT /clubs/1.xml def update @club = Club.find(params[:id]) if params[:club][:logo_big] && params[:club][:logo_big].size > 0 @club.logo_big = params[:club][:logo_big].read end respond_to do |format| if @club.update_att