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