-
Notifications
You must be signed in to change notification settings - Fork 111
/
index.html
404 lines (355 loc) · 14.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
---
id: home
---
<div class="heading common-padding--bottom common-padding--top-small">
<div class="container">
<div class="heading__body">
<div class="heading__headline common-headline">
<h1>Compress the complexity of modern web apps.</h1>
<h4>Learn just what you need to get started, then keep leveling up as you go. <strong>Ruby on Rails scales from HELLO WORLD to IPO.</strong></h4>
</div>
{% if site.data.version.label %}
<div class="heading__button">
<a href="{{ site.data.version.url }}" class="common-button common-button--version"><span>{{ site.data.version.label }}{% if site.data.version.date %} — released {{ site.data.version.date }}{% endif %}</span></a>
</div>
{% endif %}
</div>
</div>
</div>
<div class="video common-background--grey common-shape--top-white-down-left">
<div class="container">
<div class="video__embed">
<video poster="https://d2biiyjlsh52uh.cloudfront.net/rails/rails-8-demo.webp" src="https://d2biiyjlsh52uh.cloudfront.net/rails/rails-8-demo.mp4" width="1920" height="1080" preload="metadata" controls crossorigin>
<track src="https://d2biiyjlsh52uh.cloudfront.net/rails/rails-8-demo-en.vtt" kind="captions" label="English" srclang="en" default>
</video>
</div>
</div>
</div>
<div class="heading common-gradient--grey-to-white common-padding--bottom-small common-padding--top">
<div class="container">
<div class="heading__body">
<div class="heading__headline common-headline">
<h1>You’re in good company.</h1>
<h4>Over the past two decades, Rails has taken countless companies to millions of users and billions in market valuations.</h4>
</div>
</div>
</div>
</div>
<div class="trusted common-padding--bottom-small">
<div class="container">
<div class="trusted__blocks">
<div class="trusted__block">
<a href="https://basecamp.com" aria-label="Basecamp">
<img src="/assets/images/logo-basecamp.svg" alt="Basecamp" />
</a>
</div>
<div class="trusted__block">
<a href="https://hey.com" aria-label="HEY">
<img src="/assets/images/logo-hey.svg" alt="HEY" />
</a>
</div>
<div class="trusted__block">
<a href="https://github.com" aria-label="GitHub">
<img src="/assets/images/logo-github.svg" alt="GitHub" />
</a>
</div>
<div class="trusted__block">
<a href="https://shopify.com" aria-label="Shopify">
<img src="/assets/images/logo-shopify.svg" alt="Shopify" />
</a>
</div>
<div class="trusted__block">
<a href="https://instacart.com" aria-label="Instacart">
<img src="/assets/images/logo-instacart.svg" alt="Instacart" />
</a>
</div>
<div class="trusted__block">
<a href="https://dribbble.com" aria-label="Dribbble">
<img src="/assets/images/logo-dribbble.svg" alt="Dribbble" />
</a>
</div>
<div class="trusted__block">
<a href="https://gusto.com" aria-label="Gusto">
<img src="/assets/images/logo-gusto.svg" alt="Gusto" />
</a>
</div>
<div class="trusted__block">
<a href="https://zendesk.com" aria-label="Zendesk">
<img src="/assets/images/logo-zendesk.svg" alt="Zendesk" />
</a>
</div>
<div class="trusted__block">
<a href="https://airbnb.com" aria-label="Airbnb">
<img src="/assets/images/logo-airbnb.svg" alt="Airbnb" />
</a>
</div>
<div class="trusted__block">
<a href="https://squareup.com" aria-label="Square">
<img src="/assets/images/logo-square.svg" alt="Square" />
</a>
</div>
<div class="trusted__block">
<a href="https://kickstarter.com" aria-label="Kickstarter">
<img src="/assets/images/logo-kickstarter.svg" alt="Kickstarter" />
</a>
</div>
<div class="trusted__block">
<a href="https://heroku.com" aria-label="Heroku">
<img src="/assets/images/logo-heroku.svg" alt="Heroku" />
</a>
</div>
<div class="trusted__block">
<a href="https://coinbase.com" aria-label="Coinbase">
<img src="/assets/images/logo-coinbase.svg" alt="Coinbase" />
</a>
</div>
<div class="trusted__block">
<a href="https://soundcloud.com" aria-label="Soundcloud">
<img src="/assets/images/logo-soundcloud.svg" alt="Soundcloud" />
</a>
</div>
<div class="trusted__block">
<a href="https://cookpad.com" aria-label="Cookpad">
<img src="/assets/images/logo-cookpad.svg" alt="Cookpad" />
</a>
</div>
<div class="trusted__block">
<a href="https://www.doximity.com" aria-label="Doximity">
<img src="/assets/images/logo-doximity.svg" alt="Doximity" />
</a>
</div>
<div class="trusted__block">
<a href="https://www.intercom.com" aria-label="Intercom">
<img src="/assets/images/logo-intercom.svg" alt="Intercom" />
</a>
</div>
<div class="trusted__block">
<a href="https://www.fleetio.com" aria-label="Fleetio">
<img src="/assets/images/logo-fleetio.svg" alt="Fleetio" />
</a>
</div>
<div class="trusted__block">
<a href="https://li.me" aria-label="Lime">
<img src="/assets/images/logo-lime.svg" alt="Lime" />
</a>
</div>
<div class="trusted__block">
<a href="https://www.freeagent.com/" aria-label="FreeAgent">
<img src="/assets/images/logo-freeagent.svg" alt="FreeAgent" />
</a>
</div>
</div>
</div>
</div>
<div class="text text--align-center common-padding--bottom">
<div class="container">
<div class="text__body">
<div class="text__content common-content common-content--size-large">
<p><strong>These are just a few of the big names.</strong> There have been many hundreds of thousands of apps created with Rails since its inception.</p>
</div>
</div>
</div>
</div>
<div class="heading common-background--grey common-border--top common-padding--bottom common-padding--top">
<div class="container">
<div class="heading__body">
<div class="heading__headline common-headline">
<h1>Building it together.</h1>
<h4>Over six thousand people have <a href="https://contributors.rubyonrails.org">contributed code to Rails</a>, and many more have served the community through evangelism, documentation, and bug reports. Join us!</h4>
</div>
<div class="heading__button">
<a href="/community" class="common-button common-button--text common-button--icon-arrow"><span>Meet the Rails team</span></a>
</div>
</div>
</div>
</div>
<div class="heading heading--frame-white common-padding--bottom common-shape--top-grey-down-left">
<div class="container">
<div class="heading__body">
<div class="heading__headline common-headline">
<h1>Everything you need.</h1>
<h4><strong>Rails is a full-stack framework.</strong> It ships with all the tools needed to build amazing web apps on both the front and back end.</h4>
</div>
<div class="heading__content heading__content--has-headline common-content common-content--size-large">
<p>Rendering HTML templates, updating databases, sending and receiving emails, maintaining live pages via WebSockets, enqueuing jobs for asynchronous work, storing uploads in the cloud, providing solid security protections for common attacks. Rails does it all and so much more.</p>
</div>
</div>
</div>
</div>
<div class="example common-background--grey common-padding--bottom common-shape--top-white-down-right">
<div class="container">
<div class="example__body">
<div class="example__block example__block--align-left">
<div class="example__code common-code">
<h6>app/models/article.rb</h6>
{% highlight ruby %}
class Article < ApplicationRecord
belongs_to :author, default: -> { Current.user }
has_many :comments
has_one_attached :cover_image
has_rich_text :content, encrypted: true
enum status: %i[ drafted published ]
scope :recent, -> { order(created_at: :desc).limit(25) }
after_save_commit :deliver_later, if: :published?
def byline
"Written by #{author.name} on #{created_at.to_s(:short)}"
end
def deliver_later
Article::DeliveryJob.perform_later(self)
end
end
{% endhighlight %}
</div>
<div class="example__content common-content">
<h3>Active Records make modeling easy.</h3>
<p>Databases come to life with business logic encapsulated in rich objects. Modeling associations between tables, providing callbacks when saved, encrypting sensitive data seamlessly, and expressing SQL queries beautifully.</p>
</div>
</div>
<div class="example__block example__block--align-left">
<div class="example__code common-code">
<h6>app/controllers/articles_controller.rb</h6>
{% highlight ruby %}
class ArticlesController < ApplicationController
def index
@articles = Article.recent
end
def show
@article = Article.find(params[:id])
fresh_when etag: @article
end
def create
article = Article.create!(article_params)
redirect_to article
end
private
def article_params
params.require(:article).permit(:title, :content)
end
end
{% endhighlight %}
</div>
<div class="example__content common-content">
<h3>Action Controllers handle all requests.</h3>
<p>Controllers expose the domain model to the web, process incoming parameters, set caching headers, and render templates, responding with either HTML or JSON.</p>
</div>
</div>
<div class="example__block example__block--align-left">
<div class="example__code common-code">
<h6>app/views/articles/show.html.erb</h6>
{% highlight erb %}
<h1><%= @article.title %></h1>
<%= image_tag @article.cover_image.url %>
<p><%= @article.content %></p>
<%= link_to "Edit", edit_article_path(@article) if Current.user.admin? %>
{% endhighlight %}
</div>
<div class="example__content common-content">
<h3>Action Views mix Ruby and HTML.</h3>
<p>Templates can use the full versatility of Ruby, excessive code is extracted into helpers, and the domain model is used directly and interwoven with the HTML.</p>
</div>
</div>
<div class="example__block example__block--align-left">
<div class="example__code common-code">
<h6>config/routes.rb</h6>
{% highlight ruby %}
Rails.application.routes.draw do
resources :articles do # /articles, /articles/1
resources :comments # /articles/1/comments, /comments/1
end
root to: "articles#index" # /
end
{% endhighlight %}
</div>
<div class="example__content common-content">
<h3>Action Dispatch routes URLs.</h3>
<p>Configure how URLs connect to the controllers using the routing domain language. Routes expose the bundle of actions that go together as a resource: index, show, new, create, edit, update, destroy.</p>
</div>
</div>
</div>
</div>
</div>
<div class="heading heading--frame-white common-background--grey common-shape--bottom-white-up-left">
<div class="container">
<div class="heading__body">
<div class="heading__headline common-headline">
<h1>Optimized for happiness.</h1>
</div>
<div class="heading__content heading__content--has-headline common-content common-content--size-large">
<p>Rails has united and cultivated a strong tribe around a <strong>wide set of heretical thoughts</strong> about the nature of programming and programmers. Understanding these thoughts will help you understand the design of the framework.</p>
</div>
<div class="heading__button">
<a href="/doctrine" class="common-button common-button--text common-button--icon-arrow"><span>Read the Rails Doctrine</span></a>
</div>
</div>
</div>
</div>
<div class="heading common-padding--bottom-small common-padding--top">
<div class="container">
<div class="heading__body">
<div class="heading__headline common-headline">
<h1>Let’s get started.</h1>
</div>
</div>
</div>
</div>
<div class="cards common-padding--bottom-small">
<div class="container">
<div class="cards__container">
<div class="card">
<a href="https://guides.rubyonrails.org">
<div class="card__body">
<div class="card__label">
<h6>Learning</h6>
</div>
<div class="card__headline">
<h3>Read the guides.</h3>
</div>
<div class="card__content">
<p>Learn what the frameworks can do and how they fit together.</p>
</div>
</div>
</a>
</div>
<div class="card">
<a href="https://github.com/rails/rails">
<div class="card__body">
<div class="card__label">
<h6>Contributing</h6>
</div>
<div class="card__headline">
<h3>Contribute on GitHub.</h3>
</div>
<div class="card__content">
<p>File bug reports and make pull-requests.</p>
</div>
</div>
</a>
</div>
<div class="card">
<a href="/blog">
<div class="card__body">
<div class="card__label">
<h6>Keeping up</h6>
</div>
<div class="card__headline">
<h3>See what’s new.</h3>
</div>
<div class="card__content">
<p>The latest releases and updates on development.</p>
</div>
</div>
</a>
</div>
</div>
</div>
</div>
<div class="text text--align-center common-padding--bottom">
<div class="container">
<div class="text__body">
<div class="text__content common-content common-content--size-large">
<p>Learn more about <a href="https://hotwired.dev">Hotwire</a>, the default front-end framework for Rails.</p>
<p><strong>Stay up to date</strong> with Rails on <a href="https://twitter.com/rails" class="icon icon--twitter">Twitter</a>, <a href="https://www.youtube.com/@railsofficial" class="icon icon--youtube">YouTube</a>, and <a href="https://world.hey.com/this.week.in.rails" class="icon icon--world">This Week in Rails</a>.</p>
</div>
</div>
</div>
</div>