活动的管理员渲染编辑页面 [英] active admin render edit page
本文介绍了活动的管理员渲染编辑页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以轻松地重定向,但是我想在验证失败时渲染编辑页面,因此我将所有验证方法都保留到表单中。我不确定如何使用active_admin呈现编辑操作。
I can easily redirect but I'd like to do a render the edit page on validation failure so I carry over all the validation methods into the form. I'm not sure how to render the edit action using active_admin.
如果我尝试 render:action => 'edit'
我缺少模板页面
我也尝试过 render active_admin_template('edit.html.arb')
If I try render :action => 'edit'
I get a template missing page
I also tried render active_admin_template('edit.html.arb')
which gives me a page within a page, but no errors.
有什么想法吗?
member_action :state do
space = Space.find(params[:id])
if space.send(params[:state])
#space.send(params[:state]+"!")
flash[:notice] = "State Changed!"
redirect_to :action => :index
else
#render :action => 'edit'
#render active_admin_template('edit.html.arb')
flash[:error] = "#{space.errors}"
redirect_to :action => :edit
end
end
推荐答案
您是否尝试过?
render active_admin_template('edit.html.arb'), :layout => false
这篇关于活动的管理员渲染编辑页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文