Class: Fastui::MMenusController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Fastui::MMenusController
- Defined in:
- app/controllers/fastui/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
27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/fastui/m_menus_controller.rb', line 27 def create = MMenu.new(params[:m_menu]) 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
51 52 53 54 55 |
# File 'app/controllers/fastui/m_menus_controller.rb', line 51 def destroy = MMenu.find(params[:id]) .destroy respond_with() end |
#edit ⇒ Object
17 18 19 20 |
# File 'app/controllers/fastui/m_menus_controller.rb', line 17 def edit = MMenu.find(params[:id]) respond_with(.to_json(:include => [:createdbyorg, :createdby, :updatedby])) end |
#index ⇒ Object
6 7 8 9 10 |
# File 'app/controllers/fastui/m_menus_controller.rb', line 6 def index = MMenu.scoped data = paginate() respond_with(data.to_json(:include => [:m_menu_items,:createdbyorg, :createdby, :updatedby])) end |
#new ⇒ Object
22 23 24 25 |
# File 'app/controllers/fastui/m_menus_controller.rb', line 22 def new = MMenu.new respond_with() end |
#show ⇒ Object
12 13 14 15 |
# File 'app/controllers/fastui/m_menus_controller.rb', line 12 def show = MMenu.find(params[:id]) respond_with() end |
#update ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/controllers/fastui/m_menus_controller.rb', line 39 def update = MMenu.find(params[:id]) respond_with() do |format| if .update_attributes(params[:m_menu]) format.json { render :json => {:success => true, :msg => 'ok'} } else format.json { render :json => {:success => false, :msg => 'false'} } end end end |