Class: Droom::DocumentsController
- Inherits:
-
EngineController
- Object
- ApplicationController
- EngineController
- Droom::DocumentsController
- Defined in:
- app/controllers/droom/documents_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Methods inherited from EngineController
Instance Method Details
#create ⇒ Object
29 30 31 32 |
# File 'app/controllers/droom/documents_controller.rb', line 29 def create @document.save! render :partial => 'created' end |
#destroy ⇒ Object
43 44 45 46 |
# File 'app/controllers/droom/documents_controller.rb', line 43 def destroy @document.destroy head :ok end |
#edit ⇒ Object
34 35 36 |
# File 'app/controllers/droom/documents_controller.rb', line 34 def edit render end |
#index ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/controllers/droom/documents_controller.rb', line 9 def index @documents = @documents.matching(params[:q]) unless params[:q].blank? @documents = paginated(@documents) respond_with @documents do |format| format.js { render :partial => 'droom/documents/documents' } end end |
#new ⇒ Object
25 26 27 |
# File 'app/controllers/droom/documents_controller.rb', line 25 def new render end |
#show ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/controllers/droom/documents_controller.rb', line 17 def show if @document.file redirect_to @document.file.expiring_url(Time.now + 600) else raise ActiveRecord::RecordNotFound end end |
#update ⇒ Object
38 39 40 41 |
# File 'app/controllers/droom/documents_controller.rb', line 38 def update @document.save! render :partial => 'listing', :object => @document.with_event end |