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 @m_menu = MMenu.new() respond_with(@m_menu) do |format| if @m_menu.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]) @m_menu.destroy respond_with(@m_menu) 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(@m_menu.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 @m_menus = MMenu.all data = paginate(@m_menus) 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 @m_menu = MMenu.new respond_with(@m_menu) 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(@m_menu) 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(@m_menu) do |format| if @m_menu.update_attributes() format.json { render :json => {:success => true, :msg => 'ok'} } else format.json { render :json => {:success => false, :msg => 'false'} } end end end |