Class: WysihatFilesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- WysihatFilesController
- Defined in:
- app/controllers/wysihat_files_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/wysihat_files_controller.rb', line 7 def create @wysihat_file = WysihatFile.new(params[:wysihat_file]) responds_to_parent do render :update do |page| if(@wysihat_file.save) page.insert_html :bottom, :wysihat_files, :partial => 'wysihat_file', :object => @wysihat_file end end end end |
#destroy ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/wysihat_files_controller.rb', line 19 def destroy @wysihat_file = WysihatFile.find(params[:id]) respond_to do |wants| wants.js { render :update do |page| page.remove "wysihat_file_#{@wysihat_file.id}" end } end @wysihat_file.destroy end |
#index ⇒ Object
2 3 4 5 |
# File 'app/controllers/wysihat_files_controller.rb', line 2 def index @wysihat_file, @wysihat_files = WysihatFile.new, WysihatFile.all render :layout => false end |