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
| 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 |
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
| <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> |
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 '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' |
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
| <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> |
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
| # 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 |
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
| # 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: |
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
| .modal { | |
| padding: 20px; | |
| text-align: center; | |
| background-color: #9999; | |
| } | |
| .content { | |
| display: inline-grid; | |
| justify-content: space-between; |
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
| .modal { | |
| padding: 20px; | |
| text-align: center; | |
| background-color: #9999; | |
| } | |
| .content { | |
| display: inline-grid; | |
| justify-content: left; |
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
| <!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"> |
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
| 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 |
NewerOlder