Class: Admin::AttachmentsController
- Inherits:
-
ResourceController
- Object
- ResourceController
- Admin::AttachmentsController
- Includes:
- UploadHandler
- Defined in:
- app/controllers/admin/attachments_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
-
#index ⇒ Object
Gets called after successful update only used when attachment update form not submitted using javascript.
- #positions ⇒ Object
Instance Method Details
#create ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/controllers/admin/attachments_controller.rb', line 5 def create rendering_upload_response do @page = Page.find(params[:page_id]) = @page..create!(params[:attachment]) render_to_string(:partial => 'admin/assets/attachment', :locals => {:attachment => }) end end |
#index ⇒ Object
Gets called after successful update only used when attachment update form not submitted using javascript
15 16 17 |
# File 'app/controllers/admin/attachments_controller.rb', line 15 def index redirect_to edit_admin_page_path(params[:page_id]) end |
#positions ⇒ Object
19 20 21 |
# File 'app/controllers/admin/attachments_controller.rb', line 19 def positions render :json => Attachment.reorder(params[:attachment]) end |