I'm reading a Ruby book but it doesn't explain the following:
What is this:
validates :name, :presence => true
I mean I know what it does but what's
validates
? Is it a method of the validator class? If so, how come it's called without mentioning the class name first?What's the meaning of
:
in the previous code and in Rails on general?
In the following code:
<%= form_for([@post, @post.comments.build]) do |f| %>
Is
form_for
an object or a procedural function?What's the meaning of the
|
character in|f|
In
<%= link_to 'Edit Post', edit_post_path(@post) %>
Who, where and when was
edit_post_path
method defined?To which class it belongs?