diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-06 16:34:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-06 16:34:34 +0200 |
commit | 4f30570bd6cd122a7e7839eed4fc9531db600496 (patch) | |
tree | 254e3c2592f6ad39be53b3491c05a6df3f3780b2 /README.md | |
parent | 37f7cf8daf0faaf90e6b5548244e6038097097b3 (diff) | |
parent | 7bd2b3aaa2ec1133025473c78437482ff94c6ea9 (diff) | |
download | rails-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.md | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) |