On Mon, Sep 20, 2010 at 2:39 PM, Abder-Rahman Ali <[email protected]> wrote:
> In the "Rails cookbook", I read the following statement:
>
> unless params[:photo]['photo'].content_type =~ /^image/
>
> What do those parts mean?

It means you need to learn Ruby.

> * params[:photo]['photo']?

params is a hash.  :photo is a key in the params hash.

> * =~ /^image/

=~ means match, as in regular expression matching.

/^image/ is a regular expression, it means "starts with 'image'".


-- 
Greg Donald
destiney.com | gregdonald.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.

Reply via email to