aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
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)