Class: FastExt::MMenusController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- FastExt::MMenusController
- Defined in:
- app/controllers/fast_ext/m_menus_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/fast_ext/m_menus_controller.rb', line 29 def create = MMenu.new() respond_with() do |format| if .save format.json { render :json => {:success => true, :msg => 'ok'} } else format.json { render :json => {:success => false, :msg => 'failure'} } end end end |
#destroy ⇒ Object
53 54 55 56 57 |
# File 'app/controllers/fast_ext/m_menus_controller.rb', line 53 def destroy #@m_menu = MMenu.find(params[:id]) .destroy respond_with() end |
#edit ⇒ Object
19 20 21 22 |
# File 'app/controllers/fast_ext/m_menus_controller.rb', line 19 def edit #@m_menu = MMenu.find(params[:id]) respond_with(.to_json(:include => [:createdbyorg, :createdby, :updatedby])) end |
#index ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/fast_ext/m_menus_controller.rb', line 8 def index = MMenu.all data = paginate() respond_with(data.to_json(:include => [:m_menu_items,:createdbyorg, :createdby, :updatedby])) end |
#new ⇒ Object
24 25 26 27 |
# File 'app/controllers/fast_ext/m_menus_controller.rb', line 24 def new = MMenu.new respond_with() end |
#show ⇒ Object
14 15 16 17 |
# File 'app/controllers/fast_ext/m_menus_controller.rb', line 14 def show #@m_menu = MMenu.find(params[:id]) respond_with() end |
#update ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 |
# File 'app/controllers/fast_ext/m_menus_controller.rb', line 41 def update #@m_menu = MMenu.find(params[:id]) respond_with() do |format| if .update_attributes() format.json { render :json => {:success => true, :msg => 'ok'} } else format.json { render :json => {:success => false, :msg => 'false'} } end end end |