2014-11-01 82 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

相关问题