Posts

Showing posts with the label reactjs

Make admin panel with Active admin rails || active_admin rails

Image
Make admin panel with Active admin rails || active_admin rails  Open Terminal and copy and paste this Command rails new admin_example // creating new rails application go inside the project cd admin_example run bundle install bundle install open your gem file and add this new gem's gem 'activeadmin' / / for active admin panel gem 'inherited_resources' //  making your controllers inherit all restful actions gem 'devise' // for user authentication  run bundle install again bundle install install active admin rails g active_admin:install / /install active admin to your project migrate database rake db:migrate check your seed file and run rake db:seed create user file and model rails g User name email  create post file and model rails g Post title body:text published_at:datetime user:references Now Migrate DataBase rake db:migrate start rails server rails s Hit url localhost:3000/admin/login Enter login details you can find login

Features of Sql * Plus

Features of Sql * Plus At a time only one query is allowed to execute Sql queries are not case sensitive Each query is terminated with ; ( semi colon ) SQL commands are ANSI standard ( American National standard institute )

What is sql in Deep(Structured query language). Sql Tutorial -1

What is sql in Deep(Structured query language) Oracle was the first company to release a product that used the English-based Structured Query Language, or SQL. This language allows end users to extract information themselves, without using a systems group for every little report. Oracle’s query language has structure, just as English or any other language has structure. It has rules of grammar and syntax, but they are basically the normal rules of careful English speech and can be readily understood. What is SQL QUERIES It is known as data base language. It is used to communicate with any database. We can use this language constructs to write SQL QUERIES. What is SQL* PLUS SQL * PLUS is a default client tool and acts as an interface between client and database. What is SQL It is a collection of pre defined commands and constructs with syntactical rules

Export Import component in react

Image
 Export Import component in react See installation and configuration in my other blog Now Create a file into a public folder or anywhere into Root directory inside your project folder Create to directory into root directory         mkdir public           mkdir src Create two new into public folder index.html index.js Create two new file into src folder main.js  item.js Copy and paste code into index.html <!DOCTYPE html> <html> <head> <title>React - demo</title> </head> <body> <div id="root"></div> <script src="index.js"></script> </body> </html> Now into item.js import React from 'react'; class Item extends React.Component{ render(){ return( <div> Hello Item </div> ); } } export default Item; // you must have to make component exportable Now into main.js import React from 'react&#

The 'mode' option has not been set, webpack will fallback to 'production' for this value

WARNING in configuration The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment. You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/ module.exports = {   mode: "development", // Add mode here to solve this warning    entry: './src/main.js', // Bundle all assets from this location together    output: {        filename: 'index.js', // Output to this file        path: path.resolve( __dirname, 'public' ), // In this location    }

React Application by Webapck || webpack install

Image
Create a directory into your local         for windows            mkdir react-demo         for linux                       mkdir react-demo Go to directory             cd react-demo Type npm init            for installing node and creating package.json file npm i webpack --save-dev           create dependency by webpack npm i webpack-cli --save-dev           This cmd is used to create dependency for webpack-cli in package.json file.           Like -             "devDependencies": {            "webpack": "^4.16.2",            "webpack-cli": "^3.1.0"             } npm install -D babel-loader @babel/core @babel/preset-env webpack "devDependencies": {    "babel-core": "^6.26.3",    "babel-loader": "^7.1.5",    "babel-preset-env": "^1.7.0",    "webpack": "^4.16.2",    "webpack-cli":

What is WebPack || WebPack React app by webpack || babel loader || babel core || babel

Image
Webpack is a tool that puts all your assets including images,javascript ,fonts and css in a dependency graph entry point: is the file webpack looks for to start building your Javascript bundle webpack’s main strength is code splitting. It introduce a production mode and development mode. As ,, Syntax of  ReactJS is based on ES6. old browsers doesn’t understand ES6. So , to run JS we need something which transform our ES6 code to browser understand language , the same thing is done by babel-loader. Babel-loader is a webpack loader for transpiling ES6 and above , down to ES5. For this, you need three things - babel-core, babel-loader, babel-preset-env   Commands- 1. npm init: This cmd create a package.json file . 2.npm i webpack --save-dev: This cmd generate dependencies for webpack in package.json file. Like "devDependencies": {    "webpack": "^4.16.2"  } 3. npm i webpack-cli --save-dev : This cmd is

React Component || Functional Component || Class Component || composing function component

What is Component? React Components that render html elements and tags Types of Component Functional Component Class Component Functional Component Render html element through function Class Component Render html element through class Composing function component Means call a function component into another function component Functional Component Example Now again make a directory inside root directory        mkdir public (you can take name as you want)        mkdir src (you can take name what ever you want you want) inside public folder create two new file index.html index.js inside src folder create one new file  main.js ( this is file where react app execution is start. you can take name what ever you want). app.js or main.js function Item(){ return(<h1>Hello from Item</h1>) } function Welcome(){ return(<div> <h1>Hello React</h1> <Item />  </div>); } const element = <Welcome /> ReactDOM.render(e

React Component || Functional Component || Class Component

What is Component? React Components that render html elements and tags Types of Component Functional Component Class Component Functional Component Render html element through function Class Component Render html element through class Functional Component Example Now again make a directory inside root directory        mkdir public (you can take name as you want)        mkdir src (you can take name what ever you want you want) inside public folder create two new file index.html index.js inside src folder create one new file  main.js ( this is file where react app execution is start. you can take name what ever you want). app.js or main.js function Welcome(){ return(<h1>Hello React</h1>); } const element = <Welcome /> ReactDOM.render(element, document.getElementById('root')); in index.html <!DOCTYPE html> <html> <head> <title></title> <script crossorigin src="https://unpkg.com/

Create react app by yarn-server || yarn Server || React App

Image
first of all install Yarn from here  https://yarnpkg.com/en/ click on get started and install yarn server Create a directory mkdir <your_directory_name> Run command yarn init (press enter and use all defaults) by this command package.json file will be created in root directory for creating Dependency we run this command yarn add babel-cli babel-preset-react --dev yarn add babel-cli babel-preset-env --dev yarn global add babel-cli babel-preset-env babel-preset-react ( Installed "babel-cli@6.26.0" with binaries:  - babel-doctor  - babel  - babel-node  - babel-external-helpers ) Now again make a directory inside root directory mkdir public (you can take name as you want) mkdir src (you can take name what ever you want you want) inside public folder create two new file index.html index.js inside src folder create one new file  main.js ( this is file where react app execution is start. you can take name what ever you want). Add this code into your i