Using Filterrific gem for filtering, searching, and sorting list of ActiveRecord objects:
* Persist filter settings in the HTTP session or DB.
* Integrates with pagination (will_paginate or kaminari).
* Reset filter to default settings.
* Relies on ActiveRecord scopes.
* Shuttles filter settings from a filter UI to the controller and ActiveRecord.
* Can be used for HTML/JSON/JS/XML response formats.
The Spring Data project provides sophisticated support for NoSQL datastores. The MongoDB module consists of a namespace to easily setup MongoDB access, a template class to provide a nice API to persist and query objects as well as sophisticated support to build repositories accessing entities stored in a MongoDB. The talk will introduce the Spring Data MongoDB support.
Introduction to Oracle Data Guard BrokerZohar Elkayam
This is an old deck I recently renewed for a customer session. This is the introduction to Oracle Data Guard broker feature, how to deploy it, how to use it and what are its benefits.
This presentation is based on version 11g but most of it is also compatible to Oracle 12c,
Agenda:
- Oracle Data Guard overview
- Dataguard broker introduction
- Configuring and using the data guard
- Live Demos
Apache Solr is a popular, open source enterprise search platform built on the Java based search engine library Apache Lucene. It powers the search and navigation features of many of the world's largest companies like Netflix, Instagram, LinkedIn, Twitter and eBay, etc.
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...Carlos Sierra
Adaptive Cursor Sharing (ACS) is a feature available since 11g. It is enabled by default. ACS can help to generate multiple non-persistent Optimal Execution Plans for a given SQL. But it requires a sequence of events for it to get truly activated. This presentation describes what is ACS, when it is used and when it is not. Then it demonstrates ACS capabilities and limitations with a live demo.
This session is about: How Adaptive Cursor Sharing (ACS) actually works. How a bind sensitive cursor becomes bind aware. What are those "ACS buckets". How the "Selectivity Profile" works. Why sometimes your SQL becomes bind aware and why sometimes it does not. How is that ACS interacts with SQL Plan Management (SPM). These and other questions about ACS are answered in detail.
Some live demonstrations are used to illustrate the ramp-up process on ACS and how some child cursors are created then flagged as non-shareable. You will also "see" how the ACS Selectivity Profile is adapted as new executions make use of predicates with new Selectivities. ACS promotes Plan Flexibility while SPM promotes Plan Stability. Understanding how these duo interacts becomes of great value when some gentle intervention is needed to restore this delicate balance.
This session is for those Developers and DBAs that "need" to understand how things work. ACS can be seen as a back-box; or you can "look" inside and understand how it actually works. If you are curious about the ACS functionality, then this Session brings some light. Consider this session only if you are pretty familiar with Cursor Sharing, Binds, Plan Stability and Plan Flexibility.
The Spring Data project provides sophisticated support for NoSQL datastores. The MongoDB module consists of a namespace to easily setup MongoDB access, a template class to provide a nice API to persist and query objects as well as sophisticated support to build repositories accessing entities stored in a MongoDB. The talk will introduce the Spring Data MongoDB support.
Introduction to Oracle Data Guard BrokerZohar Elkayam
This is an old deck I recently renewed for a customer session. This is the introduction to Oracle Data Guard broker feature, how to deploy it, how to use it and what are its benefits.
This presentation is based on version 11g but most of it is also compatible to Oracle 12c,
Agenda:
- Oracle Data Guard overview
- Dataguard broker introduction
- Configuring and using the data guard
- Live Demos
Apache Solr is a popular, open source enterprise search platform built on the Java based search engine library Apache Lucene. It powers the search and navigation features of many of the world's largest companies like Netflix, Instagram, LinkedIn, Twitter and eBay, etc.
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...Carlos Sierra
Adaptive Cursor Sharing (ACS) is a feature available since 11g. It is enabled by default. ACS can help to generate multiple non-persistent Optimal Execution Plans for a given SQL. But it requires a sequence of events for it to get truly activated. This presentation describes what is ACS, when it is used and when it is not. Then it demonstrates ACS capabilities and limitations with a live demo.
This session is about: How Adaptive Cursor Sharing (ACS) actually works. How a bind sensitive cursor becomes bind aware. What are those "ACS buckets". How the "Selectivity Profile" works. Why sometimes your SQL becomes bind aware and why sometimes it does not. How is that ACS interacts with SQL Plan Management (SPM). These and other questions about ACS are answered in detail.
Some live demonstrations are used to illustrate the ramp-up process on ACS and how some child cursors are created then flagged as non-shareable. You will also "see" how the ACS Selectivity Profile is adapted as new executions make use of predicates with new Selectivities. ACS promotes Plan Flexibility while SPM promotes Plan Stability. Understanding how these duo interacts becomes of great value when some gentle intervention is needed to restore this delicate balance.
This session is for those Developers and DBAs that "need" to understand how things work. ACS can be seen as a back-box; or you can "look" inside and understand how it actually works. If you are curious about the ACS functionality, then this Session brings some light. Consider this session only if you are pretty familiar with Cursor Sharing, Binds, Plan Stability and Plan Flexibility.
This ppt helps people who would like to present their industrial training presentation on Oracle 11g DBA.
This one includes all the operations that dba has to be perform and some other internal concepts of Oracle.
SQL Database Audit overview is explained in this presentation. Auditing an instance of the SQL Server Database Engine or an individual database involves tracking and logging events that occur on the Database Engine.Database administrators and consultants often set up auditing for security purposes, for example, to ensure that those without the permission to access information do not access it.
OOW16 - Oracle Enterprise Manager 13c Cloud Control for Managing Oracle E-Bus...vasuballa
Oracle Application Management Suite for Oracle E-Business Suite delivers capabilities to facilitate management of Oracle E-Business Suite environments running in the Oracle Cloud and on-premises using a single pane of glass. Learn about key new features provided in the latest release available with Oracle Enterprise Manager 13c. Features covered include deploying patches and customization across all environments, comparing configurations between instances, provisioning a new instance to the Oracle Cloud, migrating an existing instance to the cloud, enforcing compliance standards, and automated cloning.
This is a recording of my Advanced Oracle Troubleshooting seminar preparation session - where I showed how I set up my command line environment and some of the main performance scripts I use!
Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)Kai Chan
Slides for my presentation at SoCal Code Camp, June 29, 2014
(http://www.socalcodecamp.com/socalcodecamp/session.aspx?sid=6337660f-37de-4d6e-a5bc-46ba54478e5e)
This ppt helps people who would like to present their industrial training presentation on Oracle 11g DBA.
This one includes all the operations that dba has to be perform and some other internal concepts of Oracle.
SQL Database Audit overview is explained in this presentation. Auditing an instance of the SQL Server Database Engine or an individual database involves tracking and logging events that occur on the Database Engine.Database administrators and consultants often set up auditing for security purposes, for example, to ensure that those without the permission to access information do not access it.
OOW16 - Oracle Enterprise Manager 13c Cloud Control for Managing Oracle E-Bus...vasuballa
Oracle Application Management Suite for Oracle E-Business Suite delivers capabilities to facilitate management of Oracle E-Business Suite environments running in the Oracle Cloud and on-premises using a single pane of glass. Learn about key new features provided in the latest release available with Oracle Enterprise Manager 13c. Features covered include deploying patches and customization across all environments, comparing configurations between instances, provisioning a new instance to the Oracle Cloud, migrating an existing instance to the cloud, enforcing compliance standards, and automated cloning.
This is a recording of my Advanced Oracle Troubleshooting seminar preparation session - where I showed how I set up my command line environment and some of the main performance scripts I use!
Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)Kai Chan
Slides for my presentation at SoCal Code Camp, June 29, 2014
(http://www.socalcodecamp.com/socalcodecamp/session.aspx?sid=6337660f-37de-4d6e-a5bc-46ba54478e5e)
The openCypher Project - An Open Graph Query LanguageNeo4j
We want to present the openCypher project, whose purpose is to make Cypher available to everyone – every data store, every tooling provider, every application developer. openCypher is a continual work in progress. Over the next few months, we will move more and more of the language artifacts over to GitHub to make it available for everyone.
openCypher is an open source project that delivers four key artifacts released under a permissive license: (i) the Cypher reference documentation, (ii) a Technology compatibility kit (TCK), (iii) Reference implementation (a fully functional implementation of key parts of the stack needed to support Cypher inside a data platform or tool) and (iv) the Cypher language specification.
We are also seeking to make the process of specifying and evolving the Cypher query language as open as possible, and are actively seeking comments and suggestions on how to improve the Cypher query language.
The purpose of this talk is to provide more details regarding the above-mentioned aspects.
We want to present the openCypher project, whose purpose is to make Cypher available to everyone – every data store, every tooling provider, every application developer. openCypher is a continual work in progress. Over the next few months, we will move more and more of the language artifacts over to GitHub to make it available for everyone.
openCypher is an open source project that delivers four key artifacts released under a permissive license: (i) the Cypher reference documentation, (ii) a Technology compatibility kit (TCK), (iii) Reference implementation (a fully functional implementation of key parts of the stack needed to support Cypher inside a data platform or tool) and (iv) the Cypher language specification.
We are also seeking to make the process of specifying and evolving the Cypher query language as open as possible, and are actively seeking comments and suggestions on how to improve the Cypher query language.
The purpose of this talk is to provide more details regarding the above-mentioned aspects.
Create Linked Open Data (LOD) Microthesauri using Art & Architecture Thesaurus (AAT) LOD. View and manage options by a non-techy person. Everyone can use, create,
derive from, & map to AAT microthesauri and make the digital collection become LOD-ready dataset.
ASP.NET MVC_Routing_Authentication_Aurhorization.pdfsetit72024
Introduction:
Begin with an overview of the .NET MVC framework and its importance in building dynamic and scalable web applications.
Introduce the key concepts that will be covered in the presentation: Attribute Routing, Authentication, and Authorization.
Highlight the significance of these features in enhancing the security, usability, and structure of MVC applications.
Section 1: Attribute Routing in .NET MVC:
Definition and Purpose:
Define Attribute Routing and explain its role in defining routes using attributes directly within the controller and action methods.
Emphasize the benefits of attribute routing in terms of readability, maintainability, and providing fine-grained control over URL patterns.
Syntax and Examples:
Provide examples of attribute routing syntax within controllers and actions.
Demonstrate how attribute routing allows developers to create custom, SEO-friendly, and RESTful URLs.
Showcase scenarios where attribute routing excels over convention-based routing.
Section 2: Authentication in .NET MVC:
Understanding Authentication:
Define Authentication and discuss its importance in verifying the identity of users accessing an application.
Introduce the authentication mechanisms supported by .NET MVC, such as Forms Authentication, Windows Authentication, and OAuth.
Implementing Authentication:
Walk through the process of implementing authentication in .NET MVC using attributes, filters, and middleware.
Discuss the role of the [Authorize] attribute and how it restricts access to specific controllers or actions based on the user's authentication status.
Section 3: Authorization in .NET MVC:
Overview of Authorization:
Define Authorization and distinguish it from authentication.
Emphasize the significance of controlling access to specific resources based on user roles, claims, or other criteria.
Implementing Authorization:
Discuss how authorization can be implemented in .NET MVC using attributes like [Authorize] and [AllowAnonymous].
Explore scenarios where role-based authorization and custom policies are essential.
Provide examples of how to implement role-based access control and attribute-based access control.
Case Studies and Best Practices:
Present real-world case studies or examples showcasing the effective use of attribute routing, authentication, and authorization in .NET MVC projects.
Share best practices for maintaining a secure and well-structured MVC application, including tips on managing user roles, securing sensitive data, and handling authentication cookies.
Conclusion:
Summarize the key takeaways from the presentation.
Reinforce the importance of attribute routing, authentication, and authorization in building robust and secure .NET MVC applications.
Encourage further exploration through resources, documentation, and community forums.
Multi faceted responsive search, autocomplete, feeds engine & logginglucenerevolution
Presented by Remi Mikalsen, Search Engineer, The Norwegian Centre for ICT in Education
Learn how utdanning.no leverages open source technologies to deliver a blazing fast multi-faceted responsive search experience and a flexible and efficient feeds engine on top of Solr 3.6. Among the key open source projects that will be covered are Solr, Ajax-Solr, SolrPHPClient, Bootstrap, jQuery and Drupal. Notable highlights are ajaxified pivot facets, multiple parents hierarchical facets, ajax autocomplete with edge-n-gram and grouping, integrating our search widgets on any external website, custom Solr logging and using Solr to deliver Atom feeds. utdanning.no is a governmental website that collects, normalizes and publishes study information for related to secondary school and higher education in Norway. With 1.2 million visitors each year and 12.000 indexed documents we focus on precise information and a high degree of usability for students, potential students and counselors.
OpenCms 8.5 integrates Apache Solr. And not only for full text search, but as a powerful query engine as well.
Imagine you want to show a list of "all resources of type news, that have changed since yesterday, where property X has the value Y" on your web page. Sure, there are API methods in OpenCms to load resources based on the type, on the date of change, or on the value of a specific property. But for many common use case combinations, there is no single API call. This means if you create a collector, you often end up sorting out the results of the initial API query in code.
In this session, Rüdiger will show how Apache Solr has been integrated in OpenCms 8.5. He will explain how to create improved front-end full text search functions with advanced options like faceting and spell check suggestions. And he will explain how to use Solr to directly read resources from the OpenCms VFS, allowing query combinations that combine resource attributes, properties and content in a powerful new way.
Similar to Filtering, Searching, and Sorting ActiveRecord Lists Using Filterrific (20)
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Mind IT Systems
Healthcare providers often struggle with the complexities of chronic conditions and remote patient monitoring, as each patient requires personalized care and ongoing monitoring. Off-the-shelf solutions may not meet these diverse needs, leading to inefficiencies and gaps in care. It’s here, custom healthcare software offers a tailored solution, ensuring improved care and effectiveness.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
E-commerce Application Development Company.pdfHornet Dynamics
Your business can reach new heights with our assistance as we design solutions that are specifically appropriate for your goals and vision. Our eCommerce application solutions can digitally coordinate all retail operations processes to meet the demands of the marketplace while maintaining business continuity.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Understanding Nidhi Software Pricing: A Quick Guide 🌟
Choosing the right software is vital for Nidhi companies to streamline operations. Our latest presentation covers Nidhi software pricing, key factors, costs, and negotiation tips.
📊 What You’ll Learn:
Key factors influencing Nidhi software price
Understanding the true cost beyond the initial price
Tips for negotiating the best deal
Affordable and customizable pricing options with Vector Nidhi Software
🔗 Learn more at: www.vectornidhisoftware.com/software-for-nidhi-company/
#NidhiSoftwarePrice #NidhiSoftware #VectorNidhi
27. Model – Add filterrific Direc1ve
# student.rb
Filterrific(
default_filter_params:
{ sorted_by: 'created_at_desc' },
available_filters: [
:sorted_by,
:search_query,
:with_country_id,
:with_created_at_gte
]
)
Define default filter seOngs
Specify which scopes are available to
Filterrific.
This is a safety mechanism to prevent
unauthorized access to your database.
It’s like strong parameters, just for
filter seOngs.
Enable Filterrific for the Student class
28. Model – Define Select Op1ons
# student.rb
def self.options_for_sorted_by
[
['Name (a-z)', 'name_asc'],
['Registration date (newest first)',
'created_at_desc'],
['Registration date (oldest first)',
'created_at_asc'],
['Country (a-z)', 'country_name_asc']
]
End
# country.rb
def self.options_for_select
order('LOWER(name)').map { |e| [e.name, e.id] }
end
These class methods
provide op1ons for
select drop-down and
are called in the
controller as part of
ini1alize_filterrific.
29. Model – Define Scopes
scope :sorted_by, -> { |sort_key|
# Sort students by sort_key
direction = (sort_key =~ /desc$/) ? 'desc' : 'asc’
...
}
scope :search_query, -> { |query|
# Filters students that matches the query
...
}
scope :with_country_id, -> { |country_ids|
# Filters students with any of the given country_ids
where(:country_id => [*country_ids])
}
scope :with_created_at_gte, -> { |ref_date|
# Filter students whom registered from the given date
where('students.created_at >= ?',
Date.strptime(ref_date, "%m/%d/%Y"))
}
30. Model – Define Scopes
scope :sorted_by, -> { |sort_key|
# Sort students by sort_key
direction = (sort_key =~ /desc$/) ? 'desc' : 'asc’
...
}
scope :search_query, -> { |query|
# Filters students that matches the query
...
}
scope :with_country_id, -> { |country_ids|
# Filters students with any of the given country_ids
where(:country_id => [*country_ids])
}
scope :with_created_at_gte, -> { |ref_date|
# Filter students whom registered from the given date
where('students.created_at >= ?',
Date.strptime(ref_date, "%m/%d/%Y"))
}
Filterrific relies heavily on Ac1veRecord scopes for filtering, so it is
important that you are familiar with how to use scopes.
hCp://filterrific.clearcove.ca/pages/ac1ve_record_scope_paCerns.html
33. Controller – ini1alize_filterrific
# students_controller.rb
def index
@filterrific = initialize_filterrific(
Student,
params[:filterrific],
select_options: {
sorted_by: Student.options_for_sorted_by,
with_country_id: Country.options_for_select
}
persistence_id: 'shared_key',
default_filter_params: {},
available_filters: [],
) or return
@students = @filterrific.find.page(params[:page])
...
end
Filterrific lives in the controller’s index ac1on.
34. Controller – ini1alize_filterrific
# students_controller.rb
def index
@filterrific = initialize_filterrific(
Student,
params[:filterrific],
select_options: {
sorted_by: Student.options_for_sorted_by,
with_country_id: Country.options_for_select
}
persistence_id: 'shared_key',
default_filter_params: {},
available_filters: [],
) or return
@students = @filterrific.find.page(params[:page])
...
end
An Ac1veRecord-based model class.
It can also be an Ac1veRecord rela1on.
35. Controller – ini1alize_filterrific
# students_controller.rb
def index
@filterrific = initialize_filterrific(
Student,
params[:filterrific],
select_options: {
sorted_by: Student.options_for_sorted_by,
with_country_id: Country.options_for_select
}
persistence_id: 'shared_key',
default_filter_params: {},
available_filters: [],
) or return
@students = @filterrific.find.page(params[:page])
...
end
Any params submiCed via web request.
If they are blank, filterrific will try params
persisted in the session next.
If those are blank, too, filterrific will use the
model's default filter seOngs.
36. Controller – ini1alize_filterrific
# students_controller.rb
def index
@filterrific = initialize_filterrific(
Student,
params[:filterrific],
select_options: {
sorted_by: Student.options_for_sorted_by,
with_country_id: Country.options_for_select
}
persistence_id: 'shared_key',
default_filter_params: {},
available_filters: [],
) or return
@students = @filterrific.find.page(params[:page])
...
end
Store any op1ons for <select> inputs in the
form.
The key refers to scope name defined in the
model
The value refers to method defined in the
model that return an array of op1ons
37. Controller – ini1alize_filterrific
# students_controller.rb
def index
@filterrific = initialize_filterrific(
Student,
params[:filterrific],
select_options: {
sorted_by: Student.options_for_sorted_by,
with_country_id: Country.options_for_select
}
persistence_id: 'shared_key',
default_filter_params: {},
available_filters: [],
) or return
@students = @filterrific.find.page(params[:page])
...
end
Defaults to "<controller>#<ac1on>" string
to isolate session persistence of mul1ple
filterrific instances.
Override this to share session persisted
filter params between mul1ple filterrific
instances.
Set to false to disable session persistence.
38. Controller – ini1alize_filterrific
# students_controller.rb
def index
@filterrific = initialize_filterrific(
Student,
params[:filterrific],
select_options: {
sorted_by: Student.options_for_sorted_by,
with_country_id: Country.options_for_select
}
persistence_id: 'shared_key',
default_filter_params: {},
available_filters: [],
) or return
@students = @filterrific.find.page(params[:page])
...
end
To override model defaults
39. Controller – ini1alize_filterrific
# students_controller.rb
def index
@filterrific = initialize_filterrific(
Student,
params[:filterrific],
select_options: {
sorted_by: Student.options_for_sorted_by,
with_country_id: Country.options_for_select
}
persistence_id: 'shared_key',
default_filter_params: {},
available_filters: [],
) or return
@students = @filterrific.find.page(params[:page])
...
end
To further restrict which filters are
in this filterrific instance.
40. Controller – ini1alize_filterrific
# students_controller.rb
def index
@filterrific = initialize_filterrific(
Student,
params[:filterrific],
select_options: {
sorted_by: Student.options_for_sorted_by,
with_country_id: Country.options_for_select
}
persistence_id: 'shared_key',
default_filter_params: {},
available_filters: [],
) or return
@students = @filterrific.find.page(params[:page])
...
end
This method also persists the
params in the session and handles
reseOng the filterrific params.
41. Controller – ini1alize_filterrific
# students_controller.rb
def index
@filterrific = initialize_filterrific(
Student,
params[:filterrific],
select_options: {
sorted_by: Student.options_for_sorted_by,
with_country_id: Country.options_for_select
}
persistence_id: 'shared_key',
default_filter_params: {},
available_filters: [],
) or return
@students = @filterrific.find.page(params[:page])
...
end
In order for reset_filterrific to work, it’s
important that we add the 'or return' bit
aher the call to 'ini1alize_filterrific'.
Otherwise the redirect will not work.
42. Controller – ini1alize_filterrific
# students_controller.rb
def index
@filterrific = initialize_filterrific(
Student,
params[:filterrific],
select_options: {
sorted_by: Student.options_for_sorted_by,
with_country_id: Country.options_for_select
}
persistence_id: 'shared_key',
default_filter_params: {},
available_filters: [],
) or return
@students = @filterrific.find.page(params[:page])
...
end
This method also persists the
params in the session and handles
reseOng the filterrific params.
Returns an Ac1veRecord rela1on
for all records that match the
filter seOngs.
We can paginate with
will_paginate or kaminari.
The rela1on returned can be
chained with other scopes to
further narrow down the scope of
the list, e.g., to apply permissions
or to exclude certain types of
records.