ok, so I read some more, I am able to get downloads to work by doing:
in the helper:
def body_column(record)
link_to(h(record.name), :action => :download_file, :controller =>
'email_attachments', :id => record.id)
end
im able to get the file dialog to work by doing:
def body_form_column(record,input_name)
file_field_tag input_name
end
Problem is when I upload the files, it seems to puts this into the
body:
--- !ruby/object:File
content_type: image/png
original_path: rails.png
Maybe the mutipart isnt working because of ajax, how do I make the
create and update for this do a real post.
Also how do I map the content_type and original_path to the other
fields in my table (content_type and name)
In my non active scaffolding I have it working doing something like
this in the model:
def uploaded_file=(incoming_file)
self.name = incoming_file.original_filename
self.content_type = incoming_file.content_type
self.body = incoming_file.read
end
and in the create controller calling:
attachment.uploaded_file = params[:attachment]
How do I do this in active scaffolding?
thanks
joel
On Feb 4, 3:23 am, "Sergio Cambra .:: entreCables S.L. ::."
<[email protected]> wrote:
> On Jueves, 4 de Febrero de 2010 00:46:04 joelkeepup escribió:
>
> > Looks like this was asked a couple years ago, but is there a way to
> > make columns that are blobs work as file upload for edit, and download
> > the file link for show?
>
> Set the form_ui or a form override for the update action, and a list_ui, field
> override or show override to show the link for the show action.
>
> --
> Sergio Cambra .:: entreCables S.L. ::.
> Mariana Pineda 23, 50.018 Zaragoza
> T) 902 021 404 F) 976 52 98 07 E) [email protected]
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.