Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Rails Bootcamp [Sesión 04, 05]
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
A. Felipe Cabargas Madrid
June 11, 2016
Programming
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rails Bootcamp [Sesión 04, 05]
A. Felipe Cabargas Madrid
June 11, 2016
More Decks by A. Felipe Cabargas Madrid
See All by A. Felipe Cabargas Madrid
Layers Layers Layers
felipecabargas
0
76
Accesibilidad Web: Que, como, cuando y por que?
felipecabargas
0
50
Untangling git
felipecabargas
0
73
Docker 101
felipecabargas
1
96
GroupRaise Learning Fridays: UX 101
felipecabargas
0
110
GroupRaise Learning Fridays: Hows and whys of version control
felipecabargas
0
61
Sesion III - Taller RoR LCC
felipecabargas
0
100
Sesion II - Taller RoR LCC
felipecabargas
0
140
Taller RoR LCC
felipecabargas
0
160
Other Decks in Programming
See All in Programming
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
240
wkhtmltopdfの次どうするか問題2026
willnet
2
1.8k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
300
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
170
AHC070解法紹介
eijirou
0
140
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
7
4.9k
スマート反転とウェブアクセシビリティ
camiha
0
210
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.9k
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
120
カツオ、ご期待ください
suneo3476
0
100
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
270
JRuby: Past, Present, and Future
headius
0
210
Featured
See All Featured
A Tale of Four Properties
chriscoyier
163
24k
For a Future-Friendly Web
brad_frost
183
10k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
520
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
610
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
290
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Navigating Weather and Climate Data
rabernat
0
540
A Soul's Torment
seathinner
8
3.6k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
340
Transcript
RAILS BOOTCAMP 4 JUNIO 2016
ACTIONVIEW ACTIONCONTROLLER
Datos del Modelo a la Vista: Controladores
app/controller/home_controller.rb class HomeController < ApplicationController def index @nombre = "Felipe"
@people = Person.all end end
La “pagina web”: Vistas
$ rails generate scaffold Person
/app/views/person
ERB
erb-loud
<%= @person.first.name %>
erb-silent
<% @person.each do |p| %> <% end %> Se utiliza
en ciclos u otro código que no se expondrá al usuario
Partials
$ touch app/views/layouts/ _navbar.html.erb
<h1> Hola <% if @nombre.nil? %> Mundo <% else %>
<%= @nombre %> <% end %> </h1> <hr>
<%= render 'layouts/navbar' %>
Asset Pipeline
LINKS <%= link_to 'Nuevo Post', new_post_path, class: ['hola', 'mundo'] %>
<%= link_to 'Posts', posts_url, id: 'mundo' %> <%= link_to 'Google', 'http://google.com' %> IMAGENES <%= image_tag 'leyton.jpg' %> CSS/JS (SASS/COFFEESCRIPT) <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks- track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
Una vista completa
<%= render 'layouts/navbar' %> <ul> <% @people.each do |var|%> <li>
<%= image_tag 'leyton.jpg' %> <strong><%= var.name %></strong> <p><%= var.email %></p> </li> <% end %> </ul> <% # RELATIVA %> <%= link_to 'Nuevo Post', new_post_path, class: ['hola', 'mundo'] %> <% # URL COMPLETA %> <%= link_to 'Posts', posts_url, id: 'mundo' %> <% # EXTERNA %> <%= link_to 'Google', 'http://google.com' %>