Class: FoldersController
- Inherits:
- 
      CatalogController
      
        - Object
- CatalogController
- FoldersController
 
- Includes:
- Blacklight::Configurable, Blacklight::TokenBasedUser, Bpluser::FoldersVerifyUser
- Defined in:
- app/controllers/folders_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- 
  
    
      #public_list  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    return a list of publicly visible folders that have items. 
- 
  
    
      #search_action_url(options = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Blacklight uses #search_action_url to figure out the right URL for the global search box. 
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
| 44 45 46 47 48 49 50 51 52 53 | # File 'app/controllers/folders_controller.rb', line 44 def create @folder = current_user.folders.new(folder_params) if @folder.save flash[:notice] = t('blacklight.folders.create.success') redirect_to action: 'index' else render action: 'new' end end | 
#destroy ⇒ Object
| 65 66 67 68 69 70 | # File 'app/controllers/folders_controller.rb', line 65 def destroy # @folder is set by correct_user_for_folder @folder.destroy flash[:notice] = t('blacklight.folders.delete.success') redirect_to action: 'index' end | 
#edit ⇒ Object
| 42 | # File 'app/controllers/folders_controller.rb', line 42 def edit; end | 
#index ⇒ Object
| 26 27 28 | # File 'app/controllers/folders_controller.rb', line 26 def index @folders = current_or_guest_user.folders.with_folder_items if current_or_guest_user end | 
#new ⇒ Object
| 38 39 40 | # File 'app/controllers/folders_controller.rb', line 38 def new @folder = current_user.folders.build end | 
#public_list ⇒ Object
return a list of publicly visible folders that have items
| 73 74 75 | # File 'app/controllers/folders_controller.rb', line 73 def public_list @folders = Bpluser::Folder.public_list end | 
#search_action_url(options = {}) ⇒ Object
Blacklight uses #search_action_url to figure out the right URL for the global search box
| 14 15 16 | # File 'app/controllers/folders_controller.rb', line 14 def search_action_url( = {}) search_catalog_url(.except(:controller, :action)) end | 
#show ⇒ Object
| 30 31 32 33 34 35 36 | # File 'app/controllers/folders_controller.rb', line 30 def show # @folder is set by correct_user_for_folder @folder_items = @folder.folder_items folder_items_ids = @folder_items.pluck(:document_id) params[:sort] ||= 'title_info_primary_ssort asc, date_start_dtsi asc' @response, @document_list = search_service.fetch(folder_items_ids) end | 
#update ⇒ Object
| 55 56 57 58 59 60 61 62 63 | # File 'app/controllers/folders_controller.rb', line 55 def update # @folder is set by correct_user_for_folder if @folder.update(folder_params) flash[:notice] = t('blacklight.folders.update.success') redirect_to @folder else render action: :edit end end |