知识点:form_for后面的参数

Published on:

在new.html.erb或者edit.html.erb中,form_for后面的controller参数,如果是主目录下的jobs_controller.rb,那么后年的参数就是:

<%= simple_form_for @job do |f| %>

如果是子目录admin下的jobs_controller.rb,那么后面的参数就是:

<%= simple_form_for [:admin,@job] do |f| %>

Comments

comments powered by Disqus