Skip to content

Instantly share code, notes, and snippets.

@satomixx
Created March 26, 2015 09:57
Show Gist options
  • Save satomixx/e9ae501ef035ab08e4ca to your computer and use it in GitHub Desktop.
Save satomixx/e9ae501ef035ab08e4ca to your computer and use it in GitHub Desktop.
[Rails4.x] simple_formを使って、create(登録)とupdate(編集)で同じformを使う際の注意 ref: http://qiita.com/tsumekoara/items/b78d4ba9dbf6cfe93c4f
Routing Error No route matches [PATCH] “/hoge"
<%= simple_form_for(@hoge, :url => hoges_path, :html => {:id => 'hoge_form', :multiport => true}) do |f| %>
<%= simple_form_for(@hoge, :html => {:id => 'hoge_form', :multiport => true}) do |f| %>
POST /hoge(.:format) hoge#create
PATCH /hoge/:id(.:format) hoge#update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment