2014-11-01 83 views
0
<h3>Create Your Pokemon!</h3> 
<%= simple_form_for @pokemon do |p|, :url => pokemon_path(id: @pokemon) %> 
    <%= p.input :name, placeholder:'Pikacharmander' %> 
    <%= p.button :submit,'Create' %> 
<% end %> 

我的代碼是像上面,但結束輸入我每次運行它,我得到這個錯誤導軌:語法錯誤,意想不到的keyword_ensure,期待

syntax error, unexpected ',' 
...imple_form_for @pokemon do |p|, :url => pokemon_path(id: @po... 

誰能幫助我?

+0

試試這個<%= simple_form_for @pokemon,:URL => pokemon_path(ID:@pokemon)做| P | %> – 2014-11-01 05:19:11

回答

0

嘗試以下修正: -

<h3>Create Your Pokemon!</h3> 
<%= simple_form_for @pokemon, :url => pokemon_path(id: @pokemon) do |p| %> 
    <%= p.input :name, placeholder:'Pikacharmander' %> 
    <%= p.button :submit,'Create' %> 
<% end %> 
+0

它的工作原理!非常感謝! – infinityplus1 2014-11-01 05:25:13

相關問題