rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org
2007-Jun-07 10:00 UTC
problem with multiple file attachment
hi,
actually i have done single file attachment in ruby on rails, now i
want to do multiple attachment, but the problem is when i am trying to
display the second file name from the params for the testing purpose, i
got the error, please can anyone correct the error.
in view:
<tr>
<td bgcolor="#F6F6F6"><%= file_field("picture",
"file") %></td>
</tr>
<tr>
<td bgcolor="#F6F6F6"><%= file_field("test",
"file") %></td>
</tr>
<tr>
in controller:
if request.post?
@picture=params[:picture][:file]
@filename = @picture.original_filename
@test=params[:test][:file]
render_text @filename1 = @picture1.original_filename
end
my Error is:
undefined method `original_filename'' for "":String
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org
2007-Jun-07 10:13 UTC
Re: problem with multiple file attachment
sorry this is my controller if request.post? @picture=params[:picture][:file] @filename = @picture.original_filename @test=params[:test][:file] render_text @filename1 = @test.original_filename end -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---