Class: PhcdevworksRealEstate::Property::FeaturesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PhcdevworksRealEstate::Property::FeaturesController
- Defined in:
- app/controllers/phcdevworks_real_estate/property/features_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /property/features.
-
#destroy ⇒ Object
DELETE /property/features/1.
-
#edit ⇒ Object
GET /property/features/1/edit.
-
#index ⇒ Object
GET /property/features.
-
#new ⇒ Object
GET /property/features/new.
-
#show ⇒ Object
GET /property/features/1.
-
#update ⇒ Object
PATCH/PUT /property/features/1.
Instance Method Details
#create ⇒ Object
POST /property/features
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'app/controllers/phcdevworks_real_estate/property/features_controller.rb', line 32 def create @property_feature = Property::Feature.new(property_feature_params) @property_feature.user_id = current_user.id @property_feature.org_id = current_user.org_id respond_to do |format| if @property_feature.save format.html { redirect_to property_features_path, :flash => { :success => 'Property Feature has been Added.' }} format.json { render :show, status: :created, location: @property_feature } else format.html { render :new } format.json { render json: @property_feature.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /property/features/1
61 62 63 64 65 66 67 |
# File 'app/controllers/phcdevworks_real_estate/property/features_controller.rb', line 61 def destroy @property_feature.destroy respond_to do |format| format.html { redirect_to property_features_path, :flash => { :error => 'Property Feature has been Removed.' }} format.json { head :no_content } end end |
#edit ⇒ Object
GET /property/features/1/edit
28 29 |
# File 'app/controllers/phcdevworks_real_estate/property/features_controller.rb', line 28 def edit end |
#index ⇒ Object
GET /property/features
13 14 15 |
# File 'app/controllers/phcdevworks_real_estate/property/features_controller.rb', line 13 def index @property_features = Property::Feature.all end |
#new ⇒ Object
GET /property/features/new
23 24 25 |
# File 'app/controllers/phcdevworks_real_estate/property/features_controller.rb', line 23 def new @property_feature = Property::Feature.new end |
#show ⇒ Object
GET /property/features/1
18 19 20 |
# File 'app/controllers/phcdevworks_real_estate/property/features_controller.rb', line 18 def show @property_feature = Property::Feature.friendly.find(params[:id]) end |
#update ⇒ Object
PATCH/PUT /property/features/1
48 49 50 51 52 53 54 55 56 57 58 |
# File 'app/controllers/phcdevworks_real_estate/property/features_controller.rb', line 48 def update respond_to do |format| if @property_feature.update(property_feature_params) format.html { redirect_to property_features_path, :flash => { :notice => 'Property Feature has been Updated.' }} format.json { render :show, status: :ok, location: @property_feature } else format.html { render :edit } format.json { render json: @property_feature.errors, status: :unprocessable_entity } end end end |