<%= form_for(@image) do |f| %> <%= f.file_field :file,accept: “image/jpeg” %> <%= f.submit “アップロードする” %> <% end %> class ImagesController < ApplicationController def index @images = Image.limit(20) end def new @image = Image.new end def create upload_file = image_params[:file] image = {} if upload_file != nil image[:filename] = upload_file.original_filename image[:file] = upload_file.read end @ima