fixed 节点库接口
This commit is contained in:
		
							parent
							
								
									c014857cf5
								
							
						
					
					
						commit
						3c3ff13ab0
					
				| 
						 | 
				
			
			@ -4,6 +4,10 @@ class Action::NodeTypesController < ApplicationController
 | 
			
		|||
 | 
			
		||||
  def index
 | 
			
		||||
    @node_types = Action::NodeType.all
 | 
			
		||||
    respond_to do |format|
 | 
			
		||||
      format.html
 | 
			
		||||
      format.json { render_ok(data: @node_types.as_json) }
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def create
 | 
			
		||||
| 
						 | 
				
			
			@ -20,7 +24,10 @@ class Action::NodeTypesController < ApplicationController
 | 
			
		|||
  end
 | 
			
		||||
 | 
			
		||||
  def show
 | 
			
		||||
 | 
			
		||||
    respond_to do |format|
 | 
			
		||||
      format.html
 | 
			
		||||
      format.json { render_ok(data: @node_type.as_json) }
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def new
 | 
			
		||||
| 
						 | 
				
			
			@ -45,7 +52,10 @@ class Action::NodeTypesController < ApplicationController
 | 
			
		|||
    else
 | 
			
		||||
      flash[:danger] = '删除失败'
 | 
			
		||||
    end
 | 
			
		||||
    redirect_to action_node_types_path
 | 
			
		||||
    respond_to do |format|
 | 
			
		||||
      format.html { redirect_to action_node_types_path }
 | 
			
		||||
      format.json { render_ok }
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  private
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,7 +58,10 @@ class Action::NodesController < ApplicationController
 | 
			
		|||
    else
 | 
			
		||||
      flash[:danger] = '删除失败'
 | 
			
		||||
    end
 | 
			
		||||
    redirect_to action_nodes_path
 | 
			
		||||
    respond_to do |format|
 | 
			
		||||
      format.html { redirect_to action_nodes_path }
 | 
			
		||||
      format.json { render_ok() }
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  private
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,7 +49,10 @@ class Action::TemplatesController < ApplicationController
 | 
			
		|||
    else
 | 
			
		||||
      flash[:danger] = '删除失败'
 | 
			
		||||
    end
 | 
			
		||||
    redirect_to action_templates_path
 | 
			
		||||
    respond_to do |format|
 | 
			
		||||
      format.html { redirect_to action_templates_path }
 | 
			
		||||
      format.json { render_ok }
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  private
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue