Class: Fastui::MListsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Fastui::MListsController
- Defined in:
- app/controllers/fastui/m_lists_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_lists_controller.rb', line 27 def create @m_list = MList.new(params[:m_list]) respond_with(@m_list) do |format| if @m_list.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_lists_controller.rb', line 51 def destroy @m_list = MList.find(params[:id]) @m_list.destroy respond_with(@m_list) end |
#edit ⇒ Object
17 18 19 20 |
# File 'app/controllers/fastui/m_lists_controller.rb', line 17 def edit @m_list = MList.find(params[:id]) respond_with(@m_list) end |
#index ⇒ Object
6 7 8 9 10 |
# File 'app/controllers/fastui/m_lists_controller.rb', line 6 def index @m_lists = MList.scoped data = paginate(@m_lists) respond_with(data.to_json(:include => [:m_list_items,:createdbyorg, :createdby, :updatedby])) end |
#new ⇒ Object
22 23 24 25 |
# File 'app/controllers/fastui/m_lists_controller.rb', line 22 def new @m_list = MList.new respond_with(@m_list) end |
#show ⇒ Object
12 13 14 15 |
# File 'app/controllers/fastui/m_lists_controller.rb', line 12 def show @m_list = MList.find(params[:id]) respond_with(@m_list) end |
#update ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/controllers/fastui/m_lists_controller.rb', line 39 def update @m_list = MList.find(params[:id]) respond_with(@m_list) do |format| if @m_list.update_attributes(params[:m_list]) format.json { render :json => {:success => true, :msg => 'ok'} } else format.json { render :json => {:success => false, :msg => 'false'} } end end end |