Class: Dominium::CountriesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Dominium::CountriesController
- Defined in:
- app/controllers/dominium/countries_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /dominium/countries POST /dominium/countries.json.
-
#destroy ⇒ Object
DELETE /dominium/countries/1 DELETE /dominium/countries/1.json.
-
#edit ⇒ Object
GET /dominium/countries/1/edit.
-
#index ⇒ Object
GET /dominium/countries GET /dominium/countries.json.
-
#new ⇒ Object
GET /dominium/countries/new GET /dominium/countries/new.json.
-
#show ⇒ Object
GET /dominium/countries/1 GET /dominium/countries/1.json.
-
#update ⇒ Object
PUT /dominium/countries/1 PUT /dominium/countries/1.json.
Instance Method Details
#create ⇒ Object
POST /dominium/countries POST /dominium/countries.json
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/dominium/countries_controller.rb', line 28 def create @dominium_country = Dominium::Country.new(params[:dominium_country]) respond_to do |format| if @dominium_country.save format.html { redirect_to @dominium_country, notice: 'Country was successfully created.' } format.json { render json: @dominium_country, status: :created, location: @dominium_country } else format.html { render action: "new" } format.json { render json: @dominium_country.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /dominium/countries/1 DELETE /dominium/countries/1.json
60 61 62 63 64 |
# File 'app/controllers/dominium/countries_controller.rb', line 60 def destroy @dominium_country = Dominium::Country.find(params[:id]) @dominium_country.destroy redirect_to dominium_countries_path, notice: 'Country was sucessfuly deleted' end |
#edit ⇒ Object
GET /dominium/countries/1/edit
22 23 24 |
# File 'app/controllers/dominium/countries_controller.rb', line 22 def edit @dominium_country = Dominium::Country.find(params[:id]) end |
#index ⇒ Object
GET /dominium/countries GET /dominium/countries.json
5 6 7 |
# File 'app/controllers/dominium/countries_controller.rb', line 5 def index @dominium_countries = Dominium::Country.all end |
#new ⇒ Object
GET /dominium/countries/new GET /dominium/countries/new.json
17 18 19 |
# File 'app/controllers/dominium/countries_controller.rb', line 17 def new @dominium_country = Dominium::Country.new end |
#show ⇒ Object
GET /dominium/countries/1 GET /dominium/countries/1.json
11 12 13 |
# File 'app/controllers/dominium/countries_controller.rb', line 11 def show @dominium_country = Dominium::Country.find(params[:id]) end |
#update ⇒ Object
PUT /dominium/countries/1 PUT /dominium/countries/1.json
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'app/controllers/dominium/countries_controller.rb', line 44 def update @dominium_country = Dominium::Country.find(params[:id]) respond_to do |format| if @dominium_country.update_attributes(params[:dominium_country]) format.html { redirect_to @dominium_country, notice: 'Country was successfully updated.' } format.json { head :ok } else format.html { render action: "edit" } format.json { render json: @dominium_country.errors, status: :unprocessable_entity } end end end |