dev-resources.site
for different kinds of informations.
What is the ordering of Ruby on Rails controller filters?
Published at
8/10/2021
Categories
rails
shopifyapp
Author
drnic
Author
5 person written this
drnic
open
Some of my application's controllers are a blend of modules from other people's Rubygems, such as ShopifyApp library. They inject before and after action filters around my actions. Sometimes they abort the request and redirect somewhere else. I wanted to know what filters were being invoked and in what order:
class ProductsController < AuthenticatedController
def index
__callbacks[:process_action].map { |c| [c.kind, c.instance_variable_get(:"@key")] }
end
end
The output was like:
[
[:around, 82000],
[:before, :set_shop_host],
[:before, :redirect_to_splash_page],
[:before, :set_locale],
[:after, :set_test_cookie],
[:before, :verify_authenticity_token],
[:after, :verify_same_origin_request],
[:after, :set_esdk_headers],
[:before, :login_again_if_different_user_or_shop],
[:around, :activate_shopify_session],
[:before, :set_shop_origin]
]
shopifyapp Article's
8 articles in total
What is Shopify App Development and Why Does Your E-commerce Business Need It Now?
read article
How to Create a Shopify Omnichannel Customer Support InboxΒ App
read article
StoreLock
read article
Create A Mobile App With LEO Mobile App Builder Will Save You Time
read article
Do you know about the Announcement Bar App for Shopify?
read article
Why should you build for the Shopify App Store? (+How to Start)
read article
What is the ordering of Ruby on Rails controller filters?
currently reading
How can I Display data on an online store from the app server?
read article
Featured ones: