'How to upload image to server because of controller without model in ruby on rails
I need to upload image to server folder through url( for example: wwww.example.com.folder/image
My photo_controller.rb
class PhotoController < ApplicationController
def index
require 'net/http'
require 'json'
end
end
My index.html.erb
<div>
<%= form_tag( method: "post", :multipart => true) do %>
<%= file_field_tag 'picture' %>
<p></p>
<%= submit_tag("Send",class: "btn btn-primary") %>
<% end %>
</div>
When I click Send, photo must be in folder(photo attached)enter image description here.May be I need to use json or other.
And of course without model Does anyone have any ideas?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
