我有一个“新”表单,在一个后期模型中得到验证.验证器启动时,它不正确地呈现.
新的信息页路径位于’/ posts / new’
在验证时,新的页面路径是’/ posts’..我需要返回’/ posts / new’.
这是我的控制器
- def create
- @post = current_user.posts.build(params[:post])
- if @post.save
- redirect_to public_post_page_path(@post.public_url)
- else
- render :action => :new
- end
- end
我有一种感觉可能与我的表格有关.所以这里是formtastic第一行:
- <%= semantic_form_for [:student,post],:html => {:id => "post_form"} do |form| %>