Class: FastExt::MHelpsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- FastExt::MHelpsController
- Defined in:
- app/controllers/fast_ext/m_helps_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
31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/fast_ext/m_helps_controller.rb', line 31 def create @m_help = MHelp.new(params[:m_help].permit!) respond_with(@m_help) do |format| if @m_help.save format.json { render :json => {:success => true, :msg => 'ok'} } else format.json { render :json => {:success => false, :msg => 'failure'} } end end end |
#destroy ⇒ Object
55 56 57 58 59 |
# File 'app/controllers/fast_ext/m_helps_controller.rb', line 55 def destroy #@m_help = MHelp.find(params[:id]) @m_help.destroy respond_with(@m_help) end |
#edit ⇒ Object
21 22 23 24 |
# File 'app/controllers/fast_ext/m_helps_controller.rb', line 21 def edit #@m_help = MHelp.find(params[:id]) respond_with(@m_help) end |
#index ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/controllers/fast_ext/m_helps_controller.rb', line 8 def index @m_helps = MHelp.where({ :name => params[:name] }.delete_if {|k, v| v.blank? }) data = paginate(@m_helps) respond_with(data.to_json()) end |
#new ⇒ Object
26 27 28 29 |
# File 'app/controllers/fast_ext/m_helps_controller.rb', line 26 def new @m_help = MHelp.new respond_with(@m_help) end |
#show ⇒ Object
16 17 18 19 |
# File 'app/controllers/fast_ext/m_helps_controller.rb', line 16 def show #@m_help = MHelp.find(params[:id]) respond_with(@m_help) end |
#update ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 |
# File 'app/controllers/fast_ext/m_helps_controller.rb', line 43 def update #@m_help = MHelp.find(params[:id]) respond_with(@m_help) do |format| if @m_help.update_attributes(params[:m_help].permit!) format.json { render :json => {:success => true, :msg => 'ok'} } else format.json { render :json => {:success => false, :msg => 'false'} } end end end |