Displaying 1 result from an estimated 1 matches for "create_and_new".
2012 May 15
1
How to handle ActiveRecord::RecordInvalid
...end
    end
end
In finally here is the my controller:
  controller do
    def create
      category = Service::CategoryService.create(params[:category])
      if category
        flash[:notice] = "Category was successfully created."
        redirect_to params[:button] == "create_and_new" ? new_admin_category_url : admin_categories_url
      else
        render active_admin_template(''new.html.erb'')
      end
    end
  end # end controller
How to solve it? Please help me.
-- 
You received this message because you are subscribed to the Google Groups "Rub...