This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
| def authentication(string, need = {dog: 1, cocodrilo: 2}) | |
| string1 = string.split(" ") | |
| if string1 == dog, string1 == cocodrilo | |
| puts "success" | |
| end |
| class RoomsController < ApplicationController | |
| def index | |
| @rooms = Room.all | |
| end | |
| def show | |
| @room = Room.find(params[:id]) | |
| end | |
| def new |
| #pending to comberted to more objec oriented....... |
| .tiny-stone{ | |
| width: 45px; | |
| height: 45px; | |
| position: relative; | |
| margin: auto; | |
| background: image-url('green-ubatuba.jpg'); | |
| background-size: cover; | |
| } |
| 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 |
| <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 %> |
| 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 |