aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2017-07-06 16:34:34 +0200
committerGitHub <noreply@github.com>2017-07-06 16:34:34 +0200
commit4f30570bd6cd122a7e7839eed4fc9531db600496 (patch)
tree254e3c2592f6ad39be53b3491c05a6df3f3780b2 /README.md
parent37f7cf8daf0faaf90e6b5548244e6038097097b3 (diff)
parent7bd2b3aaa2ec1133025473c78437482ff94c6ea9 (diff)
downloadrails-4f30570bd6cd122a7e7839eed4fc9531db600496.tar.gz
rails-4f30570bd6cd122a7e7839eed4fc9531db600496.tar.bz2
rails-4f30570bd6cd122a7e7839eed4fc9531db600496.zip
Merge pull request #3 from adrianpacala/format-readme-examples
Use correct syntax highlighting in erb block
Diffstat (limited to 'README.md')
-rw-r--r--README.md6
1 files changed, 5 insertions, 1 deletions
diff --git a/README.md b/README.md
index bb14d9df0f..ab01df471e 100644
--- a/README.md
+++ b/README.md
@@ -35,15 +35,19 @@ Many attachments:
class Message < ApplicationRecord
has_many_attached :images
end
+```
+```erb
<%= form_with model: @message do |form| %>
<%= form.text_field :title, placeholder: "Title" %><br>
<%= form.text_area :content %><br><br>
-
+
<%= form.file_field :images, multiple: true %><br>
<%= form.submit %>
<% end %>
+```
+```ruby
class MessagesController < ApplicationController
def create
message = Message.create! params.require(:message).permit(:title, :content)