test = "string interpolation"
"Use #{test} when possible."
a = "really" "This" + a + "sucks"
b = {hello: "World"}
VariableTwo = 1 * 2
def some_method "foobar" end
get "/users/hello", to: "AdminController#goodbye",
as: :foobar
resources :students
# GET /students students#index
# GET /students/new students#new
# POST /students students#create
# GET /students/:id students#show
# GET /students/:id/edit students#edit
# PATCH/PUT /students/:id students#update
# DELETE /students/:id students#destroy
resources :students, only: [:show]
# GET /students/:id students#show
resources :emails do
# POST /emails/:id/archive emails#archive
member do
post :archive
end
# GET /emails/archived emails#archived
collection do
get :archived
end
end
<%= form_for @student do |f| %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= f.label :email %>
<%= f.text_field :email %>
<%= f.label :phone %>
<%= f.text_field :phone %>
<%= f.submit %>
<% end %>
<%= simple_form_for @student do |f| %>
<%= f.input :name %>
<%= f.input :email %>
<%= f.input :phone %>
<%= f.button :submit %>
<% end %>
<h1>Hey everyone!</h1>
<p>This is the <%= @somevar %> page.</p>
<%= simple_form_for @student do |f| %>
<%= f.input :name %>
<%= f.input :email %>
<%= f.input :phone %>
<%= f.button :submit %>
<% end %>
<div class="some-class" id="this-div">
We can do this easily in Slim.
</div>
<% if 5 * 4 == 20 %>
<div attr="yup">I can multiply.</div>
<% end %>
h1 Hey everyone!
p This is the #{@somevar} page.
= simple_form_for @student do |f|
= f.input :name
= f.input :email
= f.input :phone
= f.button :submit
.some-class#this-div
| We can do this easily in Slim.
- if 5 * 4 == 20
div attr="yup" I can multiply
home.html.erb
home.html.slim