Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Rails Bootcamp [Sesión 04, 05]
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
A. Felipe Cabargas Madrid
June 11, 2016
Programming
140
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
63
Accesibilidad Web: Que, como, cuando y por que?
felipecabargas
0
38
Untangling git
felipecabargas
0
65
Docker 101
felipecabargas
1
92
GroupRaise Learning Fridays: UX 101
felipecabargas
0
110
GroupRaise Learning Fridays: Hows and whys of version control
felipecabargas
0
57
Sesion III - Taller RoR LCC
felipecabargas
0
98
Sesion II - Taller RoR LCC
felipecabargas
0
130
Taller RoR LCC
felipecabargas
0
150
Other Decks in Programming
See All in Programming
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
610
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
370
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
270
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
580
A2UI という光を覗いてみる
satohjohn
1
150
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
800
1B+ /day規模のログを管理する技術
broadleaf
0
110
The NotImplementedError Problem in Ruby
koic
1
900
AI 輔助遺留系統現代化的經驗分享
jame2408
1
960
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
170
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
200
Webフレームワークの ベンチマークについて
yusukebe
0
180
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
340
Thoughts on Productivity
jonyablonski
76
5.2k
The SEO Collaboration Effect
kristinabergwall1
1
490
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
170
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
400
Mind Mapping
helmedeiros
PRO
1
260
Documentation Writing (for coders)
carmenintech
77
5.4k
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' %>