This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VALID_EMAIL_REGEX= /^(|(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6})$/i | |
validates :email , presence: true,uniqueness:{case_sensetive:false}, | |
format:{with:VALID_EMAIL_REGEX,multiline:true} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def set_name | |
puts "Your name is good" | |
end | |
def before_action (func) | |
method(func).call | |
end | |
before_action :set_name | |
# it is a normal ruby code which takes symbols and call the same name function as symbol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//npm install react-router-dom | |
// run this after creating a react project | |
/***************************************** App.js *******************************************/ | |
import "./App.css"; | |
import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; | |
import Compo from './Thec' | |
import About from './About' | |
function App() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the html | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Two way data binding</title> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<h2>Tasks</h2> | |
<!-- <Check/> --> | |
<h4>{{msg}}</h4> | |
<input type="text" v-model="msg"> | |
<!-- <p v-html="html"></p> --> | |
<!-- <button v-bind:disabled='disbtn'>Thanos</button>111 --> | |
</template> | |
<script> | |
import Check from './Check' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [nameS,setName]=useState({ | |
names:[ | |
{name:'sourav',age:30}, | |
{name:'Toton',age:50}, | |
{name:'Rick grimes',age:10} | |
], | |
btn:"Switch all names" | |
}) | |
// the function which is called when the input value is changed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
# get 'deadpool/home' | |
# get 'sourav',to: 'deadpool#about' | |
# get 'deadpool/download' | |
root 'mains#index' | |
# registrations routes | |
get 'signup', to:'registrations#new' | |
post 'signup', to:'registrations#create' |
NewerOlder