Class: Databaseformalizer::AttrValsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Databaseformalizer::AttrValsController
- Defined in:
- app/controllers/databaseformalizer/attr_vals_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /attr_vals POST /attr_vals.json.
-
#destroy ⇒ Object
DELETE /attr_vals/1 DELETE /attr_vals/1.json.
-
#edit ⇒ Object
GET /attr_vals/1/edit.
-
#index ⇒ Object
GET /attr_vals GET /attr_vals.json.
-
#new ⇒ Object
GET /attr_vals/new GET /attr_vals/new.json.
-
#show ⇒ Object
GET /attr_vals/1 GET /attr_vals/1.json.
-
#update ⇒ Object
PUT /attr_vals/1 PUT /attr_vals/1.json.
Instance Method Details
#create ⇒ Object
POST /attr_vals POST /attr_vals.json
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/controllers/databaseformalizer/attr_vals_controller.rb', line 43 def create @attr_val = AttrVal.new(params[:databaseformalizer_attr_val]) respond_to do |format| if @attr_val.save format.html { redirect_to @attr_val, notice: 'Attr val was successfully created.' } format.json { render json: @attr_val, status: :created, location: @attr_val } else format.html { render action: "new" } format.json { render json: @attr_val.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /attr_vals/1 DELETE /attr_vals/1.json
75 76 77 78 79 80 81 82 83 |
# File 'app/controllers/databaseformalizer/attr_vals_controller.rb', line 75 def destroy @attr_val = AttrVal.find(params[:id]) @attr_val.destroy respond_to do |format| format.html { redirect_to databaseformalizer_attr_vals_url } format.json { head :no_content } end end |
#edit ⇒ Object
GET /attr_vals/1/edit
37 38 39 |
# File 'app/controllers/databaseformalizer/attr_vals_controller.rb', line 37 def edit @attr_val = AttrVal.find(params[:id]) end |
#index ⇒ Object
GET /attr_vals GET /attr_vals.json
5 6 7 8 9 10 11 12 |
# File 'app/controllers/databaseformalizer/attr_vals_controller.rb', line 5 def index @attr_vals = AttrVal.all respond_to do |format| format.html # index.html.erb format.json { render json: @attr_vals } end end |
#new ⇒ Object
GET /attr_vals/new GET /attr_vals/new.json
27 28 29 30 31 32 33 34 |
# File 'app/controllers/databaseformalizer/attr_vals_controller.rb', line 27 def new @attr_val = AttrVal.new respond_to do |format| format.html # new.html.erb format.json { render json: @attr_val } end end |
#show ⇒ Object
GET /attr_vals/1 GET /attr_vals/1.json
16 17 18 19 20 21 22 23 |
# File 'app/controllers/databaseformalizer/attr_vals_controller.rb', line 16 def show @attr_val = AttrVal.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @attr_val } end end |
#update ⇒ Object
PUT /attr_vals/1 PUT /attr_vals/1.json
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'app/controllers/databaseformalizer/attr_vals_controller.rb', line 59 def update @attr_val = AttrVal.find(params[:id]) respond_to do |format| if @attr_val.update_attributes(params[:databaseformalizer_attr_val]) format.html { redirect_to @attr_val, notice: 'Attr val was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @attr_val.errors, status: :unprocessable_entity } end end end |