// jQuery
$(document).ready(function() {
// code
})
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 authentication(string, need = {dog: 1, cocodrilo: 2}) | |
| string1 = string.split(" ") | |
| if string1 == dog, string1 == cocodrilo | |
| puts "success" | |
| 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
| class RoomsController < ApplicationController | |
| def index | |
| @rooms = Room.all | |
| end | |
| def show | |
| @room = Room.find(params[:id]) | |
| end | |
| def new |
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
| #pending to comberted to more objec oriented....... |
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
| .tiny-stone{ | |
| width: 45px; | |
| height: 45px; | |
| position: relative; | |
| margin: auto; | |
| background: image-url('green-ubatuba.jpg'); | |
| background-size: cover; | |
| } |
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 Person | |
| attr_reader :name | |
| def initialize(name) | |
| self.name = name | |
| end | |
| def name=(name) | |
| if name == nil or name.size == 0 | |
| raise ArgumentError.new('Must have a name.') | |
| 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
| <h1>How remote true works</h1> | |
| <%= form_tag remote: true do %> | |
| <%= text_field_tag "name" %> | |
| <%= submit_tag "sumit you name" %> | |
| <% end %> | |
| <div style="border: 1px red solid" id="names"> | |
| <%= @names %> |
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 Car | |
| attr_accessor :speed, :acceleration, :braking, :velocity | |
| def initialize(velocity = 0) | |
| @velocity = velocity | |
| end | |
| def accelerate(acceleration) | |
| acceleration == 0 ? @velocity + 1 : @velocity + acceleration | |
| 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
| class Employee | |
| attr_accessor :name, :salary | |
| def initialize(name, salary) | |
| @name = name | |
| @salary = salary.to_i | |
| end | |
| def start_salary |