Magic Controller Actions

Why Controller actions magic

The Controller action is the C in MVC, which stands for Model, View, Controller. This part of the MVC helps determine what your route will look like, or what action it will do backed by a method in your view file. The ruby on rails comes with the controller actions in order to make your site look more dynamic or more pleasing to the programmer’s eye. This part of the MVC helps users interact with your site more.

Receiving requests or requestus

Once the controller action receives the requests created by the user this will go through the model straight to the view and render the action established in a controller. This part of the process is viewed as the middle man. For example, if there is an instance variable (@variable) in the show method it can be accessed in the view action to display what the user wants. This method can edit delete or update a feature. If a user adds a new method the controller action will have it in the views folder labeled as new.html.erb.

Parameters or parametorous

The parameters give users access to the data that has keys, hashes, and URL data. Query string parameters are part of the URL that the user has access to. The form data that is fired in the controller action is what’s known as post data this information usually comes from an HTML form and shows the users what’s going on behind the hood with the help of a byebug of course.

Sorry for spoiling the magic




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

KingDeFi Weekly Development Update — 03

Search Algorithms (Linear and Non-Linear)

What You Need To Know About The Architecture Design Patterns in Android

EVO II Firmware and Explorer App Updates Introduces New Features

HTML Crash Course for Beginners -4

GDPR, how it affected FidMe’s back-end

Building a Family Tree

LastPass clone -part 6

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Woodelin florveus

Woodelin florveus

More from Medium

Frameworks + Convention over Configuration

Mizzou softball 2022 preview

How to reduce your Carbon Fingerprint

Demystifying Functions