简体   繁体   English

没有路由匹配[GET]错误

[英]No route matches [GET] error

new to rails (and programming) here. 这里是rails(和编程)的新手。 I am having an error in my app when uploading a photo, in which the broken photo icon appears and the image is set to "/images/medium/missing.png" 上传照片时我的应用中出现错误,其中显示损坏的照片图标,图像设置为“/images/medium/missing.png”

I have ImageMagick and Paperclip set up, migrations done, everything seems to be in order, no errors except for this. 我已经设置了ImageMagick和Paperclip,完成了迁移,一切似乎都井然有序,除此之外没有任何错误。 And it does not actually give an error, the upload seems to go through but it just shows the broken photo icon. 它实际上并没有给出错误,上传似乎已经完成,但它只是显示了破碎的照片图标。

Here is my routes.rb: 这是我的routes.rb:

  MyApp::Application.routes.draw do
  resources :pins

  devise_for :users
  root "pages#home"

  get "about" => "pages#about"
  get "team" => "pages#team"

not sure what else might help to provide just let me know. 不确定还有什么可以提供让我知道。

User Model : 用户模型:

class User < ActiveRecord::Base

devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable 设计:database_authenticatable,:registerable,:recoverable,:rememberable,:trackable,:validatable

has_many :pins

end 结束

GOT IT!!!! 得到它了!!!! In app / views / pins / _form.html.erb update f.file_field to: 在app / views / pins / _form.html.erb中将f.file_field更新为:

 <%= f.file_field :image, class: "form-control" %> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM