Forum: Rails Engines LoginEngine / File_Column Interop

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.
Ray Slakinski (Guest)
on 2006-04-27 18:11
Hello all,

I hope someone can help me with this issue, I have the SVN file_column
and using LoginEngine/UserEngine with Rails 1.1.2.  My issue is that I'm
overloading the view for LoginEngine to support a file image upload as
part of the user record and having a heck of a time doing so.

Near the bottom of my new _edit.rhtml file I put in:

<tr><td><%= file_field("user", "image_url") %></td></tr>

which now displays the upload field as it should when I go to sign up a
user.  I placed in the actual LoginEngine user.rb model the
"file_column :image_url" line just below "  include
LoginEngine::AuthenticatedUser" and I can see when I submit my form that
some directory structure is created.

The last part I did was make a new signup.rhtml file with this as the
start of my form:

	<%= start_form_tag({:action => 'signup'}, :multipart => true) %>

This was to make sure the form was a multipart form for the upload.

The issue is that if I select a file for upload the form doesn't submit,
and no file was created.  The form does submit if I have no file set to
upload. :(

Here is what the logs say when the transaction fails:

Processing UserController#signup (for 127.0.0.1 at 2006-04-27 09:57:29)
[POST]
  Session ID: 1263df31f64b6ed1de7d0054d571ba1c
  Parameters: {"user"=>{"image_url"=>#<File:/tmp/CGI2700.4>,
"password_confirmation"=>"test1", "lastname"=>"the", "firstname"=>"the",
"login"=>"the", "password"=>"test1", 
"email"=>"removed_email_address@domain.invalid"},
"commit"=>"Signup", "action"=>"signup", "controller"=>"user"}
  User Columns (0.014115)   SHOW FIELDS FROM users
Unable to send confirmation E-Mail:
Transaction Error: cannot abort; there is no current transaction.

Any ideas on what else I need to do to get this all to play nice with
each other?

Ps: The reason I added the "file_column :image_url"  right into the
LoginEngine user model instead of overloading it is that when I tried to
overload it the rest of my app started to have issues everywhere I had
"authenticated?"  so I felt it just easier not to fight it and add the
info right into LoginEngine itself, which on the surface appears to have
taken.

- -- Ray Slakinski
This topic is locked and can not be replied to.