All About Route in Rails

What is HTTP?

The Hypertext Transfer Protocol (HTTP) is designed to enable communications between clients and servers.
HTTP works as a request-response protocol between a client and server.
A web browser may be the client, and an application on a computer that hosts a web site may be the server.

Get vs Post

GET - Requests data from a specified resource.
POST - Submits data to be processed to a specified resource.



#Rails -- > config/route.rb

root 'pages#index'   : default route (http://localhost:3000 it will go to this route)
get 'authentication' => "login#authentication", (http://localhost:3000/authentication - it will goto login#authentication)

get 'authentication' => "login#authentication", defaults: {format: 'json'}  now can represent data in json format.

Comments

Popular posts from this blog

Simple way of importing and exporting excel, csv file for ruby on rails application using roo gem

Ruby on Rails Gems Install & Implementation

Important Query for PostgreSQL