Nice video - thanks. Request for future episode: part 2 on params, explaining stuff like:
How that all works, what Rails does when required params are missing, or not permitted params are passed through etc.
Great explanation. I learned a lot and many things has become clear but I still don't understand how rails app knows if it is a Post or a Get or other URL. And other thing which is still not clear is what is "form tag blog_path" and why is it blog_path and even why do we need it at all.
Really good question and one I am going to cover in more depth in some future episodes. Basically blog_path is a Ruby method that returns a URL from your routes file. The path it returns looks like "/blog". The reason you need that is that when you submit a form, you need to pass it a URL that accepts the form data so it can save it to the database. Usually that's a specific url dedicated to just saving data. For example, if you open up the HTML on the login form on GoRails, you'll see that it points to /users/sign_in as the action which knows how to take your username and password, validate it, and sign you in:
<form class="new_user" id="new_user" action="/users/sign_in" accept-charset="UTF-8" method="post">
Yes! Thank you for this. I have a lack of knowledge in how certain aspects of rails works. This was one part I didn't understand and now it clicked. If I don't know how important things work, I just can't progress and I feel like i'm stuck. I feel most tutorials gloss over this completely and after watching this and going over the rails docs, I actually understand how it works. Thanks Again!
You're welcome! Let me know if you have any suggestions on other topics like this you'd like to hear explained. it's easy for me to take these things for granted these days so ideas for topics are always welcome!
Join 22,346+ developers who get early access to new screencasts, articles, guides, updates, and more.