Skip to content

Instantly share code, notes, and snippets.

View elyosemite's full-sized avatar
🎯
Focusing

Yuri Melo elyosemite

🎯
Focusing
View GitHub Profile
require 'byebug'
class AdminController < ApplicationController
helper_method :showMessageAdmin
before_action :load_data_from_db, except: [:index, :destroy]
def index
verifyLogin(params[:login], params[:password])
end
<p><%= showMessageAdmin %></p>
<div class="row">
<div class="col s5">
<a class="waves-effect waves-light btn" href="/admin"><i class="material-icons left">cloud</i>Sair</a>
</div>
</div>
<hr>
<table class="highlight responsive-table">
<thead>
<tr>
Rails.application.routes.draw do
get 'admin/index'
root 'index#index'
get '/login/index'
post '/login/show', to: 'login#show'
get '/login', to: 'login#index'
get '/cadastrar', to: 'cadastrar#index'
post '/cadastrar/new', to: 'cadastrar#new'
get '/admin', to: 'admin#index'
<p><%= showMessageAdmin %></p>
<div class="row">
<div class="col s5">
<a class="waves-effect waves-light btn" href="/admin"><i class="material-icons left">cloud</i>Sair</a>
</div>
</div>
<hr>
<table class="highlight responsive-table">
<thead>
<tr>
# Square Root
num = int(input("Your number: "))
imp = []
preResult = num
# Getting the odd numbers
for i in range(1, num, 2):
imp.append(i)
# Executing
# 3x3 List
bigList = [[1, 2, 3, 5, 3, 9],
[4, 5, 6, 8, 0, 8],
[1, 1, 1, 1, 1, 1],
[7, 8, 9, 3, 2, 7]]
line = 2
flag = True
soma = 0
while flag == True:
.modal {
padding: 20px;
text-align: center;
background-color: #9999;
}
.content {
display: inline-grid;
justify-content: space-between;
.modal {
padding: 20px;
text-align: center;
background-color: #9999;
}
.content {
display: inline-grid;
justify-content: left;
<!DOCTYPE html>
<html>
<head>
<title>Testing</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="modal">
<div class="content">
<div class="message">
class Produto
def initialize(attrs)
# Se o meu hash estiver com dados então atribua
if attrs.present?
self.id = attrs["id"]
self.nome = attrs["nome"]
end
end
attr_accessor :id, :nome