Hello everyone!
I have a form where we can attach files to a post.
But I want to do different things depending wether a file is attached or
not.
So my question is : it it possible to know if a file is attached? I
would say yes, we just need to see if the parameter "file" is empty.
Here are my parameters :
{
"commit"=>"Create",
"post"=>{"title"=>"Test",
"subject"=>"desc test",
"post_attachment"=>
{
"post_id"=>"",
"file"=>"", # <----------- This is the line with the file
"creator_user_id"=>""
}
}
How can I test if the variable "file" is empty or not?
Thank you!
--
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---