Sha256: aae66a29ebd5d0978b3818ee449d684f1da674272e06a123637ad324c8825593

Contents?: true

Size: 533 Bytes

Versions: 83

Compression:

Stored size: 533 Bytes

Contents

module Tenon
  class PostsController < Tenon::ResourcesController
    before_filter :get_collections

    def update
      params[:post][:post_category_ids] ||= []
      super
    end

    private

    def resource_params
      params.require(:post).permit!
    end

    def get_collections
      @categories = Tenon::PostCategory.order(:title)
      @users = Tenon::User.exclude_super_admins.approved
    end

    def search_args
      [
        'title ILIKE :q',
        { q: "%#{params[:q].downcase}%" }
      ]
    end
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
tenon-1.1.8 app/controllers/tenon/posts_controller.rb
tenon-1.1.7 app/controllers/tenon/posts_controller.rb
tenon-1.1.6 app/controllers/tenon/posts_controller.rb
tenon-1.1.5 app/controllers/tenon/posts_controller.rb
tenon-1.1.4 app/controllers/tenon/posts_controller.rb
tenon-1.1.3 app/controllers/tenon/posts_controller.rb
tenon-1.1.2 app/controllers/tenon/posts_controller.rb
tenon-1.1.1 app/controllers/tenon/posts_controller.rb
tenon-1.0.76 app/controllers/tenon/posts_controller.rb
tenon-1.0.75 app/controllers/tenon/posts_controller.rb
tenon-1.0.74 app/controllers/tenon/posts_controller.rb
tenon-1.0.73 app/controllers/tenon/posts_controller.rb
tenon-1.0.72 app/controllers/tenon/posts_controller.rb
tenon-1.0.71 app/controllers/tenon/posts_controller.rb
tenon-1.0.70 app/controllers/tenon/posts_controller.rb
tenon-1.0.69 app/controllers/tenon/posts_controller.rb
tenon-1.0.68 app/controllers/tenon/posts_controller.rb
tenon-1.0.67 app/controllers/tenon/posts_controller.rb
tenon-1.0.66 app/controllers/tenon/posts_controller.rb
tenon-1.0.65 app/controllers/tenon/posts_controller.rb