Class: Neo4j::MetaModel::ModelsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Neo4j::MetaModel::ModelsController
- Defined in:
- app/controllers/neo4j/meta_model/models_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #meta_index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
37 38 39 40 41 |
# File 'app/controllers/neo4j/meta_model/models_controller.rb', line 37 def create record = @model.create(params[:data]) redirect_to action: :show, id: record.id end |
#destroy ⇒ Object
43 44 45 46 47 |
# File 'app/controllers/neo4j/meta_model/models_controller.rb', line 43 def destroy @record.destroy redirect_to action: :index, model: params[:model] end |
#edit ⇒ Object
24 25 |
# File 'app/controllers/neo4j/meta_model/models_controller.rb', line 24 def edit end |
#index ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/controllers/neo4j/meta_model/models_controller.rb', line 13 def index @records = @model.all.to_a respond_to do |format| format.html format.json { render json: @records, root: :records } end end |
#meta_index ⇒ Object
9 10 11 |
# File 'app/controllers/neo4j/meta_model/models_controller.rb', line 9 def @hierarchy = Model.order(:class_name).hierarchically end |
#new ⇒ Object
33 34 35 |
# File 'app/controllers/neo4j/meta_model/models_controller.rb', line 33 def new @record = @model.new end |
#show ⇒ Object
21 22 |
# File 'app/controllers/neo4j/meta_model/models_controller.rb', line 21 def show end |
#update ⇒ Object
27 28 29 30 31 |
# File 'app/controllers/neo4j/meta_model/models_controller.rb', line 27 def update @record.update_attributes(params[:data]) redirect_to action: :show end |