Posts

Showing posts from February, 2021

old database name in sckool-project

 skool_dbms_backend_development

How to create the new database

Step 01:: In databse.yml change this database name : development:   <<: *default   database: skool_dbms_new  development:   <<: *default   database: skool_dbms_new Step 02:  rake db:create Step 03: rake db:migrate  Note : if any error comes then secure that.

Ruby on Rails

Rails : Q1: How to say Hello Rails???? To say Rails hello we want a new route controller and an action and a view. New Rails Application =   Route + Controller + Action +View Route ----->   Controller --------> Action. Q2::   Which is Written in Which :: Routes are written in Ruby DSL Controllers are Ruby Classes Public Methods are Actions Views are Templates written in mixture of HTML and Ruby  Q3:: How to write a Simple Route:: get "/articles" , to: "articles#index" Q4:: What is the command for the generate the Controller rails generate controller Articles index Q5:: What is Convention over Configration ? . When an action does not explicitly render a view (or otherwise trigger an HTTP response), Rails will automatically render a view that matches the name of the controller and action. Convention Over Configuration! Q6:: How to set the Application Home Page ? root "articles#index" Q7:: How ro generate a model ? rails generate model Artic...