Class: Admin::SmsOnRails::PhoneCarriersController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::SmsOnRails::PhoneCarriersController
- Defined in:
- app/controllers/admin/sms_on_rails/phone_carriers_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /admin/sms/phone_carriers POST /admin/sms/phone_carriers.xml.
-
#destroy ⇒ Object
DELETE /admin/sms/phone_carriers/1 DELETE /admin/sms/phone_carriers/1.xml.
-
#edit ⇒ Object
GET /admin/sms/phone_carriers/1/edit.
-
#index ⇒ Object
GET /admin/sms/phone_carriers GET /admin/sms/phone_carriers.xml.
-
#new ⇒ Object
GET /admin/sms/phone_carriers/new GET /admin/sms/phone_carriers/new.xml.
-
#show ⇒ Object
GET /admin/sms/phone_carriers/1 GET /admin/sms/phone_carriers/1.xml.
-
#update ⇒ Object
PUT /admin/sms/phone_carriers/1 PUT /admin/sms/phone_carriers/1.xml.
Instance Method Details
#create ⇒ Object
POST /admin/sms/phone_carriers POST /admin/sms/phone_carriers.xml
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/controllers/admin/sms_on_rails/phone_carriers_controller.rb', line 42 def create @phone_carrier = SmsOnRails::PhoneCarrier.new(params[:phone_carrier]) respond_to do |format| if @phone_carrier.save flash[:notice] = 'PhoneCarrier was successfully created.' format.html { redirect_to(sms_phone_carrier_url(:id => @phone_carrier)) } format.xml { render :xml => @phone_carrier, :status => :created, :location => @phone_carrier } else format.html { render :action => "new" } format.xml { render :xml => @phone_carrier.errors, :status => :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /admin/sms/phone_carriers/1 DELETE /admin/sms/phone_carriers/1.xml
76 77 78 79 80 81 82 83 84 |
# File 'app/controllers/admin/sms_on_rails/phone_carriers_controller.rb', line 76 def destroy @phone_carrier = SmsOnRails::PhoneCarrier.find(params[:id]) @phone_carrier.destroy respond_to do |format| format.html { redirect_to(sms_phone_carriers_url) } format.xml { head :ok } end end |
#edit ⇒ Object
GET /admin/sms/phone_carriers/1/edit
36 37 38 |
# File 'app/controllers/admin/sms_on_rails/phone_carriers_controller.rb', line 36 def edit @phone_carrier = SmsOnRails::PhoneCarrier.find(params[:id]) end |
#index ⇒ Object
GET /admin/sms/phone_carriers GET /admin/sms/phone_carriers.xml
4 5 6 7 8 9 10 11 |
# File 'app/controllers/admin/sms_on_rails/phone_carriers_controller.rb', line 4 def index @phone_carriers = SmsOnRails::PhoneCarrier.all :group => :name respond_to do |format| format.html # index.html.erb format.xml { render :xml => @phone_carriers } end end |
#new ⇒ Object
GET /admin/sms/phone_carriers/new GET /admin/sms/phone_carriers/new.xml
26 27 28 29 30 31 32 33 |
# File 'app/controllers/admin/sms_on_rails/phone_carriers_controller.rb', line 26 def new @phone_carrier = SmsOnRails::PhoneCarrier.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @phone_carrier } end end |
#show ⇒ Object
GET /admin/sms/phone_carriers/1 GET /admin/sms/phone_carriers/1.xml
15 16 17 18 19 20 21 22 |
# File 'app/controllers/admin/sms_on_rails/phone_carriers_controller.rb', line 15 def show @phone_carrier = SmsOnRails::PhoneCarrier.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @phone_carrier } end end |
#update ⇒ Object
PUT /admin/sms/phone_carriers/1 PUT /admin/sms/phone_carriers/1.xml
59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'app/controllers/admin/sms_on_rails/phone_carriers_controller.rb', line 59 def update @phone_carrier = SmsOnRails::PhoneCarrier.find(params[:id]) respond_to do |format| if @phone_carrier.update_attributes(params[:phone_carrier]) flash[:notice] = 'PhoneCarrier was successfully updated.' format.html { redirect_to(sms_phone_carrier_url(:id => @phone_carrier)) } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @phone_carrier.errors, :status => :unprocessable_entity } end end end |