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

Solving Algorithms

UPVC Downpipe Installers in South Stour #Gutter #Down #Spout #Specialists #South #Stour

Reebric #2 — GCP Basics

Configure Prometheus and Grafana in Dockers

IoT / BigData project for 2020

Database Evolution — from RDBMS to Big Data

Introduction to Virtual Private Cloud(VPC), NACL, Route Table, Internet Gateway, VPC Peering in AWS

Importance of Considering Scaling

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

Millimeter & P2P Transactions

Sell Europe

Concrete, Plastics, Paint and More. Chalk it Up to Calcium Carbonate

Second pillar — Economy