Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

active admin render edit page

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.

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.

Any ideas?

  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
like image 334
holden Avatar asked Oct 25 '11 11:10

holden


1 Answers

Have you tried this?

render active_admin_template('edit.html.arb'), :layout => false
like image 139
Brian D'Astous Avatar answered Sep 20 '22 23:09

Brian D'Astous