Tag: renderaction

活动管理员渲染编辑页面

我可以很容易地重定向,但我想在validation失败时渲染编辑页面,所以我将所有validation方法都转移到表单中。 我不确定如何使用active_admin呈现编辑操作。 如果我尝试render :action => ‘edit’我得到一个模板缺少页面我也尝试render active_admin_template(‘edit.html.arb’) ,它给了我一个页面内的页面,但没有错误。 有任何想法吗? 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